How do I use the GCameraController for a 2D platformer?

39 views
Skip to first unread message

Martin Rossil

unread,
Jul 13, 2016, 1:31:45 PM7/13/16
to Genome2D
Could someone provide me with a simple example of how to use GCameraController in a 2D platformer?

I have a viewport ( 1024px x 768px )
I add the world node to root. ( 5000px x  5000px )
I add a node with game controls to root ( 1024px x 768px )

So how do I use the GCameraController to control the visible area of my world node and not moving the game controls?

I hope somebody can help, since the docs dosn't give a clue.

I use the latest version of G2D.

Thanx :)

sHTiF

unread,
Jul 17, 2016, 3:57:54 AM7/17/16
to Genome2D
Hi sorry for the late reply.

In your case I would add 2 cameras to the scene with different groups and then specify the UI to be rendered only in camera 1 and the rest of the scene with camera 2.

To specify this you use camera.mask and node.cameraGroup parameters.

For more info I will add camera example to the Genome2D examples repository today.
Reply all
Reply to author
Forward
0 new messages