2.5D Visuals like Paper Mario

2.5D Visuals like Paper Mario
0.0 0



I am just starting out with cocos2d-x. I would like to make a game that has similar visuals as the Paper Mario series, but plan to have no 3D models. Instead I will only use flat sprites that can rotate and move in 3D space. My game will be a shooting gallery game, so there is no need for any physics or interaction between sprites. I will only need to perform per-pixel 3D picking onto the sprite’s texture.

I have tried the CocosNote Test - Camera Orbit Test in the cocos2d-x test project and moved some of the sprites by changing their z property using CCNode::setVertexZ. This creates the exact visual experience that I would like for my game. (see attached screenshot)

…But because I am not very familiar with cocos2d-x yet, I would like to know what the repercussions of changing the z-coordanate are. It seems like changing this property isn’t the way that cocos2d-x was intended to be used because all position variables are always in only x and y coordinates.

I was planning on creating some type of wrapper to allow me to pass around positions in 3D coordinate space rather than 2D… Is this a good idea? Are there any problems that I should expect to arise? Or is there another totally different way that I should go about this?

Please let me know if there’s anything else that comes to mind regarding creating this type of 2.5D shooting gallery.

Thanks for your help!

setVertexZ-CameraOrbitTest.png (54.7 KB)


The z order in CCNode is not the same as OpenGL z order.
It just used for the sequence of drawing sprites.
You can refer CCNode::visit() for more information.


Good to hear — I did see the notes on the setVertexZ relating cocos2d-x z-order… Because all of my 3D objects will have transparent textures, I will not be able to use GL_DEPTH_TEST effectively, but will still need to control the draw order. I will take a deeper look into how the z-order functions and extend/modify it as needed. I will post back here if I come up with a slick way of doing this.

Let me know if anything else comes to mind for this type of game and drawing.

Thanks again!