SafeZone: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
Line 3: Line 3:
== Introduction ==
== 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).
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.


This changes in [[ArmA_2|Arma2]], because a user can now set his prefered menusize in the grafic options of [[ArmA_2|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.
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.


I created an example screen:
In the Bis world, all positions, widths and heights are expressed in fractions of the full coordinate area of (1.0, 1.0).
* monitor dimensions: 1280x1024 pixel
 
* menusetting: small
Before [[ArmA_2|Arma2]] the positioning of these controls was the game screen.
 
Post [[ArmA_2|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 [[ArmA_2|Arma2]]. So if you choose for example "small", the positioning grid is redefined to a smaller, centered area with borders around.


Green area, is the default area fom 0,0 to 1,1. It is now smaller that the whole screen
[[Image:ARMA2_SafeZonesExample.JPG|Example for SafeZone (red areas)]]
[[Image:ARMA2_SafeZonesExample.JPG|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.
The SafeZone is the red area, and can only be reached with values outside the range of 0 to 1.

Revision as of 09:35, 28 June 2011

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