{"name":"createDisplay","operator":null,"title":"createDisplay","type":"command","url":"https://community.bistudio.com/wiki/createDisplay","revid":369323,"updated":"2024-09-03T18:42:58Z","groups":["GUI Control"],"status":"ok","replaced_by":[],"games":[{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma1","name":"Armed Assault","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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.\n\nDisplays created with createDisplay or createDialog will take control of the mouse pointer and will close when user presses <kbd>Esc</kbd>.\n\n> [!NOTE]\n> **Arma 3:** Since Arma 3 v1.50 createDisplay returns Display and will first look in description.ext for resourceName config, if not found, it will then look in main config.\n\n> [!NOTE]\n> If an *overlay* is needed instead, use cutRsc.","syntaxes":[{"syntax":"parent createDisplay resourceName","since":null,"effect":null,"exec":null,"params":[{"name":"parent","type":"Display","optional":false,"default":null,"description":null,"types":["Display"],"since":null,"text":"parent: Display"},{"name":"resourceName","type":"String","optional":false,"default":null,"description":"custom display class defined in description.ext or existing display class from main config","types":["String"],"since":null,"text":"resourceName: String - custom display class defined in description.ext or existing display class from main config"}],"returns":{"type":"Display (since Arma 3 v1.50, Nothing before)","types":["Display","Nothing"],"description":null,"text":"Display (since Arma 3 v1.50, Nothing before)"},"form":"binary","operator":null,"left":{"text":"parent","types":["Display"]},"right":{"text":"resourceName","types":["String"]}}],"examples":[{"text":"```sqf\nfindDisplay 46 createDisplay \"RscCredits\";\n```","code":["findDisplay 46 createDisplay \"RscCredits\";"]},{"text":"```sqf\n// creates an empty display\nprivate _emptyDisplay = findDisplay 46 createDisplay \"RscDisplayEmpty\";\n```","code":["// creates an empty display\nprivate _emptyDisplay = findDisplay 46 createDisplay \"RscDisplayEmpty\";"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["closeDisplay","createDialog","displayCtrl","dialog","displayNull","controlNull","ctrlCreate","displayParent"],"notes":[{"user":"MrPineapple","date":"2014-11-15T13:20:00Z","text":"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:\n\n```sqf\nlbAdd [1234, \"item\"];    // does not work on displays, and won't error either\n_ctrl lbAdd \"item\";        // does work with displays\n```\n\nSo you have to use the control(DisplayCtrl) and not the IDC."},{"user":"Killzone_Kid","date":"2017-06-29T09:02:00Z","text":"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."},{"user":"Target_practice","date":"2020-06-21T17:01:00Z","text":"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."},{"user":"7erra","date":"2022-02-05T15:47:14Z","text":"When trying to create a display with createDisplay on a non existing display the command will fail silently and return displayNull."}],"categories":["ArmA: Armed Assault: New Scripting Commands","ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: GUI Control","Introduced with Armed Assault version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}