New issue
 Projects > js > Issues > Refactor #4365

Refactor constructors to avoid JSB issues of extending essential classes

Refactor #4365 [Closed]
pandamicro 2014-03-12 06:24 . Updated almost 11 years ago

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...

smshuja 2014-03-13 14:16

Thanks for posting this issue, ideally it should be possible to extend all essential classes from JSB

ludingping 2014-03-17 06:11
  • Target version changed from v3.0 alpha to v3.0 beta
pandamicro 2014-03-17 10:00

Done in v3.0a cc.Node, cc.Sprite, cc.Layer and all its descendants, cc.Menu, cc.MenuItem, cc.MenuItemFont, cc.MenuItemToggle

pandamicro 2014-04-10 03:24

Done
cc.Action and all its descendants
ClippingNode
AltasNode
EventManager
Labels
Animation
GLProgram
DrawNode
Armature

joshua_astray_ff441 2014-04-10 11:45

Done: cc.SpriteFrame,GridBase,Grid3D,TiledGrid3D,MotionStreak,ParticleBatchNode,ParticleSystem,PhyscsSprite,RenderTexture,TileMapAtlas,TMXLayer,TMXTiledMap,TMXMapInfo,TransitoinScene

pandamicro 2014-04-11 08:19
  • Status changed from New to Closed

Atom PDF

Status:Closed
Start date:2014-03-09
Priority:Normal
Due date:
Assignee:pandamicro
% Done:

100%

Category:-
Target version:v3.0 beta

Subtasks

Bug #4316: jsb can not extend menu and menuitemimageClosed

Refactor #4564: Make auto-binding support constructor with parametersClosedpandamicro

Bug #4589: Make actions extendable directly via constructorClosedpandamicro

Bug #4642: Make other classes extendable directly via constructorClosedpandamicro