-
-
Loads the graphic (using graphic folder and graphic name)
-
-
Returns true if the sprite can be updated and redrawn
Returns:
Type |
Description |
Boolean
|
Sprite can be updated and redrawn |
-
-
Changes the font of the bitmap
Name |
Type |
Description |
font |
Object
|
Text font
Name |
Type |
Description |
fontFace |
String
|
optional
Font face |
fontSize |
Number
|
optional
Font size |
fontItalic |
Boolean
|
optional
Font italic |
|
-
-
Changes the paint opacity of the bitmap
Name |
Type |
Description |
paintOpacity |
Number
|
Paint opacity |
-
-
Changes the text color of the bitmap
Name |
Type |
Description |
textColor |
String
|
Text color |
-
-
Creates all objects
-
-
Loads an image by graphic name (if exists) or create the bitmap (if the fixed bitmap does not exist)
-
-
Name |
Type |
Description |
rtl |
Boolean
|
|
Returns:
-
createTextState
(text, x, y, width)Object
inherited
-
Name |
Type |
Description |
text |
String
|
|
x |
Number
|
|
y |
Number
|
|
width |
Number
|
|
Returns:
-
-
Destroys the bitmap
Return true if the bitmap destroyed
Returns:
Type |
Description |
Boolean
|
Bitmap destroyed |
-
-
Draws all
-
-
Draws a text
Returns true if successfully completed
Name |
Type |
Default |
Description |
text |
String
|
|
Text |
options |
Object
|
{}
|
optional
Options for drawing
Name |
Type |
Description |
font |
Object
|
optional
Use custom font |
textColor |
String
|
optional
Use custom text color |
paintOpacity |
Number
|
optional
Use custom paint opacity |
align |
String
|
optional
Align |
resetFont |
Boolean
|
optional
Use standard font after drawing the text |
resetTextColor |
String
|
optional
Use standard text color after drawing the text |
resetPaintOpacity |
String
|
optional
Use standard paint opacity after drawing the text |
x |
Number
|
optional
The X coordinate |
y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
width |
Number
|
optional
Width of the rectangle |
height |
Number
|
String
|
optional
Height of the rectangle or number of lines (String) |
pos |
Point
|
Object
|
optional
Position of the text (ignores other parameters of position: x, y) |
rect |
Rectangle
|
Object
|
optional
Rectangle for drawing (ignores other parameters of position: x, y, width, height, pos) |
pos.x |
Number
|
optional
The X coordinate |
pos.y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
rect.x |
Number
|
optional
The X coordinate |
rect.y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
rect.width |
Number
|
String
|
optional
Width of the rectangle |
rect.height |
Number
|
String
|
optional
Height of the rectangle or number of lines (String) |
|
Returns:
Type |
Description |
Boolean
|
Successfully completed |
Example
var sprite = new DKTools.Sprite(0, 0, 100, 36);
sprite.start();
sprite.drawText('Text', { y: '1' });
-
-
Name |
Type |
Description |
textState |
Object
|
|
-
getLocalPoint
(object, y)PIXI.Point
inherited
-
Returns the local point (coordinates inside the sprite)
Name |
Type |
Description |
object |
Number
|
Point
|
Object
|
optional
The X coordinate or Point or object with parameters |
y |
Number
|
optional
The Y coordinate (if object is Number) |
object.x |
Number
|
optional
The X coordinate |
object.y |
Number
|
optional
The Y coordinate |
Returns:
Type |
Description |
PIXI.Point
|
Local point (coordinates inside the sprite) |
-
-
Returns true if the sprite has the fill color
Returns:
Type |
Description |
Boolean
|
Sprite has the fill color |
-
-
Returns true if the sprite has fixed bitmap (setted using setupBitmap or setBitmap)
Returns:
Type |
Description |
Boolean
|
Sprite has fixed bitmap (setted using setupBitmap or setBitmap) |
-
-
Returns true if the sprite has the graphic folder
Returns:
Type |
Description |
Boolean
|
Sprite has the graphic folder |
-
-
Returns true if the sprite has the graphic name
Returns:
Type |
Description |
Boolean
|
Sprite has the graphic name |
-
initialize
(object, y, width, height, object)
inherited
-
Initializes a class object
Name |
Type |
Description |
object |
Number
|
DKTools.Sprite
|
Bitmap
|
Rectangle
|
Object
|
optional
The X coordinate or Sprite or Bitmap or Rectangle or object with properties |
y |
Number
|
optional
The Y coordinate (if object is Number) |
width |
Number
|
optional
Width of the bitmap (if object is Number) |
height |
Number
|
optional
Height of the bitmap (if object is Number) |
object.x |
Number
|
optional
The X coordinate |
object.y |
Number
|
optional
The Y coordinate |
object.width |
Number
|
optional
Width of the bitmap |
object.height |
Number
|
optional
Height of the bitmap |
object |
Bitmap
|
Object
|
optional
Bitmap or object with parameters
Name |
Type |
Description |
folder |
String
|
Path to file |
filename |
String
|
Name of file |
listener |
function
|
optional
Function of processing after loading a bitmap |
|
-
-
Returns true if the button is pressed longer than the long press interval
Returns:
Type |
Description |
Boolean
|
Button is pressed longer than the long press interval |
-
-
Returns true if touched longer than the long press interval
Returns:
Type |
Description |
Boolean
|
Touched longer than the long press interval |
-
-
Returns true if the button is pressed
Returns:
Type |
Description |
Boolean
|
Button is pressed |
-
-
Returns true if you can change the size of the sprite
Returns:
Type |
Description |
Boolean
|
You can change the size of the sprite |
-
-
Returns true if touched
Returns:
Type |
Description |
Boolean
|
Touched |
-
-
Returns the height of the line
Returns:
Type |
Description |
Number
|
Height of the line |
-
loadBitmap
(object, filename, listener)Boolean
inherited
-
Loads a bitmap
Returns true if the bitmap has been changed
Name |
Type |
Description |
object |
String
|
Object
|
Path to file or object with parameters |
filename |
String
|
Name of file (if object is String) |
listener |
function
|
optional
Function of processing after loading a bitmap (if object is String) |
object.folder |
String
|
Path to file |
object.filename |
String
|
Name of file |
object.listener |
function
|
optional
Function of processing after loading a bitmap |
Returns:
Type |
Description |
Boolean
|
Bitmap has been changed |
-
loadSystem
(object, listener)Boolean
inherited
-
Loads a bitmap from img/system/
Returns true if the bitmap has been changed
Name |
Type |
Description |
object |
String
|
Object
|
Name of file or object with parameters |
listener |
function
|
optional
Function of processing after loading a bitmap (if object is String) |
object.filename |
String
|
Name of file |
object.listener |
function
|
optional
Function of processing after loading a bitmap |
Returns:
Type |
Description |
Boolean
|
Bitmap has been changed |
-
loadWindowskin
(object, listener)Boolean
inherited
-
Loads a window skin from img/system/
Returns true if the bitmap has been changed
Name |
Type |
Description |
object |
String
|
Object
|
Name of file or object with parameters |
listener |
function
|
optional
Function of processing after loading a bitmap (if object is String) |
object.filename |
String
|
Name of file |
object.listener |
function
|
optional
Function of processing after loading a bitmap |
Returns:
Type |
Description |
Boolean
|
Bitmap has been changed |
-
-
Moves the sprite (taking into account the anchor)
Name |
Type |
Description |
x |
Number
|
optional
The X coordinate or Point or object with parameters |
y |
Number
|
String
|
optional
The Y coordinate or line number (String) (if object is Number) |
- Version:
- Since:
-
-
Processes all
-
-
Processes a mouse press
-
-
Processes a touches
-
-
Removes the bitmap
Name |
Type |
Default |
Description |
destroy |
Boolean
|
false
|
optional
Destroy the bitmap |
- Version:
-
-
Resets all
-
-
Resets the font of the bitmap
-
-
Resets the font settings
- Since:
-
-
Resets the paint opacity of the bitmap
-
-
Resets the text color of the bitmap
-
resize
(width, height, blockStart)Boolean
inherited
-
Changes the width and height of the sprite
Returns true if the change occurred
Name |
Type |
Default |
Description |
width |
Number
|
|
Width of the sprite |
height |
Number
|
String
|
|
Height of the sprite or number of lines (String) |
blockStart |
Boolean
|
false
|
optional
Blocking the call of the "start" function |
- Version:
Returns:
Type |
Description |
Boolean
|
Change occurred |
-
setAlign
(align, blockRefreshAll)Boolean
inherited
-
Changes the align
Returns true if the change occurred
Name |
Type |
Default |
Description |
align |
String
|
|
optional
Text align |
blockRefreshAll |
Boolean
|
false
|
optional
Blocking the call of the "refreshAll" function |
Returns:
Type |
Description |
Boolean
|
Change occurred |
-
-
Changes the bitmap
Returns true if the change occurred
Name |
Type |
Description |
object |
Bitmap
|
Object
|
optional
Bitmap or object with parameters
Name |
Type |
Description |
folder |
String
|
Path to file |
filename |
String
|
Name of file |
listener |
function
|
optional
Function of processing after loading a bitmap |
|
Returns:
Type |
Description |
Boolean
|
Change occurred |
-
setFillColor
(color, blockRefreshAll)Boolean
inherited
-
Changes the fill color
Returns true if the change occurred
Name |
Type |
Default |
Description |
color |
String
|
|
optional
Fill color |
blockRefreshAll |
Boolean
|
false
|
optional
Blocking the call of the "refreshAll" function |
Returns:
Type |
Description |
Boolean
|
Change occurred |
-
-
Changes the font of the bitmap
Returns true if the change occurred
Name |
Type |
Default |
Description |
font |
Object
|
|
optional
Text font |
blockStart |
Boolean
|
false
|
optional
Blocking the call of the "start" function |
font.fontFace |
String
|
|
optional
Font face |
font.fontSize |
Number
|
|
optional
Font size |
font.fontItalic |
Boolean
|
|
optional
Font italic |
Returns:
Type |
Description |
Boolean
|
Change occurred |
-
setGraphicFolder
(folder, blockStart)Boolean
inherited
-
Changes the graphic folder
Returns true if the change occurred
Name |
Type |
Default |
Description |
folder |
String
|
|
optional
Graphic folder |
blockStart |
Boolean
|
false
|
optional
Blocking the call of the "start" function |
Returns:
Type |
Description |
Boolean
|
Change occurred |
-
setGraphicName
(graphicName, blockStart)Boolean
inherited
-
Changes the graphic name
Returns true if the change occurred
Name |
Type |
Default |
Description |
graphicName |
String
|
|
optional
Graphic name |
blockStart |
Boolean
|
false
|
optional
Blocking the call of the "start" function |
Returns:
Type |
Description |
Boolean
|
Change occurred |
-
setPaintOpacity
(opacity, blockRefreshAll)Boolean
inherited
-
Changes the paint opacity
Returns true if the change occurred
Name |
Type |
Default |
Description |
opacity |
Number
|
|
optional
Paint opacity |
blockRefreshAll |
Boolean
|
false
|
optional
Blocking the call of the "refreshAll" function |
Returns:
Type |
Description |
Boolean
|
Change occurred |
-
setTextColor
(color, blockRefreshAll)Boolean
inherited
-
Changes the text color
Returns true if the change occurred
Name |
Type |
Default |
Description |
color |
String
|
|
optional
Text color |
blockRefreshAll |
Boolean
|
false
|
optional
Blocking the call of the "refreshAll" function |
Returns:
Type |
Description |
Boolean
|
Change occurred |
-
-
Sets the align
Name |
Type |
Default |
Description |
align |
String
|
this.standardAlign()
|
optional
Text align |
-
-
Sets all parameters
Name |
Type |
Default |
Description |
object |
Object
|
{}
|
optional
Parameters
Name |
Type |
Description |
longPressInterval |
Number
|
optional
Interval of long pressing |
|
- Version:
-
-
Sets the anchor of the sprite
Name |
Type |
Description |
object |
Number
|
Point
|
optional
The X coordinate or Point |
y |
Number
|
optional
The Y coordinate (if object is Number) |
- Version:
-
-
Sets the bitmap
Name |
Type |
Description |
object |
Bitmap
|
Object
|
optional
Bitmap or object with parameters
Name |
Type |
Description |
folder |
String
|
Path to file |
filename |
String
|
Name of file |
listener |
function
|
optional
Function of processing after loading a bitmap |
hue |
Number
|
optional
Hue of bitmap |
smooth |
Boolean
|
optional
Smooth of bitmap |
|
-
-
Sets the fill color
Name |
Type |
Description |
color |
String
|
optional
Fill color |
-
-
Sets the font of the bitmap
Name |
Type |
Description |
font |
Object
|
optional
Text font
Name |
Type |
Description |
fontFace |
String
|
optional
Font face |
fontSize |
Number
|
optional
Font size |
fontItalic |
Boolean
|
optional
Font italic |
|
-
setupFrame
(object, y, width, height)
inherited
-
Sets the frame of the sprite
Name |
Type |
Description |
object |
Number
|
Rectangle
|
optional
The X coordinate or Rectangle |
y |
Number
|
optional
The Y coordinate (if object is Number) |
width |
Number
|
optional
Width of the frame (if object is Number) |
height |
Number
|
optional
Height of the frame (if object is Number) |
- Version:
-
-
Sets the graphic folder
Name |
Type |
Description |
folder |
String
|
optional
Path to folder |
-
setupGraphicLoadListener
(listener)
inherited
-
Sets the listener on load of graphic
Name |
Type |
Description |
listener |
function
|
Listener |
-
-
Sets the graphic name
Name |
Type |
Description |
graphicName |
String
|
optional
Graphic name |
-
setupLongPressInterval
(interval)
-
Sets the interval of long pressing
Name |
Type |
Default |
Description |
interval |
Number
|
this.standardLongPressInterval()
|
optional
Interval of long pressing |
-
-
Sets the paint opacity
Name |
Type |
Description |
opacity |
Number
|
optional
Paint opacity |
-
-
Sets the size of the bitmap
Name |
Type |
Description |
width |
Number
|
optional
Width of the bitmap |
height |
Number
|
String
|
optional
Height of the bitmap |
- Version:
-
-
Sets the color of the text
Name |
Type |
Description |
color |
String
|
optional
Text color |
-
-
Returns the standard activity of the button
Returns:
Type |
Description |
Boolean
|
Standard activity of the button |
-
-
Returns the standard text align
Returns:
Type |
Description |
String
|
Standard text align |
-
-
Returns the standard anchor
Returns:
Type |
Description |
Point
|
Standard anchor |
-
-
Returns the standard fill color
Returns:
Type |
Description |
String
|
null
|
Standard fill color |
-
-
Returns the standard font
- Version:
Returns:
Type |
Description |
Object
|
Standard font |
-
-
Returns the standard font bold
- Since:
Returns:
Type |
Description |
Boolean
|
Standard font bold |
-
-
Returns the standard font face
Returns:
Type |
Description |
String
|
Standard font face |
-
-
Returns the standard font italic
Returns:
Type |
Description |
Boolean
|
Standard font italic |
-
-
Returns the standard font size
Returns:
Type |
Description |
String
|
Standard font size |
-
-
Returns the standard frame
Returns:
Type |
Description |
Rectangle
|
Standard frame |
-
-
Returns the standard graphic folder
Returns:
Type |
Description |
String
|
Standard graphic folder |
-
-
Returns the standard graphic name
Returns:
Type |
Description |
String
|
standard graphic name |
-
standardLongPressInterval
()Number
-
Returns the standard interval of long pressing
Returns:
Type |
Description |
Number
|
Standard interval of long pressing |
-
-
Returns the standard paint opacity
Returns:
Type |
Description |
Number
|
Standard paint opacity |
-
-
Returns the standard text color
Returns:
Type |
Description |
String
|
Standard text color |
-
-
Updates the button
- Version:
-
-
Updates all
-
-
Updates the bitmap
-
-
Updates the button state
-
-
Updates the fill of the sprite
-
-
Updates the font of the bitmap
Name |
Type |
Default |
Description |
font |
Object
|
{}
|
optional
Text font
Name |
Type |
Description |
fontFace |
String
|
optional
Font face |
fontSize |
Number
|
optional
Font size |
fontItalic |
Boolean
|
optional
Font italic |
|
-
-
Updates the events with type: long-touch
-
updateLongTouchFinishedEvents
()
-
Updates the events with type: mouse-long-press-finished
-
updateLongTouchStartedEvents
()
-
Updates the events with type: mouse-long-press-started
-
updateMouseClickEvents
(button)
-
Updates the events with type: mouse-click-button
Name |
Type |
Description |
button |
String
|
Mouse button (left, middle or right) |
-
updateMouseDownEvents
(button)
-
Updates the events with type: mouse-down-button
Name |
Type |
Description |
button |
String
|
Mouse button (left, middle or right) |
-
updateMouseLongPressEvents
(button)
-
Updates the events with type: mouse-long-press-button
Name |
Type |
Description |
button |
String
|
Mouse button (left, middle or right) |
-
updateMouseLongPressFinishedEvents
(button)
-
Updates the events with type: mouse-long-press-button-finished
Name |
Type |
Description |
button |
String
|
Mouse button (left, middle or right) |
-
updateMouseLongPressStartedEvents
(button)
-
Updates the events with type: mouse-long-press-button-started
Name |
Type |
Description |
button |
String
|
Mouse button (left, middle or right) |
-
updateMouseUpEvents
(button)
-
Updates the events with type: mouse-up-button
Name |
Type |
Description |
button |
String
|
Mouse button (left, middle or right) |
-
-
Updates the paint opacity
Name |
Type |
Description |
paintOpacity |
Number
|
optional
Paint opacity |
-
updateStateNormalEvents
()
-
Updates the events with type: state-normal
-
updateStatePressedEvents
()
-
Updates the events with type: state-pressed
-
-
Updates the text color
Name |
Type |
Description |
textColor |
String
|
optional
Text color |
-
-
Updates the events with type: touch-down
-
-
Updates the events with type: touch
-
-
Updates the events with type: touch-up