MousePosition
by Andrei Georgescu · in Torque Game Builder · 08/01/2010 (8:06 pm) · 3 replies
Hello! When I try to set the position of a GUI panel by my mouse position+50 it doesn't really work like I do expect to. It depends on resolution. Why?
I am using something like this:
I am multiplying it by 8 because that's the only way it works on 800 x 600 resolution. I don't know the reason. Can someone give me a hint here please? Thanks!
I am using something like this:
tabTalentsDesc.setPosition(getWord(sceneWindow2D.getMousePosition(),0)*8+530, 180);
I am multiplying it by 8 because that's the only way it works on 800 x 600 resolution. I don't know the reason. Can someone give me a hint here please? Thanks!
About the author
Associate William Lee Sims
Machine Code Games
You can convert the scene coordinate back into a window coordinate by using t2dSceneWindow's getWindowPoint.
Warning: I did not actually try that code, but I'm certain it will work.