Screen Resolution Question
by Robert Fritzen · in Torque Game Engine Advanced · 01/05/2011 (7:46 pm) · 1 replies
I have a really quick question about the screen resolution.
I'm working on some GUI controls and I need to get the screen resolution to "automatically" adjust the gui controls to the screen size.
I saw this variable: $pref::Video::Resolution, and I'm wondering if just using the X and Y coords of that variable to adjust would be sufficient, or if there's a better function of some form to use.
Thanks for any help.
I'm working on some GUI controls and I need to get the screen resolution to "automatically" adjust the gui controls to the screen size.
I saw this variable: $pref::Video::Resolution, and I'm wondering if just using the X and Y coords of that variable to adjust would be sufficient, or if there's a better function of some form to use.
Thanks for any help.
About the author
Illinois Grad. Retired T3D Developer / Pack Dev.
Torque Owner Robert Fritzen
Phantom Games Development
function AttachRPGGui() { //obtain the client's "screen size" %reso = $pref::Video::Resolution; %x = getWord(%reso, 0); %y = getWord(%reso, 1); //Command Set Bars //Bottom Left %extentNeed = CSMainHud.extent; %x_need = getWord(%extentNeed, 0); %y_need = getWord(%extentNeed, 1); //for the left side, we can directly apply 0, for the bottom, a basic subtraction will do //apply it to the gui's position CSMainHud.setPosition(0, %y - %y_need); Canvas.pushDialog( CommandSetBars ); }The only thing I'm noticing is when they change their reso, or go between full screen/windowed mode it messes it up, which functions call the updates to the reso and full screen, or do they even have a callback I can use?