createDisplay: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category\: ?Command[ _]Group\:.*\|\{\{uc\:\{\{PAGENAME\}\}\}\}\]\] " to "")
(Description cleanup)
Line 9: Line 9:
____________________________________________________________________________________________
____________________________________________________________________________________________


| 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.<br><br>
| 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 around while the display is shown.<br>
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.<br><br>
Displays created with [[createDisplay]] or [[createDialog]] will take control of the mouse pointer and will close when user presses <tt>Escape</tt>.
Displays created with both [[createDisplay]] and [[createDialog]] will take control of the mouse pointer and will close when user presses <tt>Esc</tt>.
{{Feature arma3 | Since {{arma3}} 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.}}
<code>_emptyDisplay <nowiki>=</nowiki> [[findDisplay]] 46 [[createDisplay]] "RscDisplayEmpty";</code>
{{Informative | If an ''overlay'' is needed instead, use [[cutRsc]].}}
If display is needed which exists independently, it can be created in IGUI layer with [[cutRsc]] command.  
|DESCRIPTION=
<code>"someLayer" [[cutRsc]] ["RscTitleDisplayEmpty", "PLAIN"];
_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=
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 25: Line 22:
|p2= resourceName: [[String]] - custom display class defined in [[description.ext]] or existing display class from main config |PARAMETER2=
|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]] |RETURNVALUE=
| [[Display]] (since {{arma3}} v1.49.131653, [[Nothing]] before) |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= <code>[[findDisplay]] 46 [[createDisplay]] "RscCredits";</code> |EXAMPLE1=
|x1= <code>[[findDisplay]] 46 [[createDisplay]] "RscCredits";</code> |EXAMPLE1=


|x2= <code>{{cc|creates an empty display}}
[[private]] _emptyDisplay {{=}} [[findDisplay]] 46 [[createDisplay]] "RscDisplayEmpty";</code> |EXAMPLE2=
____________________________________________________________________________________________
____________________________________________________________________________________________


|[[closeDisplay]], [[createDialog]], [[displayCtrl]], [[dialog]], [[displayNull]], [[controlNull]], [[ctrlCreate]], [[displayParent]] |SEEALSO=
|[[closeDisplay]], [[createDialog]], [[displayCtrl]], [[dialog]], [[displayNull]], [[controlNull]], [[ctrlCreate]], [[displayParent]] |SEEALSO=
}}
}}


Line 67: Line 65:
<dt class="note">[[User:MrPineapple|MrPineapple]]</dt>
<dt class="note">[[User:MrPineapple|MrPineapple]]</dt>
<dd class="note">
<dd class="note">
Arma3 v1.34
{{arma3}} v1.34<br>
<br>
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:
<br>
<code>LbAdd [1234, "item"]; {{cc|does not work on displays, and won't error either}}
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.
_ctrl LbAdd "item"; {{cc|does work with displays}}</code>
<br>
<br>
EXAMPLE:
<code>LbAdd [1234, "item"]; // does not work on displays, and won't error either
_ctrl LbAdd "item"; // does work with displays</code>
<br>
So you have to use the control(DisplayCtrl) and not the IDC.
So you have to use the control(DisplayCtrl) and not the IDC.



Revision as of 17:55, 22 December 2020

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

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 around while the display is shown.
Displays created with createDisplay or createDialog will take control of the mouse pointer and will close when user presses Escape.
Arma 3
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.
If an overlay is needed instead, use cutRsc.
Groups:
GUI Control

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:
Display (since Arma 3 v1.49.131653, Nothing before)

Examples

Example 1:
findDisplay 46 createDisplay "RscCredits";
Example 2:
// creates an empty display private _emptyDisplay = findDisplay 46 createDisplay "RscDisplayEmpty";

Additional Information

See also:
closeDisplaycreateDialogdisplayCtrldialogdisplayNullcontrolNullctrlCreatedisplayParent

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

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
Arma 3 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: 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.