{"name":"CT OBJECT CONTAINER","title":"CT OBJECT CONTAINER","type":"topic","url":"https://community.bistudio.com/wiki/CT_OBJECT_CONTAINER","revid":364508,"updated":"2024-05-16T20:42:02Z","aliases":[],"markdown":"### Introduction\n\nSee CT_OBJECT for more information on the basics of object dialogs. In addition to CT_OBJECT this control type supports the addition of controls inside of a predefined area of the object which means that if the object moves so do the controls inside of it.\n\n> [!NOTE]\n> For an object with selections one can use user texture. For example `\"\\A3\\Misc_F\\Helpers\\UserTexture1m.p3d\"` has selections: `usertexture`, `usertexture TL`,`usertexture TR`, `usertexture BL`.\n\n#### Related commands & functions\n\n- Commands: General\n- Commands: UI Eventhandlers\n\n#### Related User Interface Eventhandlers\n\n- Events: General\n\n### Alphabetical Order\n\n> [!NOTE]\n> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found **here**.\n\n> [!WARNING]\n> Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [this](https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf) config crawler.\n\n```cpp\n#define CT_OBJECT_CONTAINER 82\n```\n\n#### A\n\n##### Areas\n\n**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass Areas\n{\n    class Usertexture\n    {\n        selection = \"display\";\n        class Controls\n        {\n        };\n    };\n};\n```\n\n#### D\n\n##### direction\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ndirection[] = {0,0,1};\n```\n\n#### E\n\n##### enableZoom\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nenableZoom = 1;\n```\n\n#### I\n\n##### inBack\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\ninBack = 0;\n```\n\n#### M\n\n##### model\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nmodel = \"\\core\\notepad\\notepad.p3d\";\n```\n\n#### P\n\n##### paper1\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\npaper1 = \"#(argb,8,8,3)color(1,1,1,1)\";\n```\n\n##### paper2\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\npaper2 = \"#(argb,8,8,3)color(1,1,1,1)\";\n```\n\n##### paper3\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\npaper3 = \"#(argb,8,8,3)color(1,1,1,1)\";\n```\n\n##### paper4\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\npaper4 = \"#(argb,8,8,3)color(1,1,1,1)\";\n```\n\n##### paper5\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\npaper5 = \"#(argb,8,8,3)color(1,1,1,1)\";\n```\n\n##### paper6\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\npaper6 = \"#(argb,8,8,3)color(1,1,1,1)\";\n```\n\n##### paper7\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\npaper7 = \"#(argb,8,8,3)color(1,1,1,1)\";\n```\n\n##### position\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nposition[] = {-0.08,0,0.32};\n```\n\n##### positionBack\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\npositionBack[] = {-0.325,0.197,0.8};\n```\n\n#### S\n\n##### scale\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nscale = 1.2;\n```\n\n##### selectionPaper\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nselectionPaper = \"paper\";\n```\n\n#### U\n\n##### up\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nup[] = {0,1,0};\n```\n\n#### X\n\n##### xBack\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nxBack = \"25 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)\";\n```\n\n#### Y\n\n##### yBack\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nyBack = \"12 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)\";\n```\n\n#### Z\n\n##### z\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nz = 1;\n```\n\n##### zBack\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nzBack = 2;\n```\n\n##### zoomDuration\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nzoomDuration = 0.5;\n```\n\n### Default Classes\n\n> [!NOTE]\n> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`\n>\n> ---\n>\n> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the import keyword).\n>\n> In older versions, use `\"Default\" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the description.ext.\n\nNone\n\n### Other Examples\n\n```cpp\nclass MyDrink\n{\n\n    idd = -1;\n    movingEnable = 0;\n    enableSimulation = 1;\n\n    class Objects\n    {\n\n        class Can\n        {\n\n            onObjectMoved = \"systemChat str _this\";\n\n            idc = -1;\n            type = 82;\n            model = \"\\A3\\Structures_F\\Items\\Food\\Can_V3_F.p3d\";\n            scale = 1;\n\n            direction[] = {0, -0.35, -0.65};\n            up[] = {0, 0.65, -0.35};\n\n            //position[] = {0,0,0.2}; optional\n\n            x = 0.5;\n            y = 0.5;\n            z = 0.2;\n\n            //positionBack[] = {0,0,1.2}; optional\n\n            xBack = 0.5;\n            yBack = 0.5;\n            zBack = 1.2;\n\n            inBack = 1;\n            enableZoom = 1;\n            zoomDuration = 0.001;\n            class Areas\n            {\n                class Something1\n                {\n                    selection = \"Area_1\";\n                    // game will expect \"Area_1 TL\", \"Area_1 TR\", \"Area_1 BL\" memory points (Top Left, Top Right, Bottom Left) to be present in memory LOD. Basing on that surface will be created for rendering your controls\n\n                    // Only controls are supported (no object in object)\n                    class Controls\n                    {\n                    };\n                };\n                // Multiple areas are supported\n                class Something2\n                {\n                    selection = \"Area_2\";\n                    // game will expect \"Area_2 TL\", \"Area_2 TR\", \"Area_2 BL\" memory points (Top Left, Top Right, Bottom Left) to be present in memory LOD. Basing on that surface will be created for rendering your controls\n                    class Controls\n                    {\n                    };\n                };\n            };\n        };\n    };\n};\n```","sections":[{"heading":"Introduction","level":3,"markdown":"See CT_OBJECT for more information on the basics of object dialogs. In addition to CT_OBJECT this control type supports the addition of controls inside of a predefined area of the object which means that if the object moves so do the controls inside of it.\n\n> [!NOTE]\n> For an object with selections one can use user texture. For example `\"\\A3\\Misc_F\\Helpers\\UserTexture1m.p3d\"` has selections: `usertexture`, `usertexture TL`,`usertexture TR`, `usertexture BL`."},{"heading":"Related commands & functions","level":4,"markdown":"- Commands: General\n- Commands: UI Eventhandlers"},{"heading":"Related User Interface Eventhandlers","level":4,"markdown":"- Events: General"},{"heading":"Alphabetical Order","level":3,"markdown":"> [!NOTE]\n> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found **here**.\n\n> [!WARNING]\n> Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [this](https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf) config crawler.\n\n```cpp\n#define CT_OBJECT_CONTAINER 82\n```"},{"heading":"A","level":4,"markdown":""},{"heading":"Areas","level":5,"markdown":"**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass Areas\n{\n    class Usertexture\n    {\n        selection = \"display\";\n        class Controls\n        {\n        };\n    };\n};\n```"},{"heading":"D","level":4,"markdown":""},{"heading":"direction","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ndirection[] = {0,0,1};\n```"},{"heading":"E","level":4,"markdown":""},{"heading":"enableZoom","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nenableZoom = 1;\n```"},{"heading":"I","level":4,"markdown":""},{"heading":"inBack","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\ninBack = 0;\n```"},{"heading":"M","level":4,"markdown":""},{"heading":"model","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nmodel = \"\\core\\notepad\\notepad.p3d\";\n```"},{"heading":"P","level":4,"markdown":""},{"heading":"paper1","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\npaper1 = \"#(argb,8,8,3)color(1,1,1,1)\";\n```"},{"heading":"paper2","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\npaper2 = \"#(argb,8,8,3)color(1,1,1,1)\";\n```"},{"heading":"paper3","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\npaper3 = \"#(argb,8,8,3)color(1,1,1,1)\";\n```"},{"heading":"paper4","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\npaper4 = \"#(argb,8,8,3)color(1,1,1,1)\";\n```"},{"heading":"paper5","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\npaper5 = \"#(argb,8,8,3)color(1,1,1,1)\";\n```"},{"heading":"paper6","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\npaper6 = \"#(argb,8,8,3)color(1,1,1,1)\";\n```"},{"heading":"paper7","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\npaper7 = \"#(argb,8,8,3)color(1,1,1,1)\";\n```"},{"heading":"position","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nposition[] = {-0.08,0,0.32};\n```"},{"heading":"positionBack","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\npositionBack[] = {-0.325,0.197,0.8};\n```"},{"heading":"S","level":4,"markdown":""},{"heading":"scale","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nscale = 1.2;\n```"},{"heading":"selectionPaper","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nselectionPaper = \"paper\";\n```"},{"heading":"U","level":4,"markdown":""},{"heading":"up","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nup[] = {0,1,0};\n```"},{"heading":"X","level":4,"markdown":""},{"heading":"xBack","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nxBack = \"25 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)\";\n```"},{"heading":"Y","level":4,"markdown":""},{"heading":"yBack","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nyBack = \"12 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)\";\n```"},{"heading":"Z","level":4,"markdown":""},{"heading":"z","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nz = 1;\n```"},{"heading":"zBack","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nzBack = 2;\n```"},{"heading":"zoomDuration","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nzoomDuration = 0.5;\n```"},{"heading":"Default Classes","level":3,"markdown":"> [!NOTE]\n> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`\n>\n> ---\n>\n> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the import keyword).\n>\n> In older versions, use `\"Default\" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the description.ext.\n\nNone"},{"heading":"Other Examples","level":3,"markdown":"```cpp\nclass MyDrink\n{\n\n    idd = -1;\n    movingEnable = 0;\n    enableSimulation = 1;\n\n    class Objects\n    {\n\n        class Can\n        {\n\n            onObjectMoved = \"systemChat str _this\";\n\n            idc = -1;\n            type = 82;\n            model = \"\\A3\\Structures_F\\Items\\Food\\Can_V3_F.p3d\";\n            scale = 1;\n\n            direction[] = {0, -0.35, -0.65};\n            up[] = {0, 0.65, -0.35};\n\n            //position[] = {0,0,0.2}; optional\n\n            x = 0.5;\n            y = 0.5;\n            z = 0.2;\n\n            //positionBack[] = {0,0,1.2}; optional\n\n            xBack = 0.5;\n            yBack = 0.5;\n            zBack = 1.2;\n\n            inBack = 1;\n            enableZoom = 1;\n            zoomDuration = 0.001;\n            class Areas\n            {\n                class Something1\n                {\n                    selection = \"Area_1\";\n                    // game will expect \"Area_1 TL\", \"Area_1 TR\", \"Area_1 BL\" memory points (Top Left, Top Right, Bottom Left) to be present in memory LOD. Basing on that surface will be created for rendering your controls\n\n                    // Only controls are supported (no object in object)\n                    class Controls\n                    {\n                    };\n                };\n                // Multiple areas are supported\n                class Something2\n                {\n                    selection = \"Area_2\";\n                    // game will expect \"Area_2 TL\", \"Area_2 TR\", \"Area_2 BL\" memory points (Top Left, Top Right, Bottom Left) to be present in memory LOD. Basing on that surface will be created for rendering your controls\n                    class Controls\n                    {\n                    };\n                };\n            };\n        };\n    };\n};\n```"}],"categories":["Control Types"],"groups":["GUI"]}