[Solved] Need an idea of how to scale to show full screen

0 favourites
From the Asset Store
A small template showing how to build a firebase ranking
  • I have a big detailed isometric game board layout. It's literally 3x the normal 1920 x 1080 viewport. It's 5760 x 3240. You can scroll around while playing to see all the areas on the game board.

    What I'd like to do is provide a HUD button you can click to momentarily re-scale the big layout so it's fully visible within the 1920 x 1080 viewport. I'm sure this is possible but it's not coming to me quickly.

    Is there a simple way to do this?

  • Have you tried using the browser object to set to "scale inner" ?

  • I have. It doesn't do anything that I can see. Screen looks same.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Looks like you have to set Window size to the full game board size of 5760 x 3240. Haven't tried this yet while the game is running, on button click. Will try now...

  • Ok this works...

    [attachment=0:1fmy47sf][/attachment:1fmy47sf]

  • You shouldn't have to set the window size to the layout size, and I wouldn't recommend doing that. Try setting the layout scale -- since your layout is three times bigger than the view port, a scale value of 0.3333 should make the whole layout visible.

  • You shouldn't have to set the window size to the layout size, and I wouldn't recommend doing that. Try setting the layout scale -- since your layout is three times bigger than the view port, a scale value of 0.3333 should make the whole layout visible.

    That works too. Thanks Why do you "not recommend" setting canvas size?

  • zoom out

    set layoutscale = lerp(layoutscale, (viewportRight("hud") / layoutwidth), 0.5*dt)

    zoom back in

    set layoutscale = lerp(layoutscale, 1, 0.5*dt)

  • You shouldn't have to set the window size to the layout size, and I wouldn't recommend doing that. Try setting the layout scale -- since your layout is three times bigger than the view port, a scale value of 0.3333 should make the whole layout visible.

    that is so wrong in so many cases

    For the poster locohost :

    that depends on the layout size, but usually if ur designing ur game in a 800x600 or 1280x960 u can resize it to the layout size.... if ur layout size is bigger then the one i said that will be landscape 12:9 then u need to use the scroll to behavior so the screen size follows the player in the big layout(as a platformer will have)

    if u don't want that u could use yes the the layout zoom but who uses that? unless its looking for big pixelated graphics, the man just wanted to fit layout to screen.....

  • yes I have screen scroll control setup. That part works fine. I just want a way for the player to temporarily see the entire game board whenever they want.

  • yes I have screen scroll control setup. That part works fine. I just want a way for the player to temporarily see the entire game board whenever they want.

    yes for a zoom in zoom out then you should do the way people said above, scale layout and should have some info for values what means 0 original ,1 double, 2 etc works with 0.5 for zooming out also or less values

    im guessing what the moderator was saying about not recommending, is because u said u have a very large area, if you'd fit the size of screen to the layout, when u export for mobile the game items will be so small that you barely can view them, because will try fit all that big screen on a smaller display.

    hope no1 took it as a offense on my reply's )

  • :)

    zoom out

    set layoutscale = lerp(layoutscale, (viewportRight("hud") / layoutwidth), 0.5*dt)

    zoom back in

    set layoutscale = lerp(layoutscale, 1, 0.5*dt)

    lennaert: Tried this. You have keep clicking the zoom button over and over and over. Needs to be in a loop I guess.

  • > :)

    >

    > zoom out

    > set layoutscale = lerp(layoutscale, (viewportRight("hud") / layoutwidth), 0.5*dt)

    >

    > zoom back in

    > set layoutscale = lerp(layoutscale, 1, 0.5*dt)

    >

    Tried this. You have keep clicking the zoom button over and over and over. Needs to be in a loop I guess.

    you can trigger it instead off when is clicked, to when is pressed, or left button down or is in touch on object. then will zoom continuously as long u keep ur touch or mouse pressed on it

    i added the capx with the math from lennaert on touch and positioned the zoom in zoom out buttons for u u can easy duplicate it in your game

    you dot need booleans for it sorry for misspelling your name lennaert

    however you have to move the buttons on a different layer so your buttons Don't get bigger when u zoom in, use them on a top layer and do a condition of zooming only that specific layer of your game layout(default will be 0 )

  • > :)

    >

    > zoom out

    > set layoutscale = lerp(layoutscale, (viewportRight("hud") / layoutwidth), 0.5*dt)

    >

    > zoom back in

    > set layoutscale = lerp(layoutscale, 1, 0.5*dt)

    >

    lennaert: Tried this. You have keep clicking the zoom button over and over and over. Needs to be in a loop I guess.

    make a boolean somewhere boolean zoom, toggle it with your button

    event

    every tick

    sub

    zoom.active = true

    layoutscale > 0.37

    action

    set layoutscale = lerp(layoutscale, (viewportRight("hud") / layoutwidth), 0.5*dt)

    sub

    zoom.active=false

    sub

    layoutscale < 0.97

    action

    set layoutscale = lerp(layoutscale, 1, 0.5*dt)

    else

    action

    layoutscale = 1

    something along those lines

    the checks are to prevent the tiny itty bitty zooming

    edit:

    lol no worries

  • Thank you, thank you, thank you, thank you for the fantastic help guys!!!

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