-
Notifications
You must be signed in to change notification settings - Fork 153
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
The way camera:attach is implemented makes supporting non-even dimension difficult #64
Comments
I actually prefer the way https://github.com/kikito/gamera/blob/master/gamera.lua#L100-L106 |
The problem is that hump.camera translates to a fractional position, which causes artifacts between the tiles, correct?
A quick and dirty solution would add a parameter to The "correct" way would be to add margins in the tile set, but as you said, that might not be practical. |
As far as I know STI uses |
Can you provide a .love that shows the issue so that I can have a look myself? |
Actually let me close this for now, I needed a visible viewport anyway so I switched to gamera. I don't think it's that necessary for hump.camera to support my use-case, while my project do fit into your 2 conditions (we don't scale map, we don't need smooth camera movement), I think it complicates your code quite a bit to support strict non-float position, so yeah if I ran into the issue again I will re-open this with an example .love file. |
Reopening this: defining a custom viewport when attaching the camera is straightforward to implement and should cover your use-case. Something along the lines of this: cam:attach(20, 10, 400, 400) -- x,y,width,height
foo()
cam:detach() |
very cool, I will check it out when available |
Most of the discussion is here: karai17/Simple-Tiled-Implementation#106
In short, given current implementation, we will always get non-integer translation when attaching camera on a game window with odd number as dimensions, and there is nothing we can do except to give gap between tiles (not really a great solution when you have hundreds of tilesets without margins)
https://github.com/vrld/hump/blob/master/camera.lua#L105-L112
The text was updated successfully, but these errors were encountered: