Closed Andrek25 closed 2 years ago
The tile engine uses the camera position to clip the tile map image. Firefox and Safari had bugs where if the clip size was not within the images region, it wouldn't draw it. So depending on the size of your canvas the camera won't move if it's the same size or bigger than the tile map (579 px).
This is different than how the camera works for something like a Scene (where the camera is used as an offset to drawing), so I might need to better consolidate the two.
Oh sorry, i didn't explain my problem correctly.
My problem is that when i rotate a Sprite over its center point using anchor: {x: 0.5, y: 0.5}
it works perfectly but when i use tileEngine.sy = 50
to move the camera the center points is changed and the sprite start to rotate around other point(like the earth around the sun).
Ah, I see the problem now. That is indeed a bug, more with the order of rendering than the tile engine as just setting sprite.sy = 50
has the same problem.
You'll solve it before JS13k ends or is there a fast solution for this?
I'm not sure there is a fast solution to this one, which also means I'm not sure if I can get a fix out in less than a week. The main problem is competing concepts of the camera. To maintain the rotation/anchor I'd have to move the camera before rotating, but that means all camera sx/sy are fixed to the x/y axis and cannot be affected by rotation. I have to think about if that's how it should be or not.
You're right this need a while, take all the time you need :)
Edit: Sorry for the missclick haha.
I'm trying to rotate the Sprite in the center and works fine but when i use
tileEngine.sy = 50
it does not work correctly. This is a example code: