Rotating Score/Energy Meters with View
Posted 14 May 2011 - 03:46 PM
I always wanted to have the camera going in the direction your player is facing, but the problem is that the score and HUD doesn't display with the view. So, how would I do this?
This picture illustrates it better than I can describe.
The bar should be on the top of the screen.
Posted 14 May 2011 - 03:55 PM
Alternative? Use the rotation scripts such as draw_text_ext, to counteract rotation. You also need to counteract the positional rotational, so instead of drawing text at 5, 5, you'd have to "rotate" 5, 5, around 320, 240, which is:
x_hud = x + x * cos( -view_angle ) - y * sin( -view_angle )
y_hud = y + x * sin( -view_angle ) + y * cos( -view_angle )
x, y are where you WANT to draw. x_hud, y_hud are where they appear on the hud. You also have to account for the view position..
Posted 14 May 2011 - 04:43 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users