How do I spawn several instances of the same button

0 favourites
  • 3 posts
From the Asset Store
Several elements of the game interface hidden objects
  • Hey guys,

    What i'm trying to do is to spawn several instances of the same sprite which I use for selecting different options.

    In this case what I did to give them individual actions is to put a textbox over them and make it the real button, using the sprite just as a decoration.

    BUT, what I want to do is to give some kind of feedback in each individual button when I select the textbox I don't know how to make them unique (since, if I make them for example change sprite all the instances will change).

    Hope you guys can help me find a solution and thanks in advance!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • TextBox over a button? This will look ugly as hell <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Or did you mean Text object?

    You should add Text and Sprite into the same container. Then when you spawn a new sprite, its text will be created automatically.

    Also they will be logically linked to each other. When you pick a sprite instance (for example in On Clicked event), its text will be picked as well.

    You can also use the native Button object and style it with CSS:

    https://www.scirra.com/tutorials/1283/c ... -textboxes

  • Sorry, yes, I meant text object.

    I will try to do it with the container method. Thanks for your time. I'll update you when I'm done.

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