How do I Zoom in & Zoom out button And Fullscreen

0 favourites
  • 9 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • How do I set a button action that incrementally zoom in my layout and another button that incrementally will zoom out a layout. Also I can't find out how to full screen layout with a button click.

    Please help me if any one know this.

    thanks.

  • Use lerp !

    On "zoom in" clicked -

    • Set layout.scale to (layoutscale("Nameoflayout"),0.5,10*dt)

    On "zoom out" clicked -

    • Set layout.scale to (layoutscale("Nameoflayout"),1,10*dt)

    Cheers...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Whiteclaws if you want to help people you should try to get as accurate as possible.

    Your post is missing the need of a constant, and you cant use lerp.... with out the lerp.

    Perhaps you could post an example instead.

    ie

    this variable = that, set layout scale to lerp(........)

  • Oh sorry , :D ...

  • I don't understand how to do this yet....

    I tried like this

    on Zoom in clicked

    Set layout scale to lerp(0.5,0.5,10*dt)

    Its jump zoom out, not incrementally. its also zoom out with my button. I don't want this. I want zoom in and zoom out button will still same size when layout scale out.

    Please also help how to Full screen with a button clicked.

    Thanks

  • Try:

    on button up clicked:

    set global variable "scaleLayer" to 1

    global variable "scaleLayer" = 1, system set layer scale to lerp(LayerScale(layername), scaleMax, something*dt)

    or

    on button down clicked:

    set global variable "scaleLayer" to 2

    global variable "scaleLayer" = 2, system set layer scale to lerp(LayerScale(layername), scaleMin, something*dt)

    Note:

    It will continue to do the lerp until the variable is changed.

    You should try to add a way to change the variable, however it should not effect performance.

  • To keep the buttons not changed from the layout scale, position them on a second layer and set its Scale rate property to 0.

  • Thanks, got this the zooming and zoom out stuff.

    but cant find yet how to full screen my game with a button clicked. will you please help me on this?

    Thanks.

  • Add the browser object. There are actions for that in it.

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