Calling an image or text with one click

0 favourites
  • 2 posts
From the Asset Store
High quality sound effect pack, in the following categories: Simple, negative, pozitive
  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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...)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)