[r74] set angle with mirror

0 favourites
  • 10 posts
From the Asset Store
A whole set you need to create a gorgeous winter 2d game
  • test capx

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

    <img src="http://i1081.photobucket.com/albums/j352/rexrainbow1/screen1-17.png" border="0">

    Then I add "action:set mirror"

    <img src="http://i1081.photobucket.com/albums/j352/rexrainbow1/screen2-4.png" border="0">

    The angle maybe a little strange, I thought the angle will be -135 (or 225) in mirror case.

  • 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.

  • 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.

    Agree, I thought it were 225, too. But the result seems to be 135. The angle looks like mirror + flip.

  • 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.

  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Kyatric

    I agree the angle should not been changed, logically. But in render/display, it has been changed by a formula.

  • Ashley

    Kyatric

    Sorry, I understand, it's not a bug. just need to explain more detail.

  • 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)

  • Kyatric

    Thanks, I got it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)