{"name":"createDialog","operator":null,"title":"createDialog","type":"command","url":"https://community.bistudio.com/wiki/createDialog","revid":338553,"updated":"2023-03-19T00:02:56Z","groups":["GUI Control"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.75"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"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":"ofp","name":"Operation Flashpoint","version":"1.75"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":"local","server_exec":false},"exec":null,"description":"Creates a dialog which is defined either in the mission's description.ext, in the campaign's description.ext or in the global resource.cpp. The given name has to be the class name used in one of these files. If another dialog is already opened, the desired dialog is created as a child dialog of the one already opened.\n\n> [!NOTE]\n> By default, displays created with createDisplay are rendered on top of dialogs created with createDialog. If *forceOnTop* is set to true, the dialog will be rendered on top of displays.","syntaxes":[{"syntax":"createDialog dialogName","since":null,"effect":null,"exec":null,"params":[{"name":"dialogName","type":"String","optional":false,"default":null,"description":"class name used in the description.ext, resource.cpp or config.cpp","types":["String"],"since":null,"text":"dialogName: String - class name used in the description.ext, resource.cpp or config.cpp"}],"returns":{"type":"Boolean","types":["Boolean"],"description":"true when the dialog was created successfully","text":"Boolean -  true when the dialog was created successfully"},"form":"unary","operator":null,"left":null,"right":{"text":"dialogName","types":["String"]}},{"syntax":"createDialog [dialogName, forceOnTop]","since":"arma3 2.08","effect":null,"exec":null,"params":[{"name":"dialogName","type":"String","optional":false,"default":null,"description":"class name used in the description.ext, resource.cpp or config.cpp","types":["String"],"since":null,"text":"dialogName: String - class name used in the description.ext, resource.cpp or config.cpp"},{"name":"forceOnTop","type":"Boolean","optional":true,"default":"false","description":"if true, dialog will be rendered on top of displays","types":["Boolean"],"since":null,"text":"forceOnTop: Boolean - (Optional, default false) if true, dialog will be rendered on top of displays"}],"returns":{"type":"Display","types":["Display"],"description":"created dialog","text":"Display - created dialog"},"form":"unary","operator":null,"left":null,"right":{"text":"[dialogName, forceOnTop]","types":["Array"]}}],"examples":[{"text":"```sqf\nprivate _ok = createDialog \"RscDisplayGame\";\nif (!_ok) then { hint \"Dialog could not be opened!\" };\n```","code":["private _ok = createDialog \"RscDisplayGame\";\nif (!_ok) then { hint \"Dialog could not be opened!\" };"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["displayCtrl","createDisplay","closeDialog","dialog","displayNull","controlNull","ctrlCreate","displayParent"],"notes":[{"user":"Killzone_Kid","date":"2017-07-29T09:04: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."}],"categories":["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 Operation Flashpoint version 1.75","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Scripting Commands: Local Effect","Take On Helicopters: Scripting Commands"]}