Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

me.Entity anchorPoint is really messed up #754

Closed
parasyte opened this issue Oct 3, 2015 · 11 comments
Closed

me.Entity anchorPoint is really messed up #754

parasyte opened this issue Oct 3, 2015 · 11 comments
Assignees
Labels
Milestone

Comments

@parasyte
Copy link
Collaborator

parasyte commented Oct 3, 2015

This is probably a regression from #716...

The spikes on the ceiling use

  • anchorPoint = {"x" : 0.5, "y" : 1}
  • anchorPoint = {"x" : 0.5, "y" : 0.75}
  • anchorPoint = {"x" : 0.5, "y" : 0.5}.

Uhhh? I don't get it.

screen shot 2015-10-03 at 12 15 37 am

@obiot
Copy link
Member

obiot commented Oct 3, 2015

just saw it happening live, and I also thought : wtf... !

@obiot
Copy link
Member

obiot commented Oct 7, 2015

what kind of object do you use for the spike, the "stock" me.Entity one as in the other platformer level ? because it looks like it's working in map1, but not in yours ?

@parasyte
Copy link
Collaborator Author

parasyte commented Oct 7, 2015

Same object, yes. The difference is this one uses the vertical flipping feature in Tiled. It's really hard to aline it in this mode. To make matters worse, the green box (from debug panel) is positioned opposite the sprite. :(

@obiot obiot modified the milestones: 3.1.0, 3.0.0 Oct 27, 2015
@agmcleod agmcleod self-assigned this Dec 8, 2015
@agmcleod
Copy link
Collaborator

agmcleod commented Dec 8, 2015

Might take a look at this tonight.

@agmcleod
Copy link
Collaborator

So im not sure this is a bug. I think this is a discrepancy between how its displayed in tiled because of its coordinate system, and how are are aligning an anchor point relevant to its coordinate. Playing with the position of the tile, and the anchor point. It tends to work as i expect it. The position of it in tiled is still top left relevant. Ours by default now is in the middle, with the anchor point set to 0.5 0.5

@obiot
Copy link
Member

obiot commented Dec 19, 2015

so is it not maybe just an initialisation "issue" for tiled object ? (that should be forced to an anchor point of [0,0] to match with Tiled)

@obiot
Copy link
Member

obiot commented Dec 19, 2015

forget my last comment, stupid remark :)

@parasyte
Copy link
Collaborator Author

@obiot 😖 Ok, I was confused momentarily. Actually trying to use anchorPoint with flipped tiles is not at all friendly.

@parasyte
Copy link
Collaborator Author

@agmcleod Disregarding how Tiled displays the map, the anchorPoint setting in melonJS still does not make sense (at least when the tile is flipped/rotated). The image ends up completely outside of the shape when anchored to the extremes (0, or 1)... That's completely unexpected.

@Giwayume
Copy link
Contributor

The image ends up completely outside of the shape when anchored to the extremes (0, or 1)... That's completely unexpected.

This looks like it's addressed in #756?

Maybe to get it working sensibly in tiled, what if melonJS internally flips the provided anchor point when the "flip horizontally" or "flip vertically" settings are used in tiled?

@obiot
Copy link
Member

obiot commented Jul 22, 2020

see #1008

@obiot obiot closed this as completed Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants