[r74] set angle with mirror

Bugs will be moved here once resolved.

Post » Wed Jan 04, 2012 10:14 am

test capx

There has a sprite with angle = -45 (or 315)


Then I add "action:set mirror"


The angle maybe a little strange, I thought the angle will be -135 (or 225) in mirror case.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Wed Jan 04, 2012 1:41 pm

I think its working as it should.
Mirror would scale the image to its width in negative, then flip would scale it to its height in negative.
Keep in mind that's the image, not the angle, so if you were to make an image with the arrow pointing to -45, and then mirrored it, it would appear as if it were 225.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Wed Jan 04, 2012 3:12 pm

@newt

[QUOTE=newt]if you were to make an image with the arrow pointing to -45, and then mirrored it, it would appear as if it were 225.[/QUOTE]

Agree, I thought it were 225, too. But the result seems to be 135. The angle looks like mirror + flip.rexrainbow2012-01-04 15:16:24
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Wed Jan 04, 2012 3:16 pm

It's working by design - only the image flips, and the angle is not affected. To get it working like you say 'set mirrored' would have to affect the object angle, and it never does/should.

Another way of looking at it is the axis that is mirrored across also rotates with the object.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed Jan 04, 2012 4:00 pm

@Ashley

What's the formula of angle after mirror?
If the sprite is 0 degree, it will be 180 degree after mirror (just look like) , so the angle has been changed. The angle 0 will become 180.rexrainbow2012-01-04 16:06:47
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Wed Jan 04, 2012 4:17 pm

@rexrainbow: The angle isn't touched, only the texture/collision polygon is mirrored.
The actual object itself isn't changed.
If 0 before mirroring, the angle stays 0 after mirroring.Kyatric2012-01-04 16:18:11
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Wed Jan 04, 2012 4:22 pm

@Kyatric

I agree the angle should not been changed, logically. But in render/display, it has been changed by a formula. rexrainbow2012-01-04 16:26:50
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Wed Jan 04, 2012 4:35 pm

@Ashley
@Kyatric

Sorry, I understand, it's not a bug. just need to explain more detail.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Wed Jan 04, 2012 4:37 pm

I'm not sure to follow.
Well in render, when mirroring, you change the orientation of the texture, but not of the sprite object itself.

So the texture's angle could be considered to changed (0->180 as you said), but anyway in events, you don't have control over the texture, but the sprite object. The object by itself on a mirroring isn't changed, its angle still is 0, even if its texture is 180.

I hope you see what I mean, and if I'm not misinterpreting what's happening in C2.

Edit: @rexrainbow your last message was written as I was writting this one. This one was an answer to the previous post about a formula.

If you still need clarifications, be sure to ask.
I also hope my previous assertion is correct (Texture =! Sprite object)Kyatric2012-01-04 16:41:11
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Wed Jan 04, 2012 4:42 pm

@Kyatric

Thanks, I got it.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Next

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests