-
-
Clears all data
-
_createEventsManager
()
private
-
Creates the event manager
-
-
Activates the object
-
-
Returns the name of the actor
Name |
Type |
Description |
n |
Number
|
Number of the actor |
Returns:
Type |
Description |
String
|
Name of the actor |
-
-
Adds the animation
Returns:
-
-
Adds the event
Name |
Type |
Description |
object |
DKTools.Event
|
Object
|
Event or object with parameters for the event
Name |
Type |
Description |
id |
Number
|
String
|
*
|
optional
ID of the event |
type |
String
|
optional
Type of the event |
repeatTime |
Number
|
optional
Time of one repeat |
repeats |
Number
|
optional
Amount of repeats |
remainingPauseTime |
Number
|
optional
Remaining time of pause |
onStart |
function
|
optional
Handler of the event start |
onUpdate |
function
|
optional
Handler of the event update |
onPause |
function
|
optional
Handler of the event pause |
onReset |
function
|
optional
Handler of the event reset |
onRepeat |
function
|
optional
Handler of the event repeat |
onSuccess |
function
|
optional
Handler of the event success |
onFail |
function
|
optional
Handler of the event fail |
|
Returns:
Examples
const sprite = new DKTools.Sprite();
sprite.addEvent({
type: 'update',
onUpdate: () => {
// code
}
});
const sprite = new DKTools.Sprite();
sprite.addEvent({
type: 'update',
repeats: 0,
repeatTime: 60,
onSuccess: () => {
// code
}
});
-
-
Adds the filter
Name |
Type |
Description |
filter |
*
|
Filter |
-
-
Adds the one time event
Name |
Type |
Description |
object |
DKTools.Event
|
Object
|
Event or object with parameters for the event
Name |
Type |
Description |
id |
Number
|
String
|
*
|
optional
ID of the event |
type |
String
|
optional
Type of the event |
remainingPauseTime |
Number
|
optional
Remaining time of pause |
onStart |
function
|
optional
Handler of the event start |
onUpdate |
function
|
optional
Handler of the event update |
onPause |
function
|
optional
Handler of the event pause |
onReset |
function
|
optional
Handler of the event reset |
onRepeat |
function
|
optional
Handler of the event repeat |
onSuccess |
function
|
optional
Handler of the event success |
onFail |
function
|
optional
Handler of the event fail |
|
Returns:
-
calcTextHeight
(textState)Number
-
Name |
Type |
Description |
textState |
Object
|
Text state |
Returns:
Type |
Description |
Number
|
Text height |
-
-
Returns true if the object can be updated and redrawn
Returns:
Type |
Description |
Boolean
|
Object can be updated and redrawn |
-
-
Checks all
-
-
Clears the bitmap
Returns true if successfully completed
Returns:
Type |
Description |
Boolean
|
Successfully completed |
-
clearRect
(object, y, width, height)Boolean
-
Clears a rectangle
Returns true if successfully completed
Name |
Type |
Description |
object |
Number
|
Rectangle
|
Object
|
optional
The X coordinate or Rectangle or object with parameters |
y |
Number
|
String
|
optional
The Y coordinate or line number (String) (if object is Number) |
width |
Number
|
optional
Width of the rectangle (if object is Number) |
height |
Number
|
String
|
optional
Height of the rectangle or number of lines (String) (if object is Number) |
object.x |
Number
|
optional
The X coordinate |
object.y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
object.width |
Number
|
optional
Width of the rectangle |
object.height |
Number
|
String
|
optional
Height of the rectangle or number of lines (String) |
Returns:
Type |
Description |
Boolean
|
Successfully completed |
-
convertEscapeCharacters
(text)String
-
Converts the escape characters
Returns the text with converted the escaped characters
Name |
Type |
Description |
text |
String
|
Text |
Returns:
Type |
Description |
String
|
Text with converted the escaped characters |
-
-
Creates all objects
-
-
Deactivates the object
-
-
Draws all
-
drawBitmap
(object, options)Boolean
-
Draws a bitmap
Returns true if successfully completed
Name |
Type |
Default |
Description |
object |
Bitmap
|
Object
|
|
Bitmap or object with parameters |
options |
Object
|
{}
|
optional
Options for drawing |
object.folder |
String
|
|
Path to file |
object.filename |
String
|
|
Name of file |
object.listener |
function
|
|
optional
Function of processing after loading a bitmap |
options.sync |
Boolean
|
|
optional
Draw if the bitmap is ready |
options.source |
function
|
Rectangle
|
Object
|
|
optional
Source from bitmap. Function or Rectangle or object with parameters |
options.destination |
function
|
Rectangle
|
Object
|
|
optional
Destination to bitmap. Function or Rectangle or object with parameters |
options.callback |
function
|
|
optional
Callback function, which should return an object with source and destination |
options.paintOpacity |
Number
|
|
optional
Change paint opacity |
options.resetPaintOpacity |
Boolean
|
|
optional
Reset paint opacity |
options.source.x |
Number
|
|
optional
The X coordinate |
options.source.y |
Number
|
String
|
|
optional
The Y coordinate or line number (String) |
options.source.width |
Number
|
|
optional
Width of the rectangle |
options.source.height |
Number
|
String
|
|
optional
Height of the rectangle or number of lines (String) |
options.destination.x |
Number
|
|
optional
The X coordinate |
options.destination.y |
Number
|
String
|
|
optional
The Y coordinate or line number (String) |
options.destination.width |
Number
|
|
optional
Width of the rectangle |
options.destination.height |
Number
|
String
|
|
optional
Height of the rectangle or number of lines (String) |
Returns:
Type |
Description |
Boolean
|
Successfully completed |
Example
Drawing half of the bitmap
const sprite = new DKTools.Sprite(0, 0, 200, 200);
sprite.start();
sprite.drawBitmap({ folder: 'img/system/', filename: 'Window' }, {
callback: function(bitmap, sprite) { // loaded bitmap, sprite
return {
source: {
width: bitmap.width / 2,
height: bitmap.height / 2
}
}
}
});
-
drawBitmapAsync
(object, options)Boolean
async
-
Draws a bitmap
Asynchronous version of DKTools.Base.prototype.drawBitmap
Returns true if successfully completed
Name |
Type |
Default |
Description |
object |
Bitmap
|
Object
|
|
Bitmap or object with parameters |
options |
Object
|
{}
|
optional
Options for drawing |
object.folder |
String
|
|
Path to file |
object.filename |
String
|
|
Name of file |
object.listener |
function
|
|
optional
Function of processing after loading a bitmap |
options.source |
function
|
Rectangle
|
Object
|
|
optional
Source from bitmap. Function or Rectangle or object with parameters |
options.destination |
function
|
Rectangle
|
Object
|
|
optional
Destination to bitmap. Function or Rectangle or object with parameters |
options.callback |
function
|
|
optional
Callback function, which should return an object with source and destination |
options.source.x |
Number
|
|
optional
The X coordinate |
options.source.y |
Number
|
String
|
|
optional
The Y coordinate or line number (String) |
options.source.width |
Number
|
|
optional
Width of the rectangle |
options.source.height |
Number
|
String
|
|
optional
Height of the rectangle or number of lines (String) |
options.destination.x |
Number
|
|
optional
The X coordinate |
options.destination.y |
Number
|
String
|
|
optional
The Y coordinate or line number (String) |
options.destination.width |
Number
|
|
optional
Width of the rectangle |
options.destination.height |
Number
|
String
|
|
optional
Height of the rectangle or number of lines (String) |
Returns:
Type |
Description |
Boolean
|
Successfully completed |
-
drawCharacter
(characterName, characterIndex, options)Boolean
-
Draws a character
Returns true if successfully completed
Name |
Type |
Default |
Description |
characterName |
String
|
|
Character filename |
characterIndex |
Number
|
|
Character index |
options |
Object
|
{}
|
optional
Options for drawing
Name |
Type |
Description |
x |
Number
|
optional
The X coordinate |
y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
pos |
Point
|
Object
|
optional
Position for drawing (ignores other parameters of position: x, y) |
paintOpacity |
Number
|
optional
Change paint opacity |
resetPaintOpacity |
Boolean
|
optional
Reset paint opacity |
pos.x |
Number
|
optional
The X coordinate |
pos.y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
|
Returns:
Type |
Description |
Boolean
|
Successfully completed |
-
drawCircle
(options)Boolean
-
Draws a circle
Returns true if successfully completed
Name |
Type |
Default |
Description |
options |
Object
|
{}
|
optional
Options for drawing
Name |
Type |
Description |
x |
Number
|
optional
The X coordinate |
y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
pos |
Point
|
Object
|
optional
Position for drawing (ignores other parameters of position: x, y) |
radius |
Number
|
optional
Radius of the circle |
color |
String
|
optional
Color of the circle |
paintOpacity |
Number
|
optional
Change paint opacity |
resetPaintOpacity |
Boolean
|
optional
Reset paint opacity |
pos.x |
Number
|
optional
The X coordinate |
pos.y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
|
Returns:
Type |
Description |
Boolean
|
Successfully completed |
-
drawFace
(faceName, faceIndex, options)Boolean
-
Draws a character face
Returns true if successfully completed
Name |
Type |
Default |
Description |
faceName |
String
|
|
Face filename |
faceIndex |
Number
|
|
Face index |
options |
Object
|
{}
|
optional
Options for drawing
Name |
Type |
Description |
x |
Number
|
optional
The X coordinate |
y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
width |
Number
|
optional
Width of the face |
height |
Number
|
String
|
optional
Height of the face or number of lines (String) |
pos |
Point
|
Object
|
optional
Position for drawing (ignores other parameters of position: x, y) |
rect |
Rectangle
|
Object
|
optional
Rectangle for drawing (ignores other parameters of position: x, y, pos) |
paintOpacity |
Number
|
optional
Change paint opacity |
resetPaintOpacity |
Boolean
|
optional
Reset paint opacity |
pos.x |
Number
|
optional
The X coordinate |
pos.y |
Number
|
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
|
optional
Width of the face |
rect.height |
Number
|
String
|
optional
Height of the face or number of lines (String) |
|
Returns:
Type |
Description |
Boolean
|
Successfully completed |
-
drawGauge
(options)Boolean
-
Draws a gauge
Returns true if successfully completed
Name |
Type |
Default |
Description |
options |
Object
|
{}
|
optional
Options for drawing
Name |
Type |
Description |
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 for drawing (ignores other parameters of position: x, y) |
rect |
Rectangle
|
Object
|
optional
Rectangle for drawing (ignores other parameters of position: x, y, width, height, pos) |
rate |
Number
|
optional
Gauge width rate |
type |
String
|
optional
Gauge type (horizontal or vertical) |
reversed |
Boolean
|
optional
Reversed gauge |
gradient |
String
|
optional
Gradient type (horizontal or vertical) |
gradientPadding |
Number
|
optional
Gradient inner padding |
backgroundColor |
String
|
optional
Background fill color |
color |
String
|
optional
Fill color |
color1 |
String
|
optional
First gradient color (ignores other parameters: color) |
color2 |
String
|
optional
Second gradient color (ignores other parameters: color) |
paintOpacity |
Number
|
optional
Change paint opacity |
resetPaintOpacity |
Boolean
|
optional
Reset paint opacity |
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
|
optional
Width of the rectangle |
rect.height |
Number
|
String
|
optional
Height of the rectangle or number of lines (String) |
|
- Version:
Returns:
Type |
Description |
Boolean
|
Successfully completed |
-
drawIcon
(iconIndex, options)Boolean
-
Draws an icon
Returns true if successfully completed
Name |
Type |
Default |
Description |
iconIndex |
Number
|
|
Icon index |
options |
Object
|
{}
|
optional
Options for drawing
Name |
Type |
Default |
Description |
x |
Number
|
|
optional
The X coordinate |
y |
Number
|
String
|
|
optional
The Y coordinate or line number (String) |
pos |
Point
|
Object
|
|
optional
Position for drawing (ignores other parameters of position: x, y) |
paintOpacity |
Number
|
|
optional
Change paint opacity |
resetPaintOpacity |
Boolean
|
|
optional
Reset paint opacity |
iconSet |
String
|
'IconSet'
|
optional
IconSet filename |
pos.x |
Number
|
|
optional
The X coordinate |
pos.y |
Number
|
String
|
|
optional
The Y coordinate or line number (String) |
|
Returns:
Type |
Description |
Boolean
|
Successfully completed |
-
drawItemName
(item, options)Boolean
-
Draws a name of the item
Returns true if successfully completed
Name |
Type |
Default |
Description |
item |
Object
|
|
Item |
options |
Object
|
{}
|
optional
Options for drawing
Name |
Type |
Description |
x |
Number
|
optional
The X coordinate |
y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
pos |
Point
|
Object
|
optional
Position for drawing (ignores other parameters of position: x, y) |
iconX |
Number
|
optional
The X coordinate of the icon |
iconY |
Number
|
String
|
optional
The Y coordinate of the icon or line number (String) |
iconPos |
Point
|
Object
|
optional
Position of the icon (ignores other parameters of position: iconX, iconY) |
width |
Number
|
optional
Width of the item name |
paintOpacity |
Number
|
optional
Change paint opacity |
resetPaintOpacity |
Boolean
|
optional
Reset paint opacity |
pos.x |
Number
|
optional
The X coordinate |
pos.y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
iconPos.x |
Number
|
optional
The X coordinate |
iconPos.y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
|
Returns:
Type |
Description |
Boolean
|
Successfully completed |
-
drawLine
(options)Boolean
-
Draws a line
Returns true if successfully completed
Name |
Type |
Default |
Description |
options |
Object
|
0
|
optional
Options for drawing
Name |
Type |
Description |
x1 |
Number
|
optional
The X coordinate of start of the line |
y1 |
Number
|
String
|
optional
The Y coordinate of start of the line or line number (String) |
x2 |
Number
|
optional
The X coordinate of end of the line |
y2 |
Number
|
String
|
optional
The Y coordinate of end of the line or line number (String) |
pos1 |
Point
|
Object
|
optional
Position for drawing (ignores other parameters of position: x1, y1) |
pos2 |
Point
|
Object
|
optional
Position for drawing (ignores other parameters of position: x2, y2) |
color |
String
|
optional
Line color |
lineWidth |
Number
|
optional
Line width |
paintOpacity |
Number
|
optional
Change paint opacity |
resetPaintOpacity |
Boolean
|
optional
Reset paint opacity |
pos1.x |
Number
|
optional
The X coordinate of start of the line |
pos1.y |
Number
|
String
|
optional
The Y coordinate of start of the line or line number (String) |
pos2.x |
Number
|
optional
The X coordinate of start of the line |
pos2.y |
Number
|
String
|
optional
The Y coordinate of start of the line or line number (String) |
|
Returns:
Type |
Description |
Boolean
|
Successfully completed |
-
drawPolygon
(options)Boolean
-
Draws a polygon
Returns true if successfully completed
Name |
Type |
Description |
options |
Object
|
Options for drawing
Name |
Type |
Description |
points |
Array.<Point>
|
Array.<Object>
|
optional
Points or objects with parameters |
color |
String
|
optional
Line color |
lineWidth |
Number
|
optional
Line width |
paintOpacity |
Number
|
optional
Change paint opacity |
resetPaintOpacity |
Boolean
|
optional
Reset paint opacity |
points[].x |
Number
|
optional
The X coordinate |
points[].y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
|
Returns:
Type |
Description |
Boolean
|
Successfully completed |
-
drawTextEx
(text, options)Number
-
Draws a text (special characters are supported)
Returns the width of the text
Name |
Type |
Default |
Description |
text |
String
|
|
Text |
options |
Object
|
{}
|
optional
Options for drawing
Name |
Type |
Description |
wrap |
Object
|
optional
Options for text wrap |
x |
Number
|
optional
The X coordinate |
y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
pos |
Point
|
Object
|
optional
Position of the text (ignores other parameters of position: x, y) |
startX |
Number
|
optional
Start X |
startY |
Number
|
optional
Start Y |
wrap.maxWidth |
Number
|
optional
Max width of a text line |
wrap.maxLines |
Number
|
optional
Max lines |
pos.x |
Number
|
optional
The X coordinate |
pos.y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
|
Returns:
Type |
Description |
Number
|
Width of the text |
-
-
Fills the bitmap with color
Returns true if successfully completed
Name |
Type |
Description |
color |
String
|
optional
Color of fill |
Returns:
Type |
Description |
Boolean
|
Successfully completed |
-
fillRect
(options)Boolean
-
Fills a rectangle with color
Returns true if successfully completed
Name |
Type |
Default |
Description |
options |
Object
|
{}
|
optional
Parameters for drawing
Name |
Type |
Description |
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 for drawing (ignores other parameters of position: x, y) |
rect |
Rectangle
|
Object
|
optional
Rectangle for drawing (ignores other parameters of position: x, y, width, height, pos) |
color |
String
|
optional
Fill color |
paintOpacity |
Number
|
optional
Change paint opacity |
resetPaintOpacity |
Boolean
|
optional
Reset paint opacity |
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
|
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 |
-
fontHeight
(lineHeight)Number
-
Returns the font height for the line height
Name |
Type |
Description |
lineHeight |
Number
|
optional
Line height |
- Since:
Returns:
Type |
Description |
Number
|
Font height for the line height |
-
getLocalPoint
(object, y)PIXI.Point
-
Returns the local point (coordinates inside the object)
Name |
Type |
Description |
object |
Number
|
Point
|
optional
The X coordinate or Point |
y |
Number
|
optional
The Y coordinate (if object is Number) |
- Version:
Returns:
Type |
Description |
PIXI.Point
|
Local point (coordinates inside the object) |
-
gradientFillAll
(color1, color2, vertical)Boolean
-
Fills the bitmap with gradient
Returns true if successfully completed
Name |
Type |
Default |
Description |
color1 |
String
|
'black'
|
optional
First color |
color2 |
String
|
'white'
|
optional
Second color |
vertical |
Boolean
|
false
|
optional
Vertical gradient |
Returns:
Type |
Description |
Boolean
|
Successfully completed |
-
gradientFillRect
(options)Boolean
-
Fills a rectangle with a gradient
Returns true if successfully completed
Name |
Type |
Default |
Description |
options |
Object
|
{}
|
optional
Parameters for drawing
Name |
Type |
Description |
color1 |
String
|
optional
First color |
color2 |
String
|
optional
Second color |
vertical |
Boolean
|
optional
Vertical gradient |
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) |
rect |
Rectangle
|
optional
Rectangle for drawing (ignores other parameters of position: x, y, width, height) |
paintOpacity |
Number
|
optional
Change paint opacity |
resetPaintOpacity |
Boolean
|
optional
Reset paint opacity |
|
Returns:
Type |
Description |
Boolean
|
Successfully completed |
-
-
Returns true if the object has the bitmap
Returns:
Type |
Description |
Boolean
|
Object has the bitmap |
-
-
Returns true if the object has a parent
Returns:
Type |
Description |
Boolean
|
Object has a parent |
-
-
Hides the object
Name |
Type |
Default |
Description |
blockDeactivate |
Boolean
|
false
|
optional
Blocking deactivates of the object |
-
initialize
(object, y, width, height)
-
Initializes a class object
Name |
Type |
Description |
object |
Number
|
Object
|
*
|
optional
The X coordinate or Graphics or object with parameters |
y |
Number
|
optional
The Y coordinate (if object is Number) |
width |
Number
|
optional
The width of the object (if object is Number) |
height |
Number
|
String
|
optional
The height of the object (if object is Number) |
object.x |
Number
|
optional
The X coordinate |
object.y |
Number
|
optional
The Y coordinate |
object.width |
Number
|
optional
The width of the object |
object.height |
Number
|
String
|
optional
The height of the object |
Examples
const sprite = new DKTools.Sprite(0, 0, 100, 100);
=> x = 0; y = 0; width = 100; height = 100;
const sprite = new DKTools.Sprite(Graphics);
=> x = 0; y = 0; width = Graphics.boxWidth; height = Graphic.boxHeight;
const sprite = new DKTools.Sprite({ x: 0, y: 0, width: 100, height: 100 });
=> x = 0; y = 0; width = 100; height = 100;
-
-
Returns true if the object is active
Returns:
Type |
Description |
Boolean
|
Object is active |
-
-
Returns true if the object is busy
Returns:
Type |
Description |
Boolean
|
Object is busy |
-
-
Returns true if the object has a parent (if parameter is null or undefined)
Returns true if the object (parameter) is child of this object
Name |
Type |
Description |
object |
Sprite
|
Window
|
optional
Object |
Returns:
Type |
Description |
Boolean
|
Object (parameter) is child of this object or object has a parent (if parameter is null or undefined) |
-
-
Returns true if the object was destroyed
Returns:
Type |
Description |
Boolean
|
Object was destroyed |
-
-
Returns true if the coordinates is inside the object
Name |
Type |
Description |
x |
Number
|
The X coordinate |
y |
Number
|
The Y coordinate |
Returns:
Type |
Description |
Boolean
|
Coordinates is inside the object |
-
-
Returns true if the mouse is inside the object
Returns:
Type |
Description |
Boolean
|
Mouse is inside the object |
-
-
Returns true if the coordinates is not inside the object
Name |
Type |
Description |
x |
Number
|
The X coordinate |
y |
Number
|
The Y coordinate |
Returns:
Type |
Description |
Boolean
|
Coordinates are not inside the object |
-
-
Returns true if the object (parameter) is parent of this object
Name |
Type |
Description |
object |
Sprite
|
Window
|
Object |
Returns:
Type |
Description |
Boolean
|
Object (parameter) is parent of this object |
-
-
Returns true if the bitmap is ready
Returns:
Type |
Description |
Boolean
|
Bitmap is ready |
-
-
Returns true if the object is started
Returns:
Type |
Description |
Boolean
|
Object is started |
-
-
Returns true if the touch is inside the object
Returns:
Type |
Description |
Boolean
|
Touch is inside the object |
-
-
Returns true if the object is visible
Returns:
Type |
Description |
Boolean
|
Object is visible |
-
isVisibleAndActive
()Boolean
-
Returns true if the object is visible and active
Returns:
Type |
Description |
Boolean
|
Object is visible and active |
-
-
Makes the font size bigger
-
-
Makes the font size smaller
-
maxFontSizeInLine
(line)Number
-
Returns max font size in line
Name |
Type |
Description |
line |
String
|
Line |
Returns:
Type |
Description |
Number
|
Max font size in line |
-
-
Moves the object
Name |
Type |
Description |
x |
Number
|
optional
The X coordinate |
y |
Number
|
String
|
optional
The Y coordinate or line number (String) |
- Version:
Examples
const sprite = new DKTools.Sprite();
sprite.move(100, 100);
const sprite = new DKTools.Sprite();
sprite.move(100, '2');
-
obtainEscapeCode
(textState)String
-
Name |
Type |
Description |
textState |
Object
|
|
Returns:
-
obtainEscapeParam
(textState)Number | String
-
Name |
Type |
Description |
textState |
Object
|
|
Returns:
Type |
Description |
Number
|
String
|
|
-
onItemChange
(item, lastItem)
-
Handles item change
Name |
Type |
Description |
item |
*
|
Item |
lastItem |
*
|
Last item |
- Since:
-
partyMemberName
(n)String | null
-
Returns the name of the actor
Name |
Type |
Description |
n |
Number
|
Number of the actor in the party |
Returns:
Type |
Description |
String
|
null
|
Name of the actor |
-
-
Processes all
-
processAllText
(textState)
-
Name |
Type |
Description |
textState |
Object
|
|
-
processCharacter
(textState)
-
Name |
Type |
Description |
textState |
Object
|
|
-
processControlCharacter
(textState, c)
-
Name |
Type |
Description |
textState |
Object
|
|
c |
String
|
|
-
processDrawIcon
(iconIndex, textState)
-
Name |
Type |
Description |
iconIndex |
Number
|
Icon index |
textState |
Object
|
Text state |
-
processEscapeCharacter
(code, textState)
-
Name |
Type |
Description |
code |
String
|
|
textState |
Object
|
|
-
-
Processes a mouse
- Since:
-
processNewLine
(textState)
-
Name |
Type |
Description |
textState |
Object
|
|
-
-
Processes a wheel
- Since:
-
-
Redraws all
-
-
Updates and redraws all
-
-
Removes all
-
removeEvent
(event)Boolean
-
Removes the event from a container
Returns true if the event was removed
Returns:
Type |
Description |
Boolean
|
Event was removed |
-
-
Removes the filter
Name |
Type |
Description |
filter |
*
|
Filter |
- Version:
-
removeFromParent
()Boolean
-
Removes the object from the parent object, if possible
Returns true if the deletion was successful
Returns:
Type |
Description |
Boolean
|
Deletion was successful |
-
resize
(width, height, blockStart)Boolean
-
Changes the width and height of the object
Returns true if the change occurred
Name |
Type |
Default |
Description |
width |
Number
|
|
Width of the object |
height |
Number
|
String
|
|
Height of the object or number of lines (String) |
blockStart |
Boolean
|
false
|
optional
Blocking the call of the "start" function |
- Since:
Returns:
Type |
Description |
Boolean
|
Change occurred |
-
setActive
(active)Boolean
-
Changes the activity of the object
Returns true if the change occurred
Name |
Type |
Description |
active |
Boolean
|
optional
Activity of the object |
Returns:
Type |
Description |
Boolean
|
Change occurred |
-
setItem
(item, blockStart)
-
Sets the item
Name |
Type |
Default |
Description |
item |
*
|
|
Item |
blockStart |
Boolean
|
false
|
optional
Blocking the call of the "start" function |
- Since:
-
-
Sets the activity of the object
Name |
Type |
Description |
active |
Boolean
|
optional
Activity of the object |
-
-
Sets all parameters
Name |
Type |
Default |
Description |
object |
Object
|
{}
|
optional
Parameters
Name |
Type |
Description |
visible |
Boolean
|
optional
Visibility of the object |
active |
Boolean
|
optional
Activity of the object |
scale |
Point
|
optional
Scale of the object |
pivot |
Point
|
optional
Pivot of the object |
skew |
Point
|
optional
Skew of the object |
rotation |
Number
|
optional
Rotation of the object |
opacity |
Number
|
optional
Opacity of the object |
|
- Version:
-
-
Sets the opacity of the object
Name |
Type |
Description |
opacity |
Number
|
optional
Opacity of the object |
- Since:
-
-
Sets the pivot of the object
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 rotation of the object
Name |
Type |
Description |
rotation |
Number
|
optional
Rotation of the object |
-
-
Sets the scale of the object
Name |
Type |
Description |
object |
Number
|
Point
|
optional
The X coordinate or Point |
y |
Number
|
optional
The Y coordinate (if object is Number) |
- Version:
-
setupSize
(object, height)
-
Sets the size of the object
Name |
Type |
Description |
object |
Number
|
Object
|
optional
Width of the object or object with parameters |
height |
Number
|
optional
Height of the object (if object is Object) |
object.width |
Number
|
optional
Width of the object |
object.height |
Number
|
optional
Height of the object |
-
-
Sets the skew of the object
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 visibility of the object
Name |
Type |
Description |
visible |
Boolean
|
optional
Visibility of the object |
-
setVisible
(visible)Boolean
-
Changes the visibility of the object
Returns true if the change occurred
Name |
Type |
Description |
visible |
Boolean
|
optional
Visibility of the object |
Returns:
Type |
Description |
Boolean
|
Change occurred |
-
-
Shows the object
Name |
Type |
Default |
Description |
activate |
Boolean
|
false
|
optional
Activates the object |
-
-
Returns the standard activity of the object
Returns:
Type |
Description |
Boolean
|
Standard activity of the object |
-
standardDrawingHeight
()Number
-
Returns the standard height of the drawing
- Version:
Returns:
Type |
Description |
Number
|
Standard height of the drawing or null |
-
standardDrawingWidth
()Number
-
Returns the standard width of the drawing
- Version:
Returns:
Type |
Description |
Number
|
Standard width of the drawing or null |
-
-
Returns the standard opacity of the object
- Since:
Returns:
Type |
Description |
Number
|
Standard opacity of the object |
-
-
Returns the standard pivot of the object
Returns:
Type |
Description |
Point
|
Standard pivot of the object |
-
standardRotation
()Number
-
Returns the standard rotation of the object
Returns:
Type |
Description |
Number
|
Standard rotation of the object |
-
-
Returns the standard scale of the object
Returns:
Type |
Description |
Point
|
Standard scale of the object |
-
-
Returns the standard skew of the object
Returns:
Type |
Description |
Point
|
Standard skew of the object |
-
standardVisible
()Boolean
-
Returns the standard visibility of the object
Returns:
Type |
Description |
Boolean
|
Standard visibility of the object |
-
standardWindowskin
()String
-
Returns the standard window skin
Returns:
Type |
Description |
String
|
Standard window skin |
-
-
Starts the object
Name |
Type |
Default |
Description |
activate |
Boolean
|
false
|
optional
Activates the object |
- Version:
-
textFontHeight
(text, wrap)Number
-
Returns the height of the text (taking into account the font)
Name |
Type |
Default |
Description |
text |
String
|
Number
|
|
Text |
wrap |
Object
|
{}
|
optional
Wrap options
Name |
Type |
Description |
maxWidth |
Number
|
optional
Max width of a text line |
maxLines |
Number
|
optional
Max lines |
|
Returns:
Type |
Description |
Number
|
Height of the text (taking into account the font) |
-
textHeight
(text, wrap)Number
-
Returns the height of the text
Name |
Type |
Default |
Description |
text |
String
|
Number
|
|
Text |
wrap |
Object
|
{}
|
optional
Wrap options
Name |
Type |
Description |
maxWidth |
Number
|
optional
Max width of a text line |
maxLines |
Number
|
optional
Max lines |
|
Returns:
Type |
Description |
Number
|
Height of the text |
-
textLines
(text, wrap)Number
-
Returns the number of lines of the text
Name |
Type |
Description |
text |
String
|
Number
|
Text |
wrap |
Object
|
optional
Wrap options
Name |
Type |
Description |
maxWidth |
Number
|
optional
Max width of a text line |
maxLines |
Number
|
optional
Max lines |
|
Returns:
Type |
Description |
Number
|
Number of lines of the text |
-
textSizeEx
(text, resetFontSettings)Object
-
Returns the size of the text (special characters are supported)
Name |
Type |
Default |
Description |
text |
String
|
|
Text |
resetFontSettings |
Boolean
|
true
|
optional
Reset font settings |
- Version:
Returns:
Type |
Description |
Object
|
Size of the text |
-
-
Returns the width of the text
Name |
Type |
Description |
text |
String
|
Text |
Returns:
Type |
Description |
Number
|
Width of the text |
-
textWrap
(text, options)String
-
Makes a text wrap
Name |
Type |
Default |
Description |
text |
String
|
|
Text |
options |
Object
|
{}
|
optional
Wrap options
Name |
Type |
Description |
maxWidth |
Number
|
optional
Max width of a text line |
maxLines |
Number
|
optional
Max lines |
fontSize |
Number
|
optional
Font size |
|
- Version:
Returns:
Type |
Description |
String
|
Wrapped text |
-
-
Updates the object
-
-
Updates the events with type: activate
-
-
Updates all
- Version:
-
-
Updates the events with type: check-all
-
-
Updates the child objects
-
-
Updates the events with type: create-all
-
updateDeactivateEvents
()
-
Updates the events with type: deactivate
-
-
Updates the events with type: draw-all
-
-
Updates the events
-
-
Updates the events with type: hide
-
updateMouseEnterEvents
()
-
Updates the events with type: mouse-enter
-
updateMouseInsideEvents
()
-
Updates the events with type: mouse-inside
-
updateMouseLeaveEvents
()
-
Updates the events with type: mouse-leave
-
-
Updates the events with type: mouse-move
-
updateMouseOutsideEvents
()
-
Updates the events with type: mouse-outside
-
-
Updates the events with type: queue
-
-
Updates the events with type: ready
-
-
Updates the events with type: redraw-all
-
updateRefreshAllEvents
()
-
Updates the events with type: refresh-all
-
-
Updates the events with type: remove-all
-
-
Updates the events with type: show
-
-
Updates the events with type: start
-
-
Updates the events with type: update-all
-
-
Updates the events with type: update
-
updateWheelXEvents
(type)
-
Updates the events with type: wheel-X-inside or wheel-X-outside
Name |
Type |
Description |
type |
String
|
Type of the wheel event (inside or outside) |
-
updateWheelYEvents
(type)
-
Updates the events with type: wheel-Y-inside or wheel-Y-outside
Name |
Type |
Description |
type |
String
|
Type of the wheel event (inside or outside) |