Adam's Lair Forum

game development and casual madness
It is currently 2019/06/17, 15:46

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2013/05/26, 11:28 
Newbie
Newbie

Joined: 2013/05/25, 17:38
Posts: 8
Role: Hobbyist
I'm trying to build a basic HUD and for the position of the HUD-Elements I use this:

Code:
Vector3 GetScreenToWorldSpace(Vector2 point)
        {
            return Scene.Current.Cameras.ElementAt(0).DrawDevice.GetSpaceCoord(point);
        }


But when I move my camera, the HUD moves some pixels in the opposite direction and returns slowly when the movement stops.


OT: Ich k├Ânnte meine ganzen Fragen auch immer auf Deutsch formulieren, aber ich glaube Englisch ist praktischer wenn das Forum als Nachschlagewerk dienen soll, oder?


Top
 Profile  
 
PostPosted: 2013/05/26, 12:35 
Member
Member

Joined: 2013/05/20, 17:19
Posts: 77
Role: Professional
Hi vinzBad

I'm not sure exactly why that's happening, but if you're creating a HUD, you might be better off placing all the HUD renders in the ScreenOverlay visibility group and making sure that the last pass of your camera is rendering to that group and using an OrthoScreen matrix mode. Would that help?


Top
 Profile  
 
PostPosted: 2013/05/26, 13:25 
Newbie
Newbie

Joined: 2013/05/25, 17:38
Posts: 8
Role: Hobbyist
Hi SirAndrew,

I implemented your advice and it works fantastic :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group