How do I resolve this scale problem ?

Get help using Construct 2

Post » Tue Dec 08, 2015 10:00 am

Hello
I made a project where I created a routine to automatically scale and correctly reposition objects pined on another one when it is moved and scale.
Everything is ok except for the scale routine. On the included caps, use the two big ovales as buttons to scale up and down the ascending/descending group. You'll see that when you press scale up and then scale down, ther first 2/3 times you press scale down, the group still scales up. The same when you first scale down then scale up.
Any idea of the reason why it doesn't work as it should ?
https://www.dropbox.com/s/w6jcqmrt51dwo ... .capx?dl=0
B
38
S
16
G
5
Posts: 269
Reputation: 5,964

Post » Tue Dec 08, 2015 2:51 pm

The problem is that you didn't reset your scal-variable back to 1 when you change from up to down scaling.
If scale is 1.8 after upscaling und you try to scale down. The first time you multiply with 1.6, then 1.4 and so on.
It needs a few click that scale is 1 or below.

One solution could be that you use two variables upScale=1.1 , downScale=0.9 for up and down scaling.
B
24
S
3
G
1
Posts: 454
Reputation: 2,171

Post » Tue Dec 08, 2015 3:26 pm

Lovely ! Thanks, @Asmodean, that's exactly what I was looking for.
Instead of using variables, I reset scale to 1 after transformation has been applied
B
38
S
16
G
5
Posts: 269
Reputation: 5,964


Return to How do I....?

Who is online

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