Hello, I started some time studying the construct 2 and would like to know how do I click a button and call a random image or text in different layers. Thank you for your attention.
Develop games in your browser. Powerful, performant & highly capable.
First you have to decide how your going to call the image when you click the button.
You can use "Spawn another Object" if your going to create from a specific object or sprite.
You can use "Create Object" event under System.
Then create a Global Variable called "Images" for example.
Then Make a series of statements like so:
System (compare variable) like so:
System > Images = "Sprite 1" > System >Create Object >Sprite1, Layer 0, X,Y
Create a statement of code for every sprite or text you want to be able to create.
Then when the button is clicked use:
Button > On Clicked > System (set value) > Images = choose(sprite 1, sprite 2, sprite 3, etc...)