Setting slider value as sprite scale?

0 favourites
  • 5 posts
From the Asset Store
slide the tiles to fill the board.60 awesome levels.
  • I'm using a slider to scale images/sprites, so when I click on an other image, I want the slider to take the image's scale and set it as it's value.

    I can set the scale to the slider's value, but not the other way around, as seen here: gyazo.com/f51712a394eae713e64b731adb1b7490

    How could I make this happen?

  • dropbox.com/s/zkb8xrwonana9yb/sliderscaleexample.c3p

    Should work fine. You probably have a picking issue.

  • dropbox.com/s/zkb8xrwonana9yb/sliderscaleexample.c3p

    Should work fine. You probably have a picking issue.

    You might be right. When I pick an other image, well let me show you instead...

    gyazo.com/cb0db820561766294acb9d32dd5e9fde

    My english isn't great, so I'm better off showing it in video XD

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • From the manual:

    ImageWidth

    ImageHeight

    The original dimensions of the object (its current animation frame image size), in pixels. Since objects can be stretched at runtime causing the normal Width and Height expressions to return different values, these can be used to get the original size regardless of the stretched size.

    Its a matter of approach.

    perhaps, give the Templates a variable, "SelectedScale" (number)

    When sliding the slider scale, set the value of the Templates.SelectedScale, followed by setting that value in the Templates scale propperties.

    When selected the image to edit, grab their SelectedScale and set in the slider.

  • From the manual:

    ImageWidth

    ImageHeight

    The original dimensions of the object (its current animation frame image size), in pixels. Since objects can be stretched at runtime causing the normal Width and Height expressions to return different values, these can be used to get the original size regardless of the stretched size.

    Its a matter of approach.

    perhaps, give the Templates a variable, "SelectedScale" (number)

    When sliding the slider scale, set the value of the Templates.SelectedScale, followed by setting that value in the Templates scale propperties.

    When selected the image to edit, grab their SelectedScale and set in the slider.

    Awesome, thank you for your input. Will try this.

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