Difference between revisions of "createDisplay"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Bot: Reverted to revision 104063 by killzone_kid on 2017-07-29T09:04:56Z)
m (Text replacement - "|gr1= GUI Control |GROUP1= |gr1= GUI Control |GROUP1=" to "|gr1= GUI Control |GROUP1=")
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|= Comments
+
{{Command|Comments=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| arma |= Game name
+
| arma |Game name=
  
|1.00|= Game version
+
|1.00|Game version=
 +
 
 +
|gr1= GUI Control |GROUP1=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
Line 14: Line 16:
 
<code>"someLayer" [[cutRsc]] ["RscTitleDisplayEmpty", "PLAIN"];
 
<code>"someLayer" [[cutRsc]] ["RscTitleDisplayEmpty", "PLAIN"];
 
_emptyDisplay <nowiki>=</nowiki> [[uiNamespace]] [[getVariable]] "RscTitleDisplayEmpty";</code>
 
_emptyDisplay <nowiki>=</nowiki> [[uiNamespace]] [[getVariable]] "RscTitleDisplayEmpty";</code>
Such display can be closed with [[closeDisplay]] command or by overwriting the same cut layer with another output. Note that "Unload" EH for some reason does not work with such display. |= Description
+
Such display can be closed with [[closeDisplay]] command or by overwriting the same cut layer with another output. Note that "Unload" EH for some reason does not work with such display. |DESCRIPTION=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| parent '''createDisplay''' resourceName |= Syntax
+
| parent '''createDisplay''' resourceName |SYNTAX=
  
|p1= parent: [[Display]] |= Parameter 1
+
|p1= parent: [[Display]] |PARAMETER1=
  
|p2= resourceName: [[String]] - custom display class defined in [[description.ext]] or existing display class from main config |= Parameter 2
+
|p2= resourceName: [[String]] - custom display class defined in [[description.ext]] or existing display class from main config |PARAMETER2=
  
| [[Nothing]] or (''Since Arma 3 v1.49.131653'') [[Display]] |= Return value
+
| [[Nothing]] or (''Since Arma 3 v1.49.131653'') [[Display]] |RETURNVALUE=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
 
   
 
   
|x1= <code>[[findDisplay]] 46 [[createDisplay]] "RscCredits";</code> |= Example 1
+
|x1= <code>[[findDisplay]] 46 [[createDisplay]] "RscCredits";</code> |EXAMPLE1=
  
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
|[[closeDisplay]], [[createDialog]], [[displayCtrl]], [[dialog]], [[displayNull]], [[controlNull]], [[ctrlCreate]], [[displayParent]] |= See also
+
|[[closeDisplay]], [[createDialog]], [[displayCtrl]], [[dialog]], [[displayNull]], [[controlNull]], [[ctrlCreate]], [[displayParent]] |SEEALSO=
  
 
}}
 
}}
Line 44: Line 46:
  
 
[[Category:Scripting Commands|CREATEDISPLAY]]
 
[[Category:Scripting Commands|CREATEDISPLAY]]
[[Category:Scripting Commands ArmA|CREATEDISPLAY]]
+
[[Category:Scripting Commands Armed Assault|CREATEDISPLAY]]
 
[[Category:Command_Group:_GUI_Control|{{uc:{{PAGENAME}}}}]]
 
[[Category:Command_Group:_GUI_Control|{{uc:{{PAGENAME}}}}]]
 
[[Category:Command_Group:_Interaction|{{uc:{{PAGENAME}}}}]]
 
