How do I highlight a column while holding

0 favourites
  • 5 posts
From the Asset Store
Includes 11min video guide. Hold an input button to "fill" up a text object and safely skip cutscenes without annoyances
  • Hello,

    My wish is to touch the screen and highlight the column it is currently selecting, when moving from left to right or vice versa.

    There are no real columns, so I divided the screen in to columns of 50.

    I thought: first i will create 8 columns (sprites) next to eachother and

     when the cursos/finger touches one: make visible.[/code:2v25zme1]
    When not touching: invisible.
    Problem: as long as the finger is pressed on the screen and slides on the x-axis, the other sprites stay visible.
    
    So I tried adding another condition:
    [code:2v25zme1]when visible
    when the cursos/finger touches one: it becomes visible.[/code:2v25zme1]
    Unfortunately not the desired the effect: everything I have selected stays visible untill I release the cursor/finger.
  • This should work:

    Touch is touching column

    column set visible

    else

    column set invisible

  • Thanks for your reply.

    I have tried, but all instances of the sprite I have touched (but currently not touching those instances), are still visible. (unless I release the mouse, or move to an area where these sprites not are)

    If there was space between the sprites, this would have worked, but they are placed exactly next to eachother.

  • I still think it should work, but well..

    You could try this:

    Create a global variable CollumnTouched

    on touched collumn

    Collumntouched set value to column.uid

    -- pick all collumn

    set invisible

    touch is touching

    system compare two values collumn.uid = Collumntouched

    trigger once

    collumn set visible

    touch on any touch end

    collumn set invisible

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Works now, thanks to your suggestion! Thanks!

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