I have created a CCLayer, and within that layer, I want a CCLayerGradient in the background and not have it scroll with everything else. The problem is, in one part, I have self.position change, which makes everything scroll obviously. So what is the best approach to add a static background to a scene that doesn't move?
Best way to add a STATIC background to a scene?
(3 posts) (2 voices)-
Posted 1 year ago #
-
Thats what your ccscene is for. Add the cclayer to the ccscene, and add the cclayergradient to the ccscene too, not to the other layer. That way your layers are separate and will not move together.
Posted 1 year ago # -
Thanks a ton hactor. I was really confused about this when following a tutorial and just added a CCLayer as a scene, but not a CCScene with CCLayers added to them.
Posted 1 year ago #
Reply
You must log in to post.