Constructor
new Input()
Input
Class instance.
Extends
Member
(static) IOS_IFRAME :Boolean
(static) isInputting :Boolean
(static) TYPE_DATE :String
- Default Value:
- "date"
(static) TYPE_DATE_TIME :String
- Default Value:
- "datetime"
(static) TYPE_DATE_TIME_LOCAL :String
- Default Value:
- "datetime-local"
(static) TYPE_EMAIL :String
- Default Value:
- "email"
(static) TYPE_MONTH :String
- Default Value:
- "month"
(static) TYPE_NUMBER :String
- Default Value:
- "number"
(static) TYPE_PASSWORD :String
- Default Value:
- "password"
(static) TYPE_RANGE :String
- Default Value:
- "range"
(static) TYPE_SEARCH :String
- Default Value:
- "search"
(static) TYPE_TEXT :String
- Default Value:
- "text"
(static) TYPE_TIME :String
- Default Value:
- "time"
(static) TYPE_URL :String
- Default Value:
- "url"
(static) TYPE_WEEK :String
- Default Value:
- "week"
_words
- Inherited From:
align :String
Represents the horizontal display of text.
Value:
- Inherited From:
alpha :Number
- Inherited From:
asPassword :Boolean
This API is deprecated. Use the type= "password" instead of setting asPassword, and asPassword will be deleted at the next major update.
Specifies whether the text field is a password text field.
If the value of this property is true, the text field is considered a password text field, and the input characters are hidden by using an asterisk rather than the actual character. If false, the text field is not considered a password text field.
The default value is false.
autoSize :Boolean
Specifies whether to compute wide and high data automatically. The default value is false.
Sprite is wide and high, defaults to 0, and does not change with the rendering content. If you want to get the width of the drawing content, you can set the property as true or get it by the getBounds method. Set to true, has some impact on performance.
- Inherited From:
blendMode :String
- Inherited From:
bold :Boolean
Specifies whether the text is bold.
The default value is false, which means that you do not use bold fonts. If the value is true, the text is bold.
- Inherited From:
borderColor :String
- Inherited From:
cacheAs :String
Specifies whether the display object is cached as a static image. When cacheAs is changed, the child object is automatically cached, and the reCache method is invoked manually to update the cache.
It is proposed to cache complex content that is not constantly changing into a static image, which can greatly improve rendering performance. CacheAs has "None", "normal" and "bitmap". The three values are optional.
Webgl renderTarget cache model disadvantages: additional renderTarget objects will be created to increase memory overhead, cache area has a maximum 2048 restrictions, continuous redraw will increase CPU overhead. Advantages: drastically reduce drawcall, rendering the highest performance. *
- Inherited From:
cacheAsBitmap :Boolean
- Inherited From:
color :String
- Overrides:
customRenderEnable :Boolean
- Inherited From:
destroyed :Boolean
- Inherited From:
displayedInStage :Boolean
- Inherited From:
editable :Boolean
focus :Boolean
font :String
The font name of a text, represented in a string.
The default value is "Arial", and the default font can be set by Font.defaultFont.
If the runtime system cannot find the set font, the text is rendered in the default font of the system, resulting in display anomalies. (usually displayed on the computer and displayed at some moving ends because of a lack of settings for fonts).
- Inherited From:
- See:
-
- display.css.Font#defaultFamily
fontSize :int
Specifies the font size of a text (in pixels).
The default is 20 pixels, which can be passed Text.defaultSize
Set default size.
- Inherited From:
globalScaleX :Number
- Inherited From:
globalScaleY :Number
- Inherited From:
graphics :Graphics
- Inherited From:
height :Number
Displays the height of the object, per pixel, and defaults to 0.
This height is used for mouse collision detection and does not affect the display object image size. You need to zoom in on the image of the display object. Use scale, scaleX, and scaleY.
You can get the actual height of the object image through getbounds.
- Inherited From:
hitArea :Object
You can set a Rectangle area as the click area, or set one HitArea
As a click area, you can set clickable and clickable areas within HitArea.
If hitArea is not set, collisions are made according to the region formed by the width and height.
- Inherited From:
hitTestPrior :Boolean
Specifies whether mouse event detection preferentially detects itself or preferentially detects its child object. The mouse event detection occurs at the capture phase of the mouse event. At this stage, the engine will begin to recursively check stage and its child objects from stage until the target object is hit or missed.
If false, the child object is preferentially detected, and when a child object is hit, interrupt detection is done to hit the target. If you do not hit any sub object, then the object detection; if true, then the priority detection object, if the object is not directly hit, interrupt detection, said did not hit the target; if the object is hit, further iterative detection of its children, in order to confirm the final target.
Reasonable use of this property, can reduce the mouse event detection nodes, improve performance. Can be set to true: the developer does not care about the mouse event detection result of the child node of the node, which is the mouse event detection point of the node as its child node.
The View component of the Stage object and UI defaults to true.
- Inherited From:
- Default Value:
- false优先检测此对象的子对象,当递归检测完所有子对象后,仍然没有找到目标对象,最后再检测此对象。
inputElementXAdjuster :int
The native input frame X axis adjustment value is used to adjust the input frame coordinates.
Because even if the value is set, there is no agreement between platforms and browsers, and inputElementXAdjuster is deprecated.
- Deprecated:
- Yes
inputElementYAdjuster :int
The native input frame Y axis adjustment value is used to adjust the input frame coordinates.
Because even if the value is set, there is no agreement between platforms and browsers, and inputElementYAdjuster is deprecated.
- Deprecated:
- Yes
isChanged :Boolean
- Inherited From:
italic :Boolean
Indicates whether the text in this text format is italic.
The default value is false, which means no italics. If the value is true, the text is italic.
- Inherited From:
lines :Array
- Inherited From:
mask :Sprite
Mask, you can set an object (support bitmap and vector diagram), according to the object shape for mask display.
[note] the mask object coordinate system is relative to the mask object itself, and is different from the Flash mechanism
- Inherited From:
maxChars :int
The character number is limited to 10000 by default.
When setting the number of characters, a value of less than or equal to 0 will limit the number of characters to 10000.
mouseEnabled :Boolean
- Inherited From:
mouseThrough :Boolean
Is the mouse event collision detected with this object?. Collision detection occurs at the capture phase of the mouse event. At this stage, the engine will start testing stage and its child objects recursively from stage until it finds the hit target object or misses any object.
The penetration indicates that the location of the mouse event is hit when it is in the drawing area of the object, and is independent of the object's width, height, and the hitArea attribute of the Rectangle object. If the sprite.hitArea value is a HitArea object, the mouse event response area of the object is declared explicitly, and the width, height, and mouseThrough attributes of the object are ignored.
The properties that affect the target mouse event response area are: width, height, hitArea, and the priority sequence is: hitArea (type:HitArea), >hitArea (type:Rectangle), >width/height.
- Inherited From:
- Default Value:
- false不可穿透,此对象的鼠标响应区域由width、height、hitArea属性决定。
mouseX :Number
- Inherited From:
mouseY :Number
- Inherited From:
multiline :Boolean
nativeInput :Object
optimizeScrollRect :Boolean
Specifies whether or not the display object that uses scrollRect is optimized. The default is false (not optimized).
When ture: this object uses the scrollRect set display contents without rendering display outside the region, to improve performance (if the sub object rotation or zoom center offset, display screening are not accurate).
- Inherited From:
overflow :String
Overflow specifies the behavior of text beyond the text field. Its values are "hidden", "visible" and "scroll".
The performance is from high to low in order: Hidden > visible > scroll.
- Inherited From:
- Default Value:
- VISIBLE
padding :Array
Margin information.
Data format: [上边距,右边距,下边距,左边距] (margins are in pixels).
- Inherited From:
pivotX :Number
- Inherited From:
pivotY :Number
- Inherited From:
prompt :String
promptColor :String
restrict :String
scaleX :Number
- Inherited From:
scaleY :Number
- Inherited From:
scrollRect :Rectangle
Display a rectangular rolling range object, has the effect of cutting (if you only want to limit the object rendering area, please use viewport), set optimizeScrollRect=true, can optimize the trimmed area content rendering.
The difference between srollRect and viewport:
1.srollRect comes with clipping effects, viewport only affects whether child objects render, and does not have clipping effects (higher performance).
*
- Inherited From:
staticCache :Boolean
- Inherited From:
stroke :Number
The stroke width (in pixels).
The default value of 0, said no stroke.
- Inherited From:
strokeColor :String
Color color, expressed as a string.
The default value is "#000000" (black);
- Inherited From:
text :String
- Overrides:
texture :Texture
- Inherited From:
timer :Timer
- Inherited From:
transform :Matrix
Object matrix information. By setting the matrix, you can achieve node rotation, zoom, displacement effect.
Matrix for more information, please refer to Matrix
- Inherited From:
type :String
The input box type is one of the static constants of the Input.
- TYPE_TEXT
- TYPE_PASSWORD
- TYPE_EMAIL
- TYPE_URL
- TYPE_NUMBER
- TYPE_RANGE
- TYPE_DATE
- TYPE_MONTH
- TYPE_WEEK
- TYPE_TIME
- TYPE_DATE_TIME
- TYPE_DATE_TIME_LOCAL *
Platform compatibility. See Synonyms at platform compatibility http://www.w3school.com.cn/html5/html_5_form_input_types.asp。
underline :Boolean
- Inherited From:
underlineColor :String
- Inherited From:
valign :String
Represents the vertical display of text.
Value:
- Inherited From:
viewport :Rectangle
Outside the viewport viewport size, sub objects will not be rendered (if you want to achieve the effect of cutting, please use srollRect), reasonable use can improve the rendering performance. For example, a map block made up of small pictures will not render the small picture outside viewport
The difference between srollRect and viewport:
1. srollRect comes with clipping effects, and viewport only affects render of child objects, rendering without clipping (higher performance).
*
- Inherited From:
- Default Value:
- null
visible :Boolean
- Inherited From:
width :Number
Displays the width of the object, per pixel, and defaults to 0.
This width is used for mouse collision detection and does not affect the display object image size. You need to zoom in on the image of the display object. Use scale, scaleX, and scaleY.
You can get the actual width of the display object image through getbounds.
- Inherited From:
wordWrap :Boolean
Indicates whether the text is automatic, and defaults to false.
If the value is true, the word is automatically delivered; otherwise, the line is not automatic.
- Inherited From:
x :Number
- Inherited From:
y :Number
- Inherited From:
zOrder :Number
- Inherited From:
Methods
_getTextStyle()
- Inherited From:
_setParent()
- Inherited From:
addChild(node) → {Node}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
node |
Node
|
Node object |
addChildAt(node, index) → {Node}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
node |
Node
|
Node object. |
index |
int
|
Index location. |
addChildren()
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
...args |
Rest
|
<repeatable> |
Innumerable child nodes. |
changeText()
- Overrides:
clearTimer(caller, method)
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
caller |
Object
|
Execute domain (this). |
method |
function
|
Callback method at the end. |
contains(node) → {Boolean}
Node
Node object.
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
node |
Node
|
Designated Node Node object.
|
Returns:
- Type:
-
Boolean
Node
node object is included.
customRender(context, x, y)
Custom update, render display objects. It is generally used to extend the rendering mode. Please use it properly. This may cause rendering on the accelerator.
Be careful Do not add or delete tree nodes in this function, otherwise it will affect the traversal of tree nodes.
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
context |
RenderContext
|
Rendering context references. |
x |
Number
|
X axis coordinate. |
y |
Number
|
Y axis coordinate. |
destroy(destroyChild)
Destroy this object. The destroy object defaults to removing itself from the parent node and cleaning its reference relationship and waiting for the JS automatic garbage recovery mechanism to be recycled. No more can be used after destroy.
Destroy removes its own event listening, its own timer listening, removing the child object and removing itself from the parent node.
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
destroyChild |
Boolean
|
(optional) destroy the child node at the same time. If the value is true, the child node is destroyed, otherwise the child node is not destroyed. |
destroyChildren()
- Inherited From:
drawToCanvas(canvasWidth, canvasHeight, x, y) → {HTMLCanvas}
Draw current Sprite
reach Canvas
Go ahead and return a HtmlCanvas.
The result of the drawing can be used as a picture source to be drawn into another Sprite:
var htmlCanvas:HTMLCanvas = sprite.drawToCanvas(100, 100, 0, 0);// Draw sprites to canvas var texture:Texture = new Texture(htmlCanvas);// Using htmlCanvas to create Texture var sp:Sprite = new Sprite().pos(0, 200);// Create sprite and bring it down to the 200 position sp.graphics.drawImage(texture);// Draw screenshots to sprites Laya.stage.addChild(sp);// Show the sprite to the stageYou can also get the original picture data and share it on the Internet, so as to achieve the screenshot effect:
var htmlCanvas:HTMLCanvas = sprite.drawToCanvas(100, 100, 0, 0);// Draw sprites to canvas var canvas:* = htmlCanvas.getCanvas();// Gets the native canvas object trace(canvas.toDataURL("image/png"));// Print picture Base64 information, which can be sent to the server or saved as pictures- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
canvasWidth |
Number
|
Canvas width. |
canvasHeight |
Number
|
Canvas height. |
x |
Number
|
Plotted X axis offset. |
y |
Number
|
Plotted Y axis offset. |
event(type, dataopt) → {Boolean}
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
String
|
Event type. | ||
data |
Object
|
<optional> |
null | data (optional) callback data. Be careful: If you need to pass multiple parameters, P1, P2, P3, you can use the array structure, such as: [p1,p2,p3,...] If you need to call a single parameter P, and P is an array, you need to use a structure such as: [p] Other single parameters, P, can be passed directly to the parameter P. |
Returns:
- Type:
-
Boolean
frameLoop(delay, caller, method, argsopt, coverBefore)
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
delay |
int
|
How many frames (frames per frame) are spaced?. | ||
caller |
Object
|
Execute domain (this). | ||
method |
function
|
Callback method at the end. | ||
args |
Array
|
<optional> |
null | args Optional callback parameters. |
coverBefore |
Boolean
|
(optional) whether the delay is covered before default is true. |
frameOnce(delay, caller, method, argsopt, coverBefore)
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
delay |
int
|
Delays several frames (frames per unit). | ||
caller |
Object
|
Execute domain (this) | ||
method |
function
|
Callback method at the end | ||
args |
Array
|
<optional> |
null | args Optional callback parameters |
coverBefore |
Boolean
|
(optional) whether the delay is covered before default is true |
fromImage(url) → {Sprite}
Sprite
Object is used to load and display this picture.
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
url |
String
|
Picture address. |
fromParentPoint(point) → {Point}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
point |
Point
|
Parent container coordinate point. |
getBounds() → {Rectangle}
Gets the rectangular display area of the object in the parent container coordinate system.
Be careful: The amount of calculation is large, as little as possible.
- Inherited From:
getCharPoint(charIndex, outopt) → {Point}
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
charIndex |
int
|
Index location. | ||
out |
Point
|
<optional> |
null | out (optional) output Point reference. |
Returns:
- Type:
-
Point
getChildAt(index) → {Node}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
index |
int
|
Index location |
getChildByName(name) → {Node}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
name |
String
|
Child node name. |
getChildIndex(node) → {int}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
node |
Node
|
Child node. |
Returns:
- Type:
-
int
getGraphicBounds(realSize) → {Rectangle}
Graphics
A display area that does not include child objects.
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
realSize |
Boolean
|
(optional) use the true size of the picture, and defaults to false |
getMousePoint()
- Inherited From:
getSelfBounds() → {Rectangle}
Be careful: The amount of calculation is large, as little as possible.
- Inherited From:
globalToLocal(point, createNewPoint) → {Point}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
point |
Point
|
Global coordinate point. |
createNewPoint |
Boolean
|
(optional) whether to create a new Point object as the return value, defaults to false, returns the object creation cost using the input point object. |
hasListener(type) → {Boolean}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
type |
String
|
Event type. |
Returns:
- Type:
-
Boolean
hitTestPoint(x, y) → {Boolean}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
x |
Number
|
Global x coordinates. |
y |
Number
|
Global y coordinates. |
Returns:
- Type:
-
Boolean
isMouseEvent(type) → {Boolean}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
type |
String
|
Event type. |
Returns:
- Type:
-
Boolean
lang(text, arg1opt)
According to the specified text, take the text content of the current language from the language package. And replace the {i} text in this text.
Such as:
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text |
String
|
Text content. | ||
arg1 |
Object
|
<optional> |
null | ...args Text substitution parameter. |
loadImage(url, xopt, yopt, widthopt, heightopt, completeopt) → {Sprite}
Load and display a picture. The function is equivalent to the graphics.loadImage method. Support asynchronous loading.
Note: many calls to loadImage draw different pictures, which will be displayed simultaneously.
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
url |
String
|
Picture address. | ||
x |
Number
|
<optional> |
0 | x (optional) displays the x position of the picture. |
y |
Number
|
<optional> |
0 | y (optional) displays the Y position of the picture. |
width |
Number
|
<optional> |
0 | width (optional) display the width of the picture, set to 0, which indicates the default width of the picture. |
height |
Number
|
<optional> |
0 | height (optional) display the height of the picture, set to 0, which indicates the default height to use the picture. |
complete |
Handler
|
<optional> |
null | complete (optional) the load completes the callback. |
localToGlobal(point, createNewPoint) → {Point}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
point |
Point
|
Local coordinate point. |
createNewPoint |
Boolean
|
(optional) whether to create a new Point object as the return value, defaults to false, returns the object creation cost using the input point object. |
off(type, caller, listener, onceOnly) → {EventDispatcher}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
type |
String
|
Event type. |
caller |
Object
|
The domain of the event listener function. |
listener |
function
|
Event listener function. |
onceOnly |
Boolean
|
(optional) if the value is true, only the listeners added by the once method are removed. |
offAll(typeopt) → {EventDispatcher}
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
String
|
<optional> |
null | type (optional) event type. If the value is null, all types of listeners for this object are removed. |
on(type, caller, listener, argsopt) → {EventDispatcher}
Adds an event listener to enable listeners to receive event notifications.
If you listen to mouse events, you automatically set the property of your own and father nodes. The value of mouseEnabled is true (if the parent node is mouseEnabled=false, then stop setting the parent node mouseEnabled attribute).
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
String
|
Event type. | ||
caller |
Object
|
The domain of the event listener function. | ||
listener |
function
|
Event listener function. | ||
args |
Array
|
<optional> |
null | args Optional callback parameters for the event listener function. |
once(type, caller, listener, argsopt) → {EventDispatcher}
Adds an event listener to enable listeners to receive event notifications that automatically remove listeners after the listener event responds.
If you listen to mouse events, you automatically set the property of your own and father nodes. The value of mouseEnabled is true (if the parent node is mouseEnabled=false, then stop setting the parent node mouseEnabled attribute).
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
String
|
Event type. | ||
caller |
Object
|
The domain of the event listener function. | ||
listener |
function
|
Event listener function. | ||
args |
Array
|
<optional> |
null | args Optional callback parameters for the event listener function. |
parentRepaint()
- Inherited From:
pivot(x, y) → {Sprite}
Set pivot point. Equivalent to setting the pivotX and pivotY attributes, respectively.
Because the return value is the Sprite object itself, you can use the following syntax: spr.pivot (...).Pos (50, 100);
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
x |
Number
|
X axis point. |
y |
Number
|
Y axis point. |
pos(x, y, speedMode) → {Sprite}
Set coordinate position. Equivalent to setting the X and Y attributes, respectively.
Because the return value is the Sprite object itself, you can use the following syntax: spr.pos (...).Scale (...);
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
x |
Number
|
X axis coordinate. |
y |
Number
|
Y axis coordinate. |
speedMode |
Boolean
|
(optional) is the speed model, the normal call this.x=value assignment, speed mode calls the internal function directly, if not rewritten x, y property, the proposed set to fast mode, higher performance. |
reCache()
- Inherited From:
registerBitmapFont(name, bitmapFont)
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
name |
String
|
The name of the bitmap font. |
bitmapFont |
BitmapFont
|
Bitmap font file. |
removeChild(node) → {Node}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
node |
Node
|
Child node |
removeChildAt(index) → {Node}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
index |
int
|
Node index location. |
removeChildByName(name) → {Node}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
name |
String
|
Object name. |
removeChildren(beginIndexopt, endIndexopt) → {Node}
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
beginIndex |
int
|
<optional> |
0 | beginIndex Start index. |
endIndex |
int
|
<optional> |
0x7fffffff | endIndex End index. |
removeSelf() → {Node}
- Inherited From:
render(context, x, y)
- Overrides:
Parameters:
Name | Type | Description |
---|---|---|
context |
RenderContext
|
Rendering context references. |
x |
Number
|
X axis coordinate. |
y |
Number
|
Y axis coordinate. |
renderText(begin, visibleLineCount)
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
begin |
The index of the line to start rendering. | |
visibleLineCount |
Number of rows rendered. |
repaint()
- Inherited From:
replaceChild(newNode, oldNode) → {Node}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
newNode |
Node
|
New node. |
oldNode |
Node
|
Old node. |
scale(scaleX, scaleY, speedMode) → {Sprite}
Set zoom. Equivalent to setting the scaleX and scaleY attributes, respectively.
Because the return value is the Sprite object itself, you can use the following syntax: spr.scale (...).Pos (50, 100);
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
scaleX |
Number
|
X axis scaling. |
scaleY |
Number
|
Y axis scaling. |
speedMode |
Boolean
|
(optional) whether the speed mode is called this.scaleX=value, normal assignment, speed mode directly call internal function, if not override the scaleX property of the scaleY, suggests setting for the rapid mode of higher performance. |
select()
setChildIndex(node, index) → {Node}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
node |
Node
|
Child node. |
index |
int
|
New index. |
setSelection(startIndex, endIndex)
Parameters:
Name | Type | Description |
---|---|---|
startIndex |
int
|
Cursor start position. |
endIndex |
int
|
End of cursor position. |
setSelfBounds(bound)
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
bound |
Rectangle
|
Bounds rectangular region |
size(width, hegiht) → {Sprite}
Set width height. Equivalent to setting the width and height attributes, respectively.
Because the return value is the Sprite object itself, you can use the following syntax: spr.size (...).Pos (50, 100);
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
width |
Number
|
Width value. |
hegiht |
Number
|
Height value. |
skew(skewX, skewY) → {Sprite}
Set tilt angle. Equivalent to setting the skewX and skewY attributes, respectively.
Because the return value is the Sprite object itself, you can use the following syntax: spr.skew (...).Pos (50, 100);
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
skewX |
Number
|
Horizontal tilt angle. |
skewY |
Number
|
Vertical inclination angle. |
startDrag(areaopt, hasInertia, elasticDistanceopt, elasticBackTimeopt, dataopt, disableMouseEvent, ratioopt)
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
area |
Rectangle
|
<optional> |
null | area (optional) drag area, this area is the current object, registration point, active area (excluding the object width, height), optional. |
hasInertia |
Boolean
|
(optional) after the mouse is released, is it still inertial sliding, default is false, optional. | ||
elasticDistance |
Number
|
<optional> |
0 | elasticDistance (optional) the distance of the rubber band effect, 0 is the effect without rubber band, and the default is 0. |
elasticBackTime |
int
|
<optional> |
300 | elasticBackTime (optional) the rebound time of the rubber band is in milliseconds, and the default is 300 ms, optional. |
data |
Object
|
<optional> |
null | data (optional) dragging events with optional data. |
disableMouseEvent |
Boolean
|
(optional) disables mouse detection of other objects, defaults to false, and sets to true to improve performance. | ||
ratio |
Number
|
<optional> |
0.92 | ratio (optional) inertial damping coefficient, which affects inertia strength and duration. |
supportFont(font) → {Boolean}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
font |
String
|
Support testing for font |
Returns:
- Type:
-
Boolean
timerLoop(delay, caller, method, argsopt, coverBefore, jumpFrame)
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
delay |
int
|
Interval time (ms per unit). | ||
caller |
Object
|
Execute domain (this). | ||
method |
function
|
Callback method at the end. | ||
args |
Array
|
<optional> |
null | args Optional callback parameters. |
coverBefore |
Boolean
|
(optional) whether the delay is covered before default is true. | ||
jumpFrame |
Boolean
|
The clock is skipping. Time based callback, in the unit time interval, if you can perform multiple callbacks, for performance reasons, the engine defaults to only once. After setting the jumpFrame=true, the callback is executed several times in succession |
timerOnce(delay, caller, method, argsopt, coverBefore)
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
delay |
int
|
Delay time (in milliseconds). | ||
caller |
Object
|
Execute domain (this). | ||
method |
function
|
Callback method at the end. | ||
args |
Array
|
<optional> |
null | args Optional callback parameters. |
coverBefore |
Boolean
|
(optional) whether the delay is covered before default is true. |
toParentPoint(point) → {Point}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
point |
Point
|
Local coordinate point. |
typeset()
Typeset text.
Perform high and wide calculations, render, and redraw text.
- Inherited From:
unregisterBitmapFont(name, destroy)
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
name |
String
|
The name of the bitmap font. |
destroy |
Boolean
|
Do you want to destroy the specified font file?. |
Event
added
- Inherited From:
- See:
-
- events.Event
blur
- See:
-
- events.Event
change
- Inherited From:
- See:
-
- events.Event
click
- Inherited From:
- See:
-
- events.Event
display
- Inherited From:
- See:
-
- events.Event
dragend
- Inherited From:
- See:
-
- events.Event
dragmove
- Inherited From:
- See:
-
- events.Event
dragstart
- Inherited From:
- See:
-
- events.Event
enter
- See:
-
- events.Event
focus
- See:
-
- events.Event
input
- See:
-
- events.Event
mousedown
- Inherited From:
- See:
-
- events.Event
mousemove
- Inherited From:
- See:
-
- events.Event
mouseout
- Inherited From:
- See:
-
- events.Event
mouseover
- Inherited From:
- See:
-
- events.Event
mouseup
- Inherited From:
- See:
-
- events.Event
removed
- Inherited From:
- See:
-
- events.Event
undisplay
- Inherited From:
- See:
-
- events.Event