SafeZone

From Bohemia Interactive Community
Revision as of 15:41, 11 June 2009 by PhilippRauch (talk | contribs)
Jump to navigation Jump to search

Template:Stub

Introduction

Before Arma2 the positioning grid for dialogs and controls reach from 0,0 (top left corner of game screen) to 1,1 (bottom right corner of game screen).

This changes in Arma2, because a user can now set his prefered menusize in the grafic options of Arma2.

So if you choose for example "small", the only thing that happened, is that the positioning grid is redefined to a smaller, centered area with borders around.

I created an example screen:

  • monitor dimensions: 1280x1024 pixel
  • menusetting: small

Green area, is the default area fom 0,0 to 1,1. It is now smaller that the whole screen Example for SafeZone (red areas)

The green area will shrink, if you select a smaller menusize.

The SafeZone is the red area, and can only be reached with values outside the range of 0 to 1.

Handling the SafeZone

SafeZone = red area including the green one = complete screen.

To position your control to the left border of the game screen, you have to set a negative value to the "x" tag of your control. But this value depends on the menusize setting of the user. So how do I get the right value ?

BI give you 4 functions to get the whole dimensions of the screen.

  • SafeZoneX returns the value for the left side of screen.
  • SafeZoneY returns the value for the top of the screen.
  • SafeZoneW returns the whole width of the screen.
  • SafeZoneH returns the whole height of the screen.

(to be continued....)

Code Examples

(WIP ...)


See also

SafeZoneX, SafeZoneY, SafeZoneW, SafeZoneH