How do I use something like this to zoom in/zoom out?

0 favourites
  • 10 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Could I use a script or something else to zoom in/zoom out the entire screen gradually? Thanks.

    <div class="toolbar" style="display: block; width: 940px; height: 50px;">
    <img id="zoomin" alt="zoomin" src="./media/toolbar_zoomin.svg" style="width: 30px; bottom: 0px; left: 0px; padding-top: 10px;">
    <img id="zoomout" alt="zoomout" src="./media/toolbar_zoomout.svg" style="width: 30px; bottom: 0px; left: 0px; padding-top: 10px;">
    </div>[/code:nqhsn06n]
  • You could create zoom in/out effect by repositioning and resizing objects in relation to how close they are to the centre of the screen. You could also use families to create 3d zoom parallax effects.

  • Hi hundredfold

    I just want to zoom (in/out) the entire screen without change the game assets. Something like browser>request fullscreen, but zooming gradually.

    And about the script? I cannot apply it or something like it on the page for this purpose?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi RenatoB

    kmsravindra just posted a thread about a brainstorming product he's developed with Construct 2.

    I just watched the YouTube video demo (it's only a couple of minutes long) and he's using a zoom in/out feature in there. If it's anything like what you're trying to achieve he may be able to help.

  • Could I use this script or something else to zoom in/zoom out the entire screen gradually? Thanks.

    <div class="toolbar" style="display: block; width: 940px; height: 50px;">
    <img id="zoomin" alt="zoomin" src="./media/toolbar_zoomin.svg" style="width: 30px; bottom: 0px; left: 0px; padding-top: 10px;">
    <img id="zoomout" alt="zoomout" src="./media/toolbar_zoomout.svg" style="width: 30px; bottom: 0px; left: 0px; padding-top: 10px;">
    </div>[/code:2dlsngrq]
    

    In C2,

    System>set canvas size

    or system>set layout scale would let you zoom the game (or change the window size, which effectively can be use to resize the game when fullscreen is set to off andzoom in some fullscreen modes).

  • hundredfold: Thanks for the link. I'll check it.

    Aphrodite: Thank you. I'm already trying something with the "canvas size". Thanks for the suggestion about "scale layout" too. A question: Could I use percentage with "canvas size"?

  • Anyone knows how to use percentage? I would like to increment/decrement values using percentage to zoom in/out the screen.

  • I tried:

    set canvas size to canvasW = canvasW*1.10 / canvasY = canvasY*1.10[/code:1z3e1fl9]
    
    But not worked like I need. The screen moves to the left when reduced.
  • You would have to store the value of the width and height corresponding to 100%

    Then you just set the width to the reference width * the percentage.

  • Aphrodite

    I did it, but only worked after I change the "Fullscreen in browser" option to "Off". Thanks anyway.

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