1. Start up ARMA 3 and select Editor and select any map it doesn't matter and create a new mission.
2. Save the mission. It can be anything you want but remember the name.
3. Once you save it, place one playable unit down and click preview.
4. Inside the game press escape and look for GUI EDITOR on the bottom and select it.
5. Press escape and you should now be in the GUI EDITOR you should have a grid in front. A few tips, pressing 'H' brings up the help menu and it tells you all the commands needed to operate the editor.
6. Right-click anywhere and a dialog will pop up, select RscButton near the top and watch it appear on your screen.
7. Right-click on that button and another menu pops up and this menu allows you to edit the button to your liking.
8. I'll go through what I've done
- Class: This is the variable name to refers to this button
- Text: This will appear on the button
- Text color: This will be the color of the button.
- Look at Active color and to see what each value means. It's a RGB scale with Alpha
- Tooltip: When a mouse hovers over the button a this text will appear.
- Position type: Always put Safezone, I don't know why but all tutorials I've read say so.
As you can see it's Ctrl + P. This will copy information to your clipboard. Alt tab out of the game and open up any text editor preferably Notepad++, and paste the information inside a text document. You should see something like this.
10. Now save this file as defines.hpp Now go back in the game and look for Export to config format. It's Shift + Ctrl + S. This will ask you to name the project and you can name it anything. Once it is saved it will also copy to your clipboard. So open up a new file and paste it.
11. As you can see some of the information I posted in the game is here in the document. Now we have to add a few more lines of code. Look at the next picture and you can see what I had to add to make this button work.
12. I had to make class RJ_Example_Button: RscButton a subclass of class controls which is a subclass of class RJ47_Example. Read the comments in the picture to learn more. Make sure to add action line to the button config. It is important as nothing will happen if you don't define that.
13. Save the file as button.hpp. Now open up the mission folder which it should be in this directory
C:\Users\Ramon\Documents\Arma 3 - Other Profiles\yourusername\missions\RJ47_Example.Stratis
Now this is my file path to my mission and we need to save both defins and button.hpp in this folder.
14. After we saved these files we need to create a new file inside this directory and call it description.ext
These are the files you should have inside the directory.
15. Open up description.ext and add 2 lines of code. The ordering is important.
- #include "defines.hpp"
- #include "button.hpp"
16. Now save this file and head back into ARMA 3 and lets spawn the button. Add a pole to the mission and edit the initialization block of the pole and add this code
- this addAction["Spawn G.U.I.",{createDialog "RJ47_Example";}];
17. Click okay, save it, then preview the mission and head towards the pole and you should see your addAction title show up by looking at the pole. Select this and then boom your button is spawned on the screen. Now nothing will happen until you click your button. Click it and the message will spawn that was defined in the action code in the button.hpp.
This concludes this tutorial.