Hi,
How can center align multiple sprites together in the center of the screen?
I know how to do this for single sprite.
Is there any default function available in cocos2d?
Hi,
How can center align multiple sprites together in the center of the screen?
I know how to do this for single sprite.
Is there any default function available in cocos2d?
I personally believe that doing some geometry and taking care of the layout by hand is always the best choice, even if it’s a bit of an effort sometimes. Another choice is using containers and autolayout, but keep in mind that it will take you quite some time before you understand them as they are not really straight-forward. Also consider that if autolayout does not work you might have to go through all its implementation (both in your code and inside cocos2d) to see what’s wrong, and if you can’t find it you might end up having to undo everything and take care of the layout yourself.
I used both manual and auto layout over time, and now I almost always go with the first for the reasons I have explained in the previous paragraph.
In this case you probably won’t have many problems with autolayout, but I still consider it useful for you to know that while it can save you some time now, it might end up wasting you a lot of time in the future. Use it carefully.
I want to use drag and drop. Containers are not working good for me. I have done the alignment with few calculations. It is simple only. I thought there would be any cocos based method to align multiple sprites in center.
Thank you for the advice.