Remember the old days with Blitz3d when you could just stick stuff in front of the camera, change the resolution and everything remained in the same position on screen? NO? oh well.
Here's how you do it in Bmax (and dont do it).
1) Scale all the image sizes and positions so that objects always look the same at each resolutions (YUK).
2) Change the projection Matrix so that it don't matter what resolution you run at, just decide what resolution to base everything off of and be done with it (YEAH).
How:-
Example code:
Now change the actual screen resolution and the square will remain in the top right.
Here's how you do it in Bmax (and dont do it).
1) Scale all the image sizes and positions so that objects always look the same at each resolutions (YUK).
2) Change the projection Matrix so that it don't matter what resolution you run at, just decide what resolution to base everything off of and be done with it (YEAH).
How:-
' **** THE ACTUAL RESOLUTION OF THE SCREEN Local ScreenWidth = 1024 Local ScreenHeight = 768 Graphics ScreenWidth,ScreenHeight,0 ' **** THE BASE RESOLUTION THAT WE WILL USE TO PLACE ALL OBJECTS Local Proj_width = 800 Local Proj_height = 600 Local matrix#[],depth=2 matrix=[.. 2.0/Proj_width,0.0,0.0,0.0,.. 0.0,-2.0/Proj_height,0.0,0.0,.. 0.0,0.0,2.0/depth,0.0,.. -1-(1.0/Proj_width),1+(1.0/Proj_height),1.0,1.0] primarydevice.Device.SetTransform(D3DTS_PROJECTION,matrix)
Example code:
DrawRect 790,0,10,10
Now change the actual screen resolution and the square will remain in the top right.