How do I point out objects within families

0 favourites
  • 5 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • On screen I have: Option 1, option 2, option 3, options 4, option 5. (text objects)

    When you touch option 1, I want it to have opacity 100 and the others opacity 30.

    I also added square sprites on top of each text object, so that the user has more space to touch the option.

    Option texts are put in family OptionsTextFamily.

    Square touch sprites have been put in family OptionsTouchFamily.

    What would be the efficient/elegant way?

    The not elegant way is:

    On touch TouchSprite1 --> set options1Text opacity to 100

    set options2Text opacity too 30

    set options3Text opacity too 30

    set options4Text opacity too 30

    set options5Text opacity too 30

    On touch TouchSprite2 --> set options1Text opacity to 30

    set options2Text opacity too 100

    set options3Text opacity too 30

    ... and so on.

  • Don't have time to do a capx now, but I have done a similar thing before.

    First set touch sprites and options text as container of each other so they get picked together.

    Local var options_uid

    On Touch TouchSprite1

    -> set OptionsText opacity to 100

    -> system set variable options_uid to OptionsText.UID

    then

    System: Every Tick

    /System: Pick all OptionsText

    /OptionsText.UID <> options_uid

    -> set OptionsText opacity to 30

  • What would be the efficient/elegant way?

    ... Don't use text object on mobiles. Instead use one spritefont and make 5 instances (one for each option)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • First set touch sprites and options text as container of each other so they get picked together.

    First off, thanks for the reply.

    Do you mean: I select one textobject and press: add container and select a touch sprite. Then go to the next textobject and select the corresponding sprite object?

  • > What would be the efficient/elegant way?

    >

    ... Don't use text object on mobiles. Instead use one spritefont and make 5 instances (one for each option)

    I will, from now on.

    Text objects demand more memory?

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