How to make custom buttons in basic tier

here’s stuff you need to know before making custom buttons:

1. ID: the id will be the name used to call the div
2. Class: the div MUST be assigned to the class “trigger” or else it wont work, you can assign more than one class on a div
3. Style: there is no button that matches perfectly with every game, customize the button by modifying the “style stuff here” in the code below
Lastly.
4. Functionality: The code MUST be in either the scoreboard text OR a dialogue, highly recommend scoreboard text

ok so first you need to make a div, here’s the structure of the code that creates a div:

<div id="examplebutton" class="trigger" style="style stuff here">
</div>

here’s an example of code that creates a custom button

<div id="testbutton" class="trigger" style=
"top: 125px;
right: 5px;
border-radius: 5px;
background-color: #4c4c4c;
display: block;
width: 50px;
height: 50px;
position: absolute;
border-width: 5px;
border-color: #343434;
cursor: pointer;">
</div>

this is what it looks like ingame
image
btw when you enter the code in scoreboard text it looks like this
image
you can go back by clicking the button

now, how do we create a script that runs when a button is clicked? its easy create a new script and use this trigger (engine version must be on 2.0.8 or above)
image
create this if statement
image
replace “ID OF BUTTON” with the id of the button, in this case the id of my button is “testbutton”

after that you’re pretty much done, you can put actions in the “then do” section
image

example:
image

if you have any questions or the button isnt working, please let me know

good luck creating games creators :saluting_face:

4 Likes

this will become outdated soon cause the ui tab will be available for all soon

1 Like

I do not recommend using inline style. For better readability, use a class and apply the style to the class!

1 Like

oh also we will fix HTML preview soon (:

1 Like

ye but this is simplified
if you know how to do this definitely should do to make it more readable

1 Like