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

Get help using Construct 2

Post » Sun Mar 01, 2015 6:18 pm

locohost wrote:@gamecorpstudio 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 :))
Last edited by gamecorpstudio on Sun Mar 01, 2015 6:22 pm, edited 1 time in total.
ImageImage
B
54
S
14
G
64
Posts: 1,251
Reputation: 39,468

Post » Sun Mar 01, 2015 6:22 pm

lennaert wrote::)

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.
B
13
S
4
Posts: 280
Reputation: 1,566

Post » Sun Mar 01, 2015 6:23 pm

locohost wrote:
lennaert wrote::)

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 )
You do not have the required permissions to view the files attached to this post.
Last edited by gamecorpstudio on Sun Mar 01, 2015 6:52 pm, edited 6 times in total.
ImageImage
B
54
S
14
G
64
Posts: 1,251
Reputation: 39,468

Post » Sun Mar 01, 2015 6:27 pm

locohost wrote:
lennaert wrote::)

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:
@gamecorpstudio
lol no worries
Who dares wins
B
50
S
10
G
10
Posts: 1,728
Reputation: 12,867

Post » Sun Mar 01, 2015 7:00 pm

Thank you, thank you, thank you, thank you for the fantastic help guys!!! :-)
B
13
S
4
Posts: 280
Reputation: 1,566

Post » Sun Mar 01, 2015 7:03 pm

locohost wrote:Thank you, thank you, thank you, thank you for the fantastic help guys!!! :-)



there is no need :D for thanks we do it cause its nice to help :) atleast from my point of view, if u have any other issues just make a how do i post :) cheers happy to help u :)
ImageImage
B
54
S
14
G
64
Posts: 1,251
Reputation: 39,468

Post » Sun Mar 01, 2015 7:19 pm

Here's a related idea: If I want to leave the HUD layer the same size (not scale), I'm thinking I can scale all the other layers equally and leave the HUD normal size.
B
13
S
4
Posts: 280
Reputation: 1,566

Post » Sun Mar 01, 2015 7:23 pm

Yup, I use that approach too.

If your moving objects between different scaled layers, keep in mind this can cause errors, the likes of "drawing instance on wrong layer" ones.
Who dares wins
B
50
S
10
G
10
Posts: 1,728
Reputation: 12,867

Post » Sun Mar 01, 2015 7:36 pm

lennaert wrote:Yup, I use that approach too.

If your moving objects between different scaled layers, keep in mind this can cause errors, the likes of "drawing instance on wrong layer" ones.


The only layer that isn't scaling is the HUD. It's working! :-)
Last edited by locohost on Sun Mar 01, 2015 7:48 pm, edited 1 time in total.
B
13
S
4
Posts: 280
Reputation: 1,566

Post » Sun Mar 01, 2015 7:37 pm

Oh, forgot to mention, I'm using the mouse scroll wheel to scale up and down in desktop browser. Working well :-)
B
13
S
4
Posts: 280
Reputation: 1,566

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: DannyBil, Taluigi and 32 guests