[[Category:Command_Group:_Interaction|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
+
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
+
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
  
 
<!-- CONTINUE Notes -->
 
<!-- CONTINUE Notes -->
Line 88: Line 90:
 
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
 
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
 
<dd class="note"> A user dialog created with [[createDisplay]] over mission display ([[findDisplay]] 46) will stop [[displayAddEventHandler|display event handlers]] added to mission display from firing. However if it is created with [[createDialog]] then the event handlers continue to work.
 
<dd class="note"> A user dialog created with [[createDisplay]] over mission display ([[findDisplay]] 46) will stop [[displayAddEventHandler|display event handlers]] added to mission display from firing. However if it is created with [[createDialog]] then the event handlers continue to work.
 +
</dd>
 +
</dl>
 +
<!-- DISCONTINUE Notes -->
 +
 +
<!-- CONTINUE Notes -->
 +
<dl class="command_description">
 +
<dd class="notedate">Posted on June 21, 2020 - 17:01 (UTC)</dd>
 +
<dt class="note">[[User:Target_practice|Target_practice]]</dt>
 +
<dd class="note">
 +
Creating a display with the same parent as an existing display will destroy the latter and all of its children. However, their [[User_Interface_Event_Handlers#onUnload|onUnload]], [[User_Interface_Event_Handlers#onChildDestroyed|onChildDestroyed]], and [[User_Interface_Event_Handlers#onDestroy|onDestroy]] event handlers will not fire.
 
</dd>
 
</dd>
 
</dl>
 
</dl>
 
<!-- DISCONTINUE Notes -->
 
<!-- DISCONTINUE Notes -->

Latest revision as of 19:44, 24 September 2020

Introduced with Armed Assault version 1.001.00
Hover & click on the images for descriptions

Description

Description:
Creates child display of given display and loads from "resourceName". The notable difference between createDisplay and createDialog is that with createDisplay the player would be able to move whilst having control of the mouse pointer.

Since Arma 3 v1.49.131653 createDisplay returns Display and will first look in description.ext for resourceName config, if not found, it will then look in main config.

Displays created with both createDisplay and createDialog will take control of the mouse pointer and will close when user presses Esc. _emptyDisplay = findDisplay 46 createDisplay "RscDisplayEmpty"; If display is needed which exists independently, it can be created in IGUI layer with cutRsc command. "someLayer" cutRsc ["RscTitleDisplayEmpty", "PLAIN"]; _emptyDisplay = uiNamespace getVariable "RscTitleDisplayEmpty"; Such display can be closed with closeDisplay command or by overwriting the same cut layer with another output. Note that "Unload" EH for some reason does not work with such display.

Syntax

Syntax:
parent createDisplay resourceName
Parameters:
parent: Display
resourceName: String - custom display class defined in description.ext or existing display class from main config
Return Value:
Nothing or (Since Arma 3 v1.49.131653) Display

Examples

Example 1:
findDisplay 46 createDisplay "RscCredits";

Additional Information

See also:
closeDisplaycreateDialogdisplayCtrldialogdisplayNullcontrolNullctrlCreatedisplayParent

Notes

i
Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.

Notes

Bottom Section

Posted on August 23, 2014 - 23:36 (UTC)
Killzone Kid
Do not simply createDisplay from UI context code such as "ButtonDown" UI Event handler, as it will crash the game. Instead use spawn scope: [] spawn {findDisplay 46 createDisplay "RscCredits"};
Posted on November 15, 2014 - 13:20 (UTC)
MrPineapple
Arma3 v1.34

When using CreateDisplay instead of CreateDialog, all the commands for working with the controls of the display only work with the control version, not the IDC version.

EXAMPLE: LbAdd [1234, "item"]; // does not work on displays, and won't error either _ctrl LbAdd "item"; // does work with displays
So you have to use the control(DisplayCtrl) and not the IDC.
Posted on July 29, 2017 - 09:02 (UTC)
Killzone Kid
A user dialog created with createDisplay over mission display (findDisplay 46) will stop display event handlers added to mission display from firing. However if it is created with createDialog then the event handlers continue to work.
Posted on June 21, 2020 - 17:01 (UTC)
Target_practice
Creating a display with the same parent as an existing display will destroy the latter and all of its children. However, their onUnload, onChildDestroyed, and onDestroy event handlers will not fire.