Constructor
new RadioGroup()
示例
The following example code for <caption> creates a <code>RadioGroup</code> Example。 </caption>
Package
{
Import laya.ui.Radio;
Import laya.ui.RadioGroup;
Import laya.utils.Handler;
Public class RadioGroup_Example
{
Public, function, RadioGroup_Example ()
{
*Laya.init(640, 800);// Set the game canvas width high.
*Laya.stage.bgColor = "#efefef";// Sets the background color of the canvas.
*Laya.loader.load(["resource/ui/radio.png"], Handler.create(this, onLoadComplete));// Load resources.
}
Private, function, onLoadComplete (): void
{
*var radioGroup:RadioGroup = new RadioGroup();// Create a RadioGroup Class instance object RadioGroup .
*radioGroup.pos(100, 100);// Set up RadioGroup Location information.
*radioGroup.labels = "item0,item1,item2";// Set up RadioGroup Tag set.
*radioGroup.skin = "resource/ui/radio.png";// Set up RadioGroup Skin.
*radioGroup.space = 10;// Set up RadioGroup Distance between entries.
*radioGroup.selectHandler = new Handler(this, onSelect);// Set up RadioGroup A processor that executes when the selection changes.
*Laya.stage.addChild(radioGroup);// take RadioGroup Add to display list.
}
Private function onSelect (index:int): void
{
Trace (the currently selected radio button index: index=), index);
}
}
}
Laya.init(640, 800);// Set the game canvas wide and render mode
Laya.stage.bgColor = "#efefef";// Sets the background color of the canvas
Laya.loader.load ( ["resource/ui/radio.png"] Laya.utils.Handler.create (this, onLoadComplete);
Function, onLoadComplete () {
var radioGroup= new laya.ui.RadioGroup();// Create a RadioGroup Class instance object RadioGroup .
radioGroup.pos(100, 100);// Set up RadioGroup Location information.
radioGroup.labels = "item0,item1,item2";// Set up RadioGroup Tag set.
radioGroup.skin = "resource/ui/radio.png";// Set up RadioGroup Skin.
radioGroup.space = 10;// Set up RadioGroup Distance between entries.
radioGroup.selectHandler = new laya.utils.Handler(this, onSelect);// Set up RadioGroup A processor that executes when the selection changes.
Laya.stage.addChild(radioGroup);// take RadioGroup Add to display list.
}
Function onSelect (index) {
Console.log (the currently selected radio button index: index=), index);
}
Import Radio = laya.ui.Radio;
Import RadioGroup = laya.ui.RadioGroup;
Import Handler = laya.utils.Handler;
Class RadioGroup_Example {
Constructor () {
Laya.init(640, 800);// Set the game canvas width high.
Laya.stage.bgColor = "#efefef";// Sets the background color of the canvas.
Laya.loader.load(["resource/ui/radio.png"], Handler.create(this, this.onLoadComplete));// Load resources.
}
Private onLoadComplete (): void {
var radioGroup: RadioGroup = new RadioGroup();// Create a RadioGroup Class instance object RadioGroup .
radioGroup.pos(100, 100);// Set up RadioGroup Location information.
radioGroup.labels = "item0,item1,item2";// Set up RadioGroup Tag set.
radioGroup.skin = "resource/ui/radio.png";// Set up RadioGroup Skin.
radioGroup.space = 10;// Set up RadioGroup Distance between entries.
radioGroup.selectHandler = new Handler(this, this.onSelect);// Set up RadioGroup A processor that executes when the selection changes.
Laya.stage.addChild(radioGroup);// take RadioGroup Add to display list.
}
Private onSelect (index: number): void {
Console.log (the currently selected radio button index: index=), index);
}
}
Extends
Member
alpha :Number
- Inherited From:
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:
bottom :Number
The vertical distance (in pixels) from the bottom edge of the component to the base edge of its content area.
- 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:
centerX :Number
In the parent container, the horizontal axis of the object is at a distance from the parent's container's horizontal central line (in pixels).
- Inherited From:
centerY :Number
In the parent container, the vertical axis of the object is at a distance from the vertical centerline of the parent container (in pixels).
- Inherited From:
customRenderEnable :Boolean
- Inherited From:
dataSource :Object
- Inherited From:
destroyed :Boolean
- Inherited From:
direction :String
The default value is "horizontal"".
Value:
- Inherited From:
disabled :Boolean
- Inherited From:
displayedInStage :Boolean
- Inherited From:
displayHeight :Number
The display height of the object (in pixels).
- Inherited From:
displayWidth :Number
The display width of the object (in pixels).
- Inherited From:
globalScaleX :Number
- Inherited From:
globalScaleY :Number
- Inherited From:
graphics :Graphics
- Inherited From:
height :Number
Represents the height of the display object, in pixels.
Note: When the value is 0, the height is adaptive size.
- 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优先检测此对象的子对象,当递归检测完所有子对象后,仍然没有找到目标对象,最后再检测此对象。
labelBold :Boolean
- Inherited From:
labelColors :String
- Inherited From:
labelFont :String
- Inherited From:
- See:
-
- display.Text.font()
labelPadding :String
Format: Top left, right margin, bottom margin, left margin".
- Inherited From:
labels :String
- Inherited From:
labelStroke :Number
The stroke width (in pixels).
The default value of 0, said no stroke.- Inherited From:
- See:
-
- display.Text.stroke()
labelStrokeColor :String
Color color, expressed as a string.
The default value is "#000000" (black);- Inherited From:
- See:
-
- display.Text.strokeColor()
layoutEnabled :Boolean
- Inherited From:
left :Number
The horizontal distance (in pixels) from the left of the component to the left of its content area.
- 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:
measureHeight :Number
Displays the actual display area height (in pixels) of the object.
- Inherited From:
measureWidth :Number
Display the width of the actual display area of the object (in pixels).
- Inherited From:
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:
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:
pivotX :Number
- Inherited From:
pivotY :Number
- Inherited From:
right :Number
The horizontal distance (in pixels) from the right side of the component to the right of its content area.
- Inherited From:
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:
selectedIndex :int
- Inherited From:
selectHandler :Handler
Group
The processor that executes the selection (the default return parameter: the item index (index:int)).
- Inherited From:
skin :String
- Inherited From:
stateNum :int
- Inherited From:
- See:
-
- ui.Button#stateNum
staticCache :Boolean
- Inherited From:
strokeColors :String
The state of the stroke color.
- Inherited From:
- See:
-
- display.Text.strokeColor()
texture :Texture
- Inherited From:
timer :Timer
- Inherited From:
toolTip :Object
Hover hint.
Can be assigned to text String
Or function Handler
For custom style mouse prompts and parameter portability, etc..
- Inherited From:
示例
Private, VaR, _testTips:TestTipsUI = new, TestTipsUI ();
Private, function, testTips (): void {
// Simple mouse prompt
Btn2.toolTip = "here is the mouse prompt < b> bold < /b> < br> line feed."";
// Custom mouse prompt
Btn1.toolTip = showTips1;
// Custom mouse prompt with parameters
Clip.toolTip = new, Handler (this, showTips2), ["clip"] );
}
Private, function, showTips1 (): void {
_testTips.label.text = "here is the button." [" + btn1.label + "] ";
Tip.addChild (_testTips);
}
Private function showTips2 (name:String): void {
_testTips.label.text = "here is + name";
Tip.addChild (_testTips);
}
top :Number
The vertical distance (in pixels) from the top edge of the component to its top edge of the content area.
- 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:
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
Represents the width of the display object, in pixels.
Note: When the value is 0, the width is an adaptive size.
- Inherited From:
x :Number
- Inherited From:
y :Number
- Inherited From:
zOrder :Number
- Inherited From:
Methods
_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. |
addItem(item, autoLayOut) → {int}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
item |
ISelect
|
The object object to add. |
autoLayOut |
Boolean
|
Automatically layout, if true, will be based on direction and space Property calculates the location of the item.
|
Returns:
- Type:
-
int
callLater(method, argsopt)
The specified function is delayed.
Called before the control is displayed on the screen, which is generally used to delay the calculation of data.
- Inherited From:
- See:
-
- RadioGroup.html#runCallLater()">#runCallLater()
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
method |
function
|
The name of the function to perform. For example, functionName. | ||
args |
Array
|
<optional> |
null |
args Pass to method List of optional arguments for a function.
|
clearTimer(caller, method)
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
caller |
Object
|
Execute domain (this). |
method |
function
|
Callback method at the end. |
commitMeasure()
Immediately execute the call function that affects the wide height of the delay.
- Inherited From:
- See:
-
- RadioGroup.html#callLater()">#callLater()
- RadioGroup.html#runCallLater()">#runCallLater()
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.
createItem()
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. |
delItem(item, autoLayOut)
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
item |
ISelect
|
Object object to delete. |
autoLayOut |
Boolean
|
Automatically layout, if true, will be based on direction and space Property calculates the location of the item.
|
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:
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
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. |
onCompResize()
Event.RESIZE
Event listener processing function.
- Inherited From:
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:
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)
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
context |
RenderContext
|
Rendering context references. |
x |
Number
|
X axis coordinate. |
y |
Number
|
Y axis coordinate. |
repaint()
- Inherited From:
replaceChild(newNode, oldNode) → {Node}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
newNode |
Node
|
New node. |
oldNode |
Node
|
Old node. |
runCallLater(method)
If there is a need, a function that calls is delayed callLater
Function setting, and the call function is immediately executed.
- Inherited From:
- See:
-
- RadioGroup.html#callLater()">#callLater()
Parameters:
Name | Type | Description |
---|---|---|
method |
function
|
The name of the function to perform. For example, functionName. |
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. |
setChildIndex(node, index) → {Node}
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
node |
Node
|
Child node. |
index |
int
|
New index. |
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. |
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. |
Event
added
- Inherited From:
- 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
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
resize
- Inherited From:
- See:
-
- events.Event
undisplay
- Inherited From:
- See:
-
- events.Event