Refactor constructors to avoid JSB issues of extending essential classes
Refactor constructors to avoid JSB issues of extending essential classes
Refactor #4365 [Closed]
- Target version changed from v3.0 alpha to v3.0 beta
Done in v3.0a cc.Node, cc.Sprite, cc.Layer and all its descendants, cc.Menu, cc.MenuItem, cc.MenuItemFont, cc.MenuItemToggle
Done
cc.Action and all its descendants
ClippingNode
AltasNode
EventManager
Labels
Animation
GLProgram
DrawNode
Armature
Done: cc.SpriteFrame,GridBase,Grid3D,TiledGrid3D,MotionStreak,ParticleBatchNode,ParticleSystem,PhyscsSprite,RenderTexture,TileMapAtlas,TMXLayer,TMXTiledMap,TMXMapInfo,TransitoinScene
- Status changed from New to Closed
Status: | Closed | |
---|---|---|
Start date: | 2014-03-09 | |
Priority: | Normal | |
Due date: | ||
Assignee: | ||
% Done: | 100% |
|
Category: | - | |
Target version: | v3.0 beta |
Subtasks
As initWithXXX functions is now protected in Cocos2d-x, so in JSB we can not use these functions while we want to extend a class from engine. setXXX functions were proposed to resolve the problem but we want to make it opaque to developers, so we will try to migrate all functionality of init functions into the constructor, then user can simply call super constructor to make the extend really happen.
The first step is to refactor essential classes like cc.Sprite, cc.Layer, etc...