Cocos Creator API

1.4.x

Cocos Creator is a highly customizable game development tool that utilizes the power of cocos2d-x.

Graphics

Module: cc

Properties

lineWidth Number

Current line width.

lineJoin Graphics.LineJoin

lineJoin determines how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together.

lineCap Graphics.LineCap

lineCap determines how the end points of every line are drawn.

strokeColor Color

stroke color

fillColor Color

fill color

miterLimit Number

Sets the miter limit ratio

_sgNode _ccsg.Node private

Reference to the instance of _ccsg.Node If it is possible to return null from your overloaded _createSgNode, then you should always check for null before using this property and reimplement __preload.

__eventTargets Array private

Inherited from Component:

Register all related EventTargets, all event callbacks will be removed in _onPreDestroy

node Node

Inherited from Component:

The node this component is attached to. A component is always attached to a node.

examples:

cc.log(comp.node);

uuid String readOnly

Inherited from Component:

The uuid for editor.

examples:

cc.log(comp.uuid);

_enabled Boolean private

Inherited from Component:

enabled Boolean

Inherited from Component:

indicates whether this component is enabled or not.

examples:

comp.enabled = true;
cc.log(comp.enabled);

enabledInHierarchy Boolean readOnly

Inherited from Component:

indicates whether this component is enabled and its node is also active in the hierarchy.

examples:

cc.log(comp.enabledInHierarchy);

_isOnLoadCalled Boolean readOnly

Inherited from Component:

TODO

examples:

cc.log(_isOnLoadCalled);

_name String private

_objFlags Number private

name String

The name of the object.

examples:

obj.name = "New Obj";

isValid Boolean readOnly

Indicates whether the object is not yet destroyed.

examples:

cc.log(obj.isValid);

There are no properties that match your current filter settings. You can change your filter settings in the index section on this page. index

Methods

moveTo
(
  • [x ]
  • [y ]
)

Move path start point to (x,y).

name type description
x optional Number

The x axis of the coordinate for the end point.

y optional Number

The y axis of the coordinate for the end point.

lineTo
(
  • [x ]
  • [y ]
)

Adds a straight line to the path

name type description
x optional Number

The x axis of the coordinate for the end point.

y optional Number