JSSymbol

API for managing icon objects registration.

Create a API with Module.getSymbol.

var symbol = Module.getSymbol();

Function

getIcon(id) → JSIcon

Returns a JSIcon object added inside JSSymbol.

Name
Type
Description

id

string

Symbol registration ID.

  • Return

    • JSIcon: Successfully returns the icon.

    • null: Icon return failed.

    • Failure conditions.

      • If there is no object with the same name as id

  • Sample

insertIcon(id, data, width, height) → boolean

Registers a new JSIcon inside JSSymbol.

The data variable is based on a Uint8Array of binary array data.

Input the actual size of the image for width and height (>1).

Name
Type
Description

id

string

Symbol registration ID.

data

object

Image binary data.

width

number

Width of the image.

height

number

Height of the image.

  • Return

    • true: Addition successful.

    • false: Addition failed.

    • Failure conditions

      • If there is an icon registration with the same id as the id.

      • If the data value is null.

      • If width, height < 0

  • Sample

deleteIcon(id) → boolean

Deletes a JSIcon existing inside JSSymbol.

Name
Type
Description

id

string

Symbol registration ID.

  • Return

    • true: Deletion successful.

    • false: Deletion failed.

    • Failure conditions

      • If an icon is not registered with the same id as that id.

      • If there is one or more objects referencing the JSIcon(Operate after deleting the texture of the referencing object).

  • Sample

Last updated