[suggestion] compare scale

Discussion and feedback on Construct 2

Post » Thu Jan 30, 2014 9:06 pm

That will be handy compare scale of spritedelgado2014-01-30 21:08:33
B
113
S
28
G
48
Posts: 1,882
Reputation: 36,478

Post » Fri Jan 31, 2014 1:25 am

Sounds like a good suggestion. I just looked again, and I'm surprised that this feature isn't already in there.

With the great OOP (Object-Oriented Programming) in Construct 2, I wouldn't be surprised if @Ashley had this implemented within the next few releases.
B
20
S
4
G
1
Posts: 185
Reputation: 2,563

Post » Fri Jan 31, 2014 1:37 am

I remember someone asking about this a while ago, and the answer was something like 'scale of height and width can be different, so it wouldn't work'. I agree it would be nice to have an expression for height and width scales, but you can already do this easy enough with the imageHieght/Width expressions.
B
28
S
8
G
5
Posts: 429
Reputation: 7,007

Post » Fri Jan 31, 2014 12:46 pm

Yeah, it's the same reason there's no 'scale' expression. If an object is twice as wide and half as tall, what's its scale?
Scirra Founder
B
402
S
238
G
89
Posts: 24,628
Reputation: 196,023

Post » Fri Jan 31, 2014 2:04 pm

@Ashley its Simple to calculate sprite size 1241x 452pix half or twice of this value

Now i use sprite.width +1
and
sprite.heiht+1

Imagine about how much need to add pixels to this sprite of size
when i want to object decreased or increased equally?

for example that expression solve this problem sprite.scale -/+0.1 that will be nice and fast as hell

PS: its hard to me to explain because my english is not wery well but my sugestions is come from my experience with C2. I am a consumer and i know my needs and i know what i need when i work on c2. I try to help you improve c2delgado2014-01-31 14:16:24
B
113
S
28
G
48
Posts: 1,882
Reputation: 36,478

Post » Fri Jan 31, 2014 4:35 pm

@Ashley I've seen this get asked a lot, it doesn't really affect me so much personally but I think I'm aware as to why it's popping up a lot:


If an object is twice as wide and half as tall, what's its scale?

If you have an Sprite that has an imagewidth and imageheight of [32,32], and you then use "Set Size" or "Set Height/Width" actions so that the sprite is now "64,16", then that would mean the scale is still at 1.
So continuing from the example, you're 32x32 sprite is now 64,16 via "Set Size", if you were to set Scale to 2, I think people would expect the size to go to "128,32", rather than the Scale action reading from the image data and setting its dimensions to "64,64" (which it currently would do).
This leads me to believe the way that "Set Scale" is implemented is simply doing a formula, reading from the ImageWidth/ImageHeight (and NOT the sprite.width/sprite.height), therefore "Set Scale" is more of a quick formula action, rather than a built-in variable that is storing the Scale value. If this is correct, then I think that's why people are confused at the lack of retrieving a Scale value, because you simply didn't design it that way :P
Again, workaround is easy but yes. Hope I was of use!
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Fri Jan 31, 2014 4:47 pm

Perhaps a tutorial on how to do percentages would be a better idea?
Image ImageImage
B
172
S
50
G
182
Posts: 8,435
Reputation: 115,089

Post » Fri Jan 31, 2014 5:11 pm

I think it's simply incorrect to return a scale of 1 for an object that is twice as wide and half as tall. Returning a scale of 1 would imply the object is at 1:1 scale.
Scirra Founder
B
402
S
238
G
89
Posts: 24,628
Reputation: 196,023

Post » Fri Jan 31, 2014 9:51 pm

I have to agree with @Ashley that getting a scale of sprite just would work. however getting a 0-1 percentage of W/H from the original image size would be another matter.

So what you can do for that at least is
%W = Self.width / self.ImageWidth
&H = Self.Height / self.ImageHeight
B
92
S
18
G
9
Posts: 2,455
Reputation: 15,113

Post » Fri Jan 31, 2014 10:33 pm

[[email protected]] Yeah, it's the same reason there's no 'scale' expression. If an object is twice as wide and half as tall, what's its scale?[/QUOTE]

How about not showing/applying such option if current WxH aspect ratio is different from original aspect ratio ?

lennaert2014-01-31 22:34:21
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests