Closed zbrongyaozb closed 1 year ago
Correct me when I am wrong. It looks like when the player reaches the border of the map, you are creating a new tilemap with a new layer and you give the layer a pixel offset, so it is rendered left of the previous map.
I think that pixel offset is what causes the problem. Grid engine does not take layer pixel offsets into account. It could, but then there are problems to solve: What if several tile layers that belong to the same char layer have different offsets? Which one should propagate to the character then?
So GridEngine at the moment leaves the offset up to the user. That being said, it should not be a big issue in your case. Just use the offsetX
and offsetY
properties when recreating GridEngine:
https://annoraaq.github.io/grid-engine/api/interfaces/CharacterData.html#offsetX
LMK if this helps.
Thank you so much, this is helpful for me
Hello everyone. I am currently trying to dynamically create and load a tilemap, and I have succeeded in doing so. However, I am unsure how to make the player move from the old map to the new map. I have looked through issue #281, but I have not found a solution.
Here is a small demo. When the player moves to the left edge, I add a new map and then call GridEngine.create(...) again. However, the player does not appear on the new map, but instead appears on the right edge of the current map.