new KAGButton()
KAGButtonはButtonと大体同じです、
KAGButtonは直接KAGのbuttonタグの属性からボタンを設定できます
- Implements:
Extends
Members
(constant) initializer :string
The name of constructor the class, will be used to restore the object.
The constructor has to be accessable via
window[initializer]
Type:
- string
- Overrides:
- Implements:
needRedraw
Properties:
Type | Description |
---|---|
boolean |
- Inherited From:
partialDraw
Properties:
Type | Description |
---|---|
boolean |
- Inherited From:
rect
Properties:
Type | Description |
---|---|
Rect |
- Inherited From:
tagArgs
Properties:
Name | Type | Description |
---|---|---|
tagArgs |
Object.<string, any> |
Methods
cancel(layer, x, y)
Subclass should override to add functions
Parameters:
Name | Type | Description |
---|---|---|
layer |
MessageLayer | |
x |
number | |
y |
number |
- Inherited From:
canDrawPartial() → {boolean}
Can it draw only a certain part?
If yes, drawContext will be called with rect, and drawable should draw only in that rect.
Drawing less = better performance.
- Inherited From:
Returns:
- Type
- boolean
click(layer, x, y)
Subclass should override to add functions
Parameters:
Name | Type | Description |
---|---|---|
layer |
MessageLayer | |
x |
number | |
y |
number |
- Overrides:
drawOnContext(context, rect)
Draw on this context.
If canDrawPartial is true, this can be called with rect.
When it is called with rect, drawable should only draw in the specificed area.
Parameters:
Name | Type | Description |
---|---|---|
context |
CanvasRenderingContext2D | |
rect |
Rect | In the context's coordinate. |
- Overrides:
enter(layer, x, y)
Subclass should override to add functions
Parameters:
Name | Type | Description |
---|---|---|
layer |
MessageLayer | |
x |
number | |
y |
number |
- Overrides:
frame() → {Rect}
Return the frame, which is the actually area this drawable draws on (including things like shadow).
Subclass should override if needed.
- Inherited From:
Returns:
- Type
- Rect
importFromKAGArgs(kagArgs)
Parameters:
Name | Type | Description |
---|---|---|
kagArgs |
Object.<string, any> |
leave(layer, x, y)
Subclass should override to add functions
Parameters:
Name | Type | Description |
---|---|---|
layer |
MessageLayer | |
x |
number | |
y |
number |
- Overrides:
mousedown(layer, x, y)
Subclass should override to add functions
Parameters:
Name | Type | Description |
---|---|---|
layer |
MessageLayer | |
x |
number | |
y |
number |
- Inherited From:
mousemove(layer, x, y)
Subclass should override to add functions
Parameters:
Name | Type | Description |
---|---|---|
layer |
MessageLayer | |
x |
number | |
y |
number |
- Inherited From:
objectToBeSerialized(key) → {object|Serializable}
Return an object to be serialized for a specific key.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The key of property to be serialized |
- Inherited From:
- Implements:
Returns:
- An object or serializable to be saved for the specific key, return undefined = not to be saved.
- Type
- object | Serializable
toJSON() → {object|Serializable|Restorable}
- Implements:
Returns:
- An plain that can be serialized to json
- Type
- object | Serializable | Restorable