Skip to main content
gamedev.net
🔒 Locked

User Interface: Movement question.

Started by Butabah 1 reply 1.2k views
Original Post
Butabah
Butabah
So, let's pretend I have a UI with a health bar in the top left corner in a 2D game.

If I were to move the camera, the UI itself stays in the same position it was earlier.

Should I tell the UI to move with the camera or is there a way I can keep it statically in the same spot?
Trienco
Trienco

Should I tell the UI to move with the camera or is there a way I can keep it statically in the same spot?


How are you drawing your stuff anyway? Blitting, OpenGL, DirectX, some existing engine? The obvious question would be: what makes you think that everything needs to be drawn using the same "camera"?
f@dzhttp://festini.device-zero.de
Butabah
Butabah

[quote name='Butabah' timestamp='1313976195' post='4852080']
Should I tell the UI to move with the camera or is there a way I can keep it statically in the same spot?


How are you drawing your stuff anyway? Blitting, OpenGL, DirectX, some existing engine? The obvious question would be: what makes you think that everything needs to be drawn using the same "camera"?
[/quote]

Using OpenGL with my own Camera (float[16]) class.

I guess I never thought of it that way.

I have a uniform buffer object that I update to do most of the matrix work such as camera to clip and camera to world matrices. I guess the obvious choice would be to not have the UI on the same camera system as the other objects.

Thanks!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.