Optimal crisp visuals
by bentgarney · in Torque Game Builder · 03/08/2005 (6:10 am) · 5 replies
#2
Thanks
04/02/2005 (2:13 am)
What if you want the world units to ALWAYS equal 800x600, no matter the resolution? Would Rob's script work for that? Does this script you show here detect the window size and change the world units to whatever size that is? That doesn't sound too good for control. Or am I completely misunderstanding this script? (entirely possible. I'm just starting out in T2D)Thanks
#3
T2D won't change the camera size unless you tell it so just set your world units to be 800x600 (or whatever you want) and don't change them.
Just change the default size of (100x75) to (800x600) and you'll be golden. :)
- Melv.
04/02/2005 (7:36 am)
Quote:That doesn't sound too good for control.Not sure what you mean here. This is something you can add if you want what was asked for originally in this thread.
T2D won't change the camera size unless you tell it so just set your world units to be 800x600 (or whatever you want) and don't change them.
Just change the default size of (100x75) to (800x600) and you'll be golden. :)
- Melv.
#4
But in fact, it wouldn't. Everything would just shrink. Including the playfield and playable character, since you also create the displayed size of everything in world units.
And since the coordinates are based on X and Y, with 0 being the center, the pixel distance from the center would remain identical. Everything would just be smaller.
The only problem to watch out for in this odd situation where the world units would change with a resolution change, is the playfield area/border. You may be able to see things that would normally be safely out of view.
ANYWAY, that's still not what I want to do at all :). I'm just explaining my misunderstanding.
Changing the default size from 100x75 to 800x600 permanently in the project is precisely what I want to do. Thank you.
- Dave
04/02/2005 (10:27 am)
About the changing of controls... I was wrong. I was thinking that if you change the world unit values from 800x600 to 1024x768 with a screen resolution change, that it would mess up your character speed, sprite positions, obstacle positions, etc... I was imagining it turning into a jumbled mess.But in fact, it wouldn't. Everything would just shrink. Including the playfield and playable character, since you also create the displayed size of everything in world units.
And since the coordinates are based on X and Y, with 0 being the center, the pixel distance from the center would remain identical. Everything would just be smaller.
The only problem to watch out for in this odd situation where the world units would change with a resolution change, is the playfield area/border. You may be able to see things that would normally be safely out of view.
ANYWAY, that's still not what I want to do at all :). I'm just explaining my misunderstanding.
Changing the default size from 100x75 to 800x600 permanently in the project is precisely what I want to do. Thank you.
- Dave
#5
I just wasn't sure myself if that was exactly what you wanted. Glad it is. :)
- Melv.
04/03/2005 (1:39 am)
No problem David.I just wasn't sure myself if that was exactly what you wanted. Glad it is. :)
- Melv.
Associate Melv May
I'm assuming your trying to get the world-units to equal pixels so that a world-unit = pixel = texel?
function sceneWindow2D::onExtentChange( %this, %newExtent ) { // Set camera logical coords to window pixels extents. sceneWindow2D.setCurrentCameraPosition( "0 0" SPC getWords(%newExtent, 2, 3) ); }As it says in the reference document (just nudging you), "%newExtent" consists of four values, the X / Y / Width / Height of your fxSceneWindow2D. Notice the use of the function "getWords()" to return words 2 and 3?
Assuming your window takes up all of the application window, this will work for you.
Cheers,
- Melv.