Arma: GUI Configuration: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
 
Line 11: Line 11:
== Dialogs ==
== Dialogs ==


''A few words about dialogs, as well as defining one. IDDs, usage in scripts, etc.''
Dialogs are parent containers for the actual controls it contains. Their definition contains several properties on the controls it contains, how the dialog can be addressed, and whether or not the player is able to continue regular movement while the dialog is shown.
 
They can be defined in the [[description.ext]] file or externalized to seperate hpp-files, which are included in the description.ext file using the [[PreProcessor_Commands#.23include|#include]] preprocessor directive. The latter method is generally a good idea to split a large description.ext file into several small chunks in order to keep track of what's where.
 
Most often, controls of a dialog are defined within the definition of the dialog itself, though it's a good practice to generalize common controls in a base definition in the global scope. See [[#Best Practice|best practice]] for details. For simplicity we won't apply this practice in the following code examples.
 
 
{| border="1" align="center" cellpadding="3" cellspacing="0" |
! colspan="3" bgcolor="#bbbbff" | Properties
|-
! bgcolor="#ddddff" | Name
! bgcolor="#ddddff" | Type
! bgcolor="#ddddff" | Remark
|-
| '''idd'''
| integer
| the unique ID number of this dialog. can be -1 if you don't require access to the dialog itself from within a script.
|-
| '''movingEnable'''
| boolean
| sets whether or not the player is hindered from aiming or moving while the dialog is open.
|-
| '''controlsBackground'''
| array
| contains class names of all background controls associated to this dialog.
|-
| '''controls'''
| array
| contains class names of all foreground controls associated to this dialog.
|-
| '''objects'''
| array
|
|-
|}
 
 
Example of a dialog that will only display ''Hello world'' in the top right corner of the screen. If you get confused by the ''MyHelloText'' class, just ignore it for the moment until you have read details on the definition of controls  in the following chapter, [[#Controls|Controls]].
 
<code><nowiki>class MyHelloWorldDialog {
idd = -1;  // set to -1, because we don't require a unique ID
movingEnable = false;  // no movement while the dialog is shown
controlsBackground[] = { };  // no background controls needed
objects[] = { };  // no objects needed
controls[] = { MyHelloText };  // our Hello World text as seen below:
class MyHelloText {
type = 0;  // CT_STATIC constant
style = 0;  // ST_LEFT constant
text = "Hello world";
font = "TahomaB";
sizeEx = 0.023;
 
colorBackground[] = { 1, 1, 1, 0.3 };
colorText[] = { 0, 0, 0, 1 };
 
x = 0.8;
y = 0.1;
w = 0.2;
h = 0.05;
};
};</nowiki></code>


== Controls ==
== Controls ==

Revision as of 16:21, 6 May 2007

Template:Stub

This article is classified as work in progress and is likely to change very often before it will be moved or merged to Dialogs once it has reached a certain degree of maturity.

Feel free to make changes though, even if it currently resides in Manny's personal namespace.

-- Manny 15:49, 6 May 2007 (CEST)

Introduction

Short introduction about what it is and what it can do

Dialogs

Dialogs are parent containers for the actual controls it contains. Their definition contains several properties on the controls it contains, how the dialog can be addressed, and whether or not the player is able to continue regular movement while the dialog is shown.

They can be defined in the description.ext file or externalized to seperate hpp-files, which are included in the description.ext file using the #include preprocessor directive. The latter method is generally a good idea to split a large description.ext file into several small chunks in order to keep track of what's where.

Most often, controls of a dialog are defined within the definition of the dialog itself, though it's a good practice to generalize common controls in a base definition in the global scope. See best practice for details. For simplicity we won't apply this practice in the following code examples.


Properties
Name Type Remark
idd integer the unique ID number of this dialog. can be -1 if you don't require access to the dialog itself from within a script.
movingEnable boolean sets whether or not the player is hindered from aiming or moving while the dialog is open.
controlsBackground array contains class names of all background controls associated to this dialog.
controls array contains class names of all foreground controls associated to this dialog.
objects array


Example of a dialog that will only display Hello world in the top right corner of the screen. If you get confused by the MyHelloText class, just ignore it for the moment until you have read details on the definition of controls in the following chapter, Controls.

class MyHelloWorldDialog { idd = -1; // set to -1, because we don't require a unique ID movingEnable = false; // no movement while the dialog is shown controlsBackground[] = { }; // no background controls needed objects[] = { }; // no objects needed controls[] = { MyHelloText }; // our Hello World text as seen below: class MyHelloText { type = 0; // CT_STATIC constant style = 0; // ST_LEFT constant text = "Hello world"; font = "TahomaB"; sizeEx = 0.023; colorBackground[] = { 1, 1, 1, 0.3 }; colorText[] = { 0, 0, 0, 1 }; x = 0.8; y = 0.1; w = 0.2; h = 0.05; }; };

Controls

A few words about controls, as well as defining one. Crossreference to #Best Practice. IDCs, usage, etc.

Static

Text

Solid rectangles

Pictures

Button

Active text

Structured text

Text box

Slider

Combobox

Listbox

Toolbox

Checkbox

Progress bar

Context menu

HTML

Tree

Static skew

Controls group

Animated texture

3D Objects

Map

Best practice

Polymorphism