Jump to content
Sign in to follow this  
mandoble

Interfaze size messing it all

Recommended Posts

Interface size in video options advanced (ArmA 2 game options) is distorting and resizing all my created dialogs and title/cut rscs. Is there any way to prevent dialogs or resources to be affected by this evil ArmA option?

Share this post


Link to post
Share on other sites

Found this somewhere on these forums:

_visibleScreenCoordinatesRectangle = [safeZoneX, safeZoneY, safeZoneW, safeZoneH];

To fit a dialog to any interface size I use this:

_control ctrlSetPosition [((ctrlPosition _control select 0) * safeZoneW) + safeZoneX, ((ctrlPosition _control select 1) * safeZoneH) + safeZoneY, (ctrlPosition _control select 2) * safeZoneW, (ctrlPosition _control select 3) * safeZoneH];
_control ctrlCommit 0;

Hope this helps. :)

Share this post


Link to post
Share on other sites

Thanks Clayman, really hope there is another way to fix that, else you would need to reposition and rescale all your controls each time you open a dialog to get the desired visible size.

Share this post


Link to post
Share on other sites

I don't know for sure if there isn't another way. But I've spent quite some time serching these and other forums and trying all kinds of stuff. This is the only way I got it working till now.

But you can use a forEach loop for all your controls.

From my animation viewer:

{
_control = (findDisplay 200) displayCtrl _x;
_control ctrlSetPosition [((ctrlPosition _control select 0) * safeZoneW) + safeZoneX, ((ctrlPosition _control select 1) * safeZoneH) + safeZoneY, (ctrlPosition _control select 2) * safeZoneW, (ctrlPosition _control select 3) * safeZoneH];
//_control ctrlSetFontHeight (0.025 * safeZoneH);
_control ctrlCommit 0
}
forEach [201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227];

Of course any other solution would be appreciated by me, too. :)

Share this post


Link to post
Share on other sites

This is an old thread, but I just thought I would add what helped me when trying to get a dialog to match up with a weapon optics model.

		x = "0.5 + (0.167 * SafeZoneH)";
		y = "0.5 + (0.41 * SafeZoneH)";
		w = "0.015633 * SafeZoneH";
		h = "0.020847 * SafeZoneH";

It seems pretty simple, but none of the other values such as SafeZoneW seem to work. The previously mentioned method to place a fullscreen dialog didn't work for me when trying to place the multiple controls.

Regardless of interface size / resolution, [0.5,0.5] is always the center of the screen.

I use this midpoint as a reference from which I add or subtract a value with a factor of SafeZoneH. This scales both x and y coordinates to match any resolution and interface size.

The x,y coordinates will be where the top left corner of the control starts.

Therefore, you need to shift your coordinates up and the the left to center a control.

This means that controls placed below 0.5 will be placed farther then controls placed above 0.5 even if the two controls are meant to be equidistant.

That is, if you are using my method, which seems like the safest solution since [0,0] will change position depending on interface size. My method ignores interface size setting, which suits when matching up with a optics model which only adjusts to screen resolution.

Edited by tcp

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×