For internal usage.
The node this component is attached to. A component is always attached to a node.
The render data assembler
The blend factor enums
The post render data assembler
Returns a value which used to indicate the onLoad get called or not.
Specifies the destination blend mode.
Specifies the destination blend mode.
Indicates whether this component is enabled or not.
Indicates whether this component is enabled or not.
Indicates whether this component is enabled and its node is also active in the hierarchy.
Fill color.
Fill color.
Indicates whether the object is not yet destroyed. (It will not be available after being destroyed)
When an object's destroy
is called, it is actually destroyed after the end of this frame.
So isValid
will return false from the next frame, while isValid
in the current frame will still be true.
If you want to determine whether the current frame has called destroy
, use isValid(obj, true)
,
but this is often caused by a particular logical requirements, which is not normally required.
Determines how the end points of every line are drawn.
Determines how the end points of every line are drawn.
Determines how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together.
Determines how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together.
Current line width.
Current line width.
The materials of the model.
The materials of the model.
Sets the miter limit ratio.
Sets the miter limit ratio.
Specifies the source blend mode, it will clone a new material object.
Specifies the source blend mode, it will clone a new material object.
Stroke color.
Stroke color.
The user customized material, if not set, it will use builtin material resources, and will show nothing on inspector field.
The user customized material, if not set, it will use builtin material resources, and will show nothing on inspector field.
The uuid for editor.
Clear all references in the instance.
NOTE: this method will not clear the getter or setter functions which defined in the instance of CCObject. You can override the _destruct method if you need, for example: _destruct: function () { for (var key in this) { if (this.hasOwnProperty(key)) { switch (typeof this[key]) { case 'string': this[key] = ''; break; case 'object': case 'function': this[key] = null; break; } } }
If the component's bounding box is different from the node's, you can implement this method to supply a custom axis aligned bounding box (AABB), so the editor's scene view can perform hit test properly.
The rect to store the result bounding rect
Adds a component class to the node. You can also add component to node by passing in the name of the script.
The class of component to be retrieved or to be created
Adds a component class to the node. You can also add component to node by passing in the name of the script.
A string for the class name of the component
Adds an arc to the path which is centered at (cx, cy) position with radius r starting at startAngle and ending at endAngle going in the given direction by counterclockwise (defaulting to false).
中心控制点的坐标 x 轴。
中心控制点的坐标 y 轴。
圆弧弧度。
开始弧度,从正 x 轴顺时针方向测量。
结束弧度,从正 x 轴顺时针方向测量。
如果为真,在两个角度之间逆时针绘制。默认顺时针。
Adds a cubic Bézier curve to the path.
第一个控制点的坐标 x 轴。
第一个控制点的坐标 y 轴。
第二个控制点的坐标 x 轴。
第二个控制点的坐标 y 轴。
最后一个控制点的坐标 x 轴。
最后一个控制点的坐标 y 轴。
Adds a circle to the path.
中心点的坐标 x 轴。
中心点的坐标 y 轴。
圆半径。
Erasing any previously drawn content.
Causes the point of the pen to move back to the start of the current path. It tries to add a straight line from the current point to the start.
Destroy current render data.
Adds an ellipse to the path.
中心点的坐标 x 轴。
中心点的坐标 y 轴。
椭圆 x 轴半径。
椭圆 y 轴半径。
Fills the current or given path with the current fill style.
Draws a filled rectangle.
矩形起始坐标 x 轴。
矩形起始坐标 y 轴。
矩形宽度。
矩形高度。
Returns the component of supplied type if the node has one attached, null if it doesn't.
You can also get component in the node by passing in the name of the script.
The class of component to be retrieved or to be created
Returns the component of supplied type if the node has one attached, null if it doesn't.
You can also get component in the node by passing in the name of the script.
A string for the class name of the component
Returns the component of supplied type in any of its children using depth first search.
The class of component to be retrieved
Returns the component of supplied type in any of its children using depth first search.
A string for the class name of the component
Returns all components of supplied type in the node.
The class of components to be retrieved
Returns all components of supplied type in the node.
A string for the class name of the components
Returns all components of supplied type in self or any of its children.
The class of components to be retrieved
Returns all components of supplied type in self or any of its children.
A string for the class name of the components
Get the shared material asset of the specified sub-model.
Get the material instance of the specified sub-model.
Get the actual rendering material of the specified sub-model. (material instance if there is one, or the shared material asset)
Manual instance material.
LateUpdate is called every frame, if the Component is enabled.
This is a lifecycle method. It may not be implemented in the super class.
You can only call its super class method inside it. It should not be called manually elsewhere.
the delta time in seconds it took to complete the last frame
Adds a straight line to the path.
绘制路径坐标 x 轴。
绘制路径坐标 y 轴。
Marks the render data of the current component as modified so that the render data is recalculated.
Marked necessary to update or not
Move path start point to (x,y).
移动坐标 x 轴。
移动坐标 y 轴。
Post render data submission procedure, it's executed after assembler updated for all children. It may assemble some extra render data to the geometry buffers, or it may only change some render states. Don't call it unless you know what you are doing.
Adds a quadratic Bézier curve to the path.
起始控制点的坐标 x 轴。
起始控制点的坐标 y 轴。
终点控制点的坐标 x 轴。
终点控制点的坐标 x 轴。
Adds a rectangle to the path.
矩形起始坐标 x 轴。
矩形起始坐标 y 轴。
矩形宽度。
矩形高度。
Request new render data object.
The new render data
Called to initialize the component or node’s properties when adding the component the first time or when the Reset command is used.
This function is only called in editor.
Adds a round corner rectangle to the path.
矩形起始坐标 x 轴。
矩形起始坐标 y 轴。
矩形宽度。
矩形高度。
矩形圆角半径。
Schedules a custom task.
If the task is already scheduled, then the interval parameter will be updated without scheduling it again.
The callback function of the task
The time interval between each invocation
The repeat count of this task, the task will be invoked (repeat + 1) times, use macro.REPEAT_FOREVER to repeat a task forever
The delay time for the first invocation
Schedules a task that runs only once, with a delay of 0 or larger.
The callback function of the task
The delay time for the first invocation
Set the shared material asset of the specified sub-model, new material instance will be created automatically if the sub-model is already using one.
Set the material instance of the specified sub-model.
Called before all scripts' update if the Component is enabled the first time.
Usually used to initialize some logic which need to be called after all components' onload
methods called.
This is a lifecycle method. It may not be implemented in the super class.
You can only call its super class method inside it. It should not be called manually elsewhere.
Strokes the current or given path with the current stroke style.
Un-schedules a custom task.
The callback function of the task
unschedule all scheduled tasks.
Update is called every frame, if the Component is enabled.
This is a lifecycle method. It may not be implemented in the super class.
You can only call its super class method inside it. It should not be called manually elsewhere.
the delta time in seconds it took to complete the last frame
Render data submission procedure, it update and assemble the render data to 2D data buffers before all children submission process. Usually called each frame when the ui flow assemble all render data to geometry buffers. Don't call it unless you know what you are doing.
Generated using TypeDoc
Graphics component.