How do I Zoom in & Zoom out button And Fullscreen

Get help using Construct 2

Post » Mon Mar 18, 2013 7:41 pm

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.
B
7
Posts: 9
Reputation: 735

Post » Mon Mar 18, 2013 7:43 pm

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...
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Mon Mar 18, 2013 8:05 pm

@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(........)
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Mon Mar 18, 2013 8:19 pm

Oh sorry , :D ...
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Mon Mar 18, 2013 8:32 pm

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
B
7
Posts: 9
Reputation: 735

Post » Mon Mar 18, 2013 8:58 pm

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.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Mon Mar 18, 2013 9:05 pm

To keep the buttons not changed from the layout scale, position them on a second layer and set its Scale rate property to 0.
B
11
S
3
G
3
Posts: 79
Reputation: 3,343

Post » Tue Mar 19, 2013 5:42 am

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.
B
7
Posts: 9
Reputation: 735

Post » Tue Mar 19, 2013 5:57 am

Add the browser object. There are actions for that in it.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 20 guests