SafeZone

From Bohemia Interactive Community
Jump to navigation Jump to search

Template:Stub

Introduction

Terminology

  • Display: The video display.
  • Game Screen: That part of the video display that shows the game. Either the full Display, or part of the Display in windowed mode.


Dialogs and controls are positioned in the Game Screen in a rectangular box using screen-coordinates where the top left corner of Game Screen = 0,0. Bottom Right = 1,1.

In the Bis world, all positions, widths and heights are expressed in fractions of the full coordinate area of (1.0, 1.0).

Before Arma2 the positioning of these controls was the game screen.

Post Arma2 these positions are a user screen (green), embedded in the game screen (red).

  • A user can now set his prefered menusize in the grafic options of Arma2. So if you choose for example "small", the positioning grid is redefined to a smaller, centered area with borders around.

Example for SafeZone (red areas)

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