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

isometric object layer block image ordering #1011

Open
createmain opened this issue Aug 25, 2020 · 4 comments
Open

isometric object layer block image ordering #1011

createmain opened this issue Aug 25, 2020 · 4 comments
Labels

Comments

@createmain
Copy link

createmain commented Aug 25, 2020

If you are submitting a bug report, please respect the below template :

OS platform / Browser

Windows 10 / Chrome

melonJS version

7.1.1

Bug description

isometric object layer block image ordering

Steps to reproduce the bug

execute isometric example

Console log Extract

n/a

image

I tried to add buildings. but the example has layer control approach. So When I move player to back position of the layer object, the player is on the front of the building image.

I think the building object should be object and it should have fixed z-order and the player's z-order should be update along the player's position.
how can I make it?

Thanks alot.

@obiot
Copy link
Member

obiot commented Aug 26, 2020

did we s***** up with he isometric example ? anyway using me.game.world.sortOn = "y" should help with the sorting for the isometric example, I cannot run it right now, but I see that it seems to be missing.

@obiot
Copy link
Member

obiot commented Aug 26, 2020

ok, so I know what you mean now, and this is actually normal with this example. The issue is the tile used where the rocks here are only made of 2 tile and does not really work so well for this isometric example (maybe grid size should be smaller, or some of the tiles are too big).

it's really something too look at using tiled to better understand what I mean, but in the screenshot here below, you can see the actual tile and collision set in Tiled :
Screenshot 2020-08-26 at 4 13 59 PM

and if you look at the next one where I just hid the back layer you can see that part of the other layer is overlapping exactly where you can see the player sprite going through it.
Screenshot 2020-08-26 at 4 14 07 PM

trees are working just fine though because there is not such an overall.

hope this helps ! nevertheless the sortOn option is still one to keep in mind !

@createmain
Copy link
Author

here is tile sample.
image

this is execution result.
image

here is problem.
image

sortOn option didn't work to me.

@createmain
Copy link
Author

createmain commented Aug 26, 2020

image

I think like this.
each building should have own z-index along vertical position. So when the player move, it should check vertical position and update z-index. Then it will work well.

@obiot obiot added the Bug label Aug 16, 2021
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

2 participants