Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-instance API discussion #1375

Open
s1ddok opened this issue Apr 4, 2016 · 1 comment
Open

Multi-instance API discussion #1375

s1ddok opened this issue Apr 4, 2016 · 1 comment

Comments

@s1ddok
Copy link
Contributor

s1ddok commented Apr 4, 2016

We already have an implementation of multiple CCDirector instances in develop branch. There is stack type of situation.

While it seems to be a clever solution it might be confusing a little bit for newcomers that only want to have single Cocos2D instance to see something like

CCDirector pushDirector

CCDirector popDirector

That is why I guess we should discuss if there any other way to find a solution or at least syntax sugar for accessing the director.

I have a little bit of a thought on that. Right now every node having a reference to it's scene. Why not add director reference to the scene, so it can be accessed by:

node.scene.director

I think it can be useful sometimes, but that is of course debatable.

@haligalaph
Copy link

Stack of directors is a super bad idea, since we end up with global state again. scene.director is much much better. But look at SpriteKit, it hasn't SKDirector, all its functionality is moved to SKView. So should we have both CCDirector and CCView? Maybe they should be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants