transform not applied properly to base me.Sprite objects #854

Closed
obiot opened this Issue Jan 4, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@obiot
Member

obiot commented Jan 4, 2017

see here :
http://www.html5gamedevs.com/topic/27137-flipx/

current workaround is to manually enable autoTransform in the me.Sprite constructor :

this.autoTransform = true;

@obiot obiot added this to the 4.1.0 milestone Jan 4, 2017

obiot added a commit that referenced this issue Jan 12, 2017

[#854] use the proper renderable bounds
also set the viewport anchorPoint to [0,0] for now, as it matches the
previous behaviour

@obiot obiot modified the milestones: 5.0.0, 4.1.0 Jan 18, 2017

obiot added a commit that referenced this issue Jan 19, 2017

[#854] some further fix (see description)
- panel position, and bounding box drawing (now that "preDraw" functions
are already translating to the correct coordinates, we don't need to do
it again in the debugPanel)
- entity position, but this is still wrong in some cases, probably
because anchorPoint are not set or set somewhere else (Tiled vs the
world). Also entity in Tild use (0, 0), but Tile Object use (0,
tileheight).

obiot added a commit that referenced this issue Jan 20, 2017

obiot added a commit that referenced this issue Jan 27, 2017

obiot referenced this issue Feb 21, 2017

[#864] fix container anchor point in all impacted examples
since now container position are also 0.5, 0.5 by default (as it’s a
renderable object), and since these examples were relying on a 0,0
anchor point / position
@obiot

This comment has been minimized.

Show comment
Hide comment
@obiot

obiot Feb 27, 2017

Member

@parasyte @agmcleod

quick question before I merge my branch :

now transform are automatically applied to any renderables (which fixes the issue here), but that also means that anchor point are now truly (0.5, 0.5) by default for any renderable as well, which kind of changes a few things here and there. For example anchor point was never applied for container before (it's still not the case though systematically, as when loading a "Tiled" game, level, container and entity objects anchor points are set to the tiled default one).

so question, shall I :

    1. keep it this way and merge it into the 4.1.0 branch, as after the "behavior" changes is actually the way it should have been (part of the fix)
    1. turn back off the flag (2725cfe) for me.Renderable, but keep it "starting" from me.Sprite object so that we both fix this issue and keep the previous (wrong) behavior.
Member

obiot commented Feb 27, 2017

@parasyte @agmcleod

quick question before I merge my branch :

now transform are automatically applied to any renderables (which fixes the issue here), but that also means that anchor point are now truly (0.5, 0.5) by default for any renderable as well, which kind of changes a few things here and there. For example anchor point was never applied for container before (it's still not the case though systematically, as when loading a "Tiled" game, level, container and entity objects anchor points are set to the tiled default one).

so question, shall I :

    1. keep it this way and merge it into the 4.1.0 branch, as after the "behavior" changes is actually the way it should have been (part of the fix)
    1. turn back off the flag (2725cfe) for me.Renderable, but keep it "starting" from me.Sprite object so that we both fix this issue and keep the previous (wrong) behavior.
@obiot

This comment has been minimized.

Show comment
Hide comment
@obiot

obiot Feb 27, 2017

Member

or option 3 : release 4.1.1 as it is now, and merge this one into the next 5.0.0 branch with all the other anchor and bounds fix (I would even remove the actual autoTransform flag, it's actually not really useful)

Member

obiot commented Feb 27, 2017

or option 3 : release 4.1.1 as it is now, and merge this one into the next 5.0.0 branch with all the other anchor and bounds fix (I would even remove the actual autoTransform flag, it's actually not really useful)

@obiot

This comment has been minimized.

Show comment
Hide comment
@obiot

obiot Feb 28, 2017

Member

well so I'll go for option 3 actually and will release the 4.1.1 as it, then merge my stuff into a 5.0.0 branch

Member

obiot commented Feb 28, 2017

well so I'll go for option 3 actually and will release the 4.1.1 as it, then merge my stuff into a 5.0.0 branch

@obiot obiot closed this Feb 28, 2017

@parasyte

This comment has been minimized.

Show comment
Hide comment
@parasyte

parasyte Feb 28, 2017

Member

👍

Member

parasyte commented Feb 28, 2017

👍

obiot added a commit that referenced this issue Nov 20, 2017

[#854] fix a regression with ImageLayer
- anchor points was "added" 2x times through the pre-draw function.
- small optimization and the translation back here is not necessary anymore (context is restored anyway in the postDraw function)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment