For example, the component declared in SinRotate.ts, the class name is SinRotate. inner, cocos2dx use CCDisplayLinkDirector, (notice, CCDisplayLinkDirector does not wrap IOS SDKCADisplayLinkjust indicate, and in cocos2d, it support 4 types of CCDirector, but in IOS cocos2dx, only supportCCDisplayLinkDirector, that means your app can only run in the ios device whose version bigger than 3. For user-defined components, the class name is the file name of the script and is case sensitive. It is also possible to pass in a class name for getComponent. Change the text in Label Component = text This.label = this.getComponent(LabelComponent) Just access the this.node variable in the component method: start() from 'cc' It's easy to get the node where the component is. Obtain the node where the component is located Use Inspector panel to set up nodes and components.Obtain the node where the component is located.To achieve these effects, developers need to obtain the Node or Component that needs to be modified in the script. Scripts can also respond to player input, modify, create and destroy Nodes or Components, and implement various game logic. The advantage of dynamic modification is that it can continuously modify properties and transition properties within a period of time to achieve gradual effects. You can modify Nodes and Components in the Inspector panel, and also dynamically using scripts. local addChild ( local child, local localZOrder, local name) Adds a child to the container with z order and tag. virtual void addChild (Node child, int localZOrder, const std::string &name) override Adds a child to the container with z order and tag. ![]() Native engine memory leak detection system Adds a child to the container with z order and tag. Resource Management Considerations - meta files Cocos Creator 3.5 Native Built Project Upgrade Guideīuild a Scene Image Using the Scene PanelĬustom Materials for 2D Rendering ObjectsĭragonBones ArmatureDisplay Component ReferenceĬreate a List of Dynamically Generated ContentĬreating Animation Components and Animation Clips
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |