Hello everyone,
I have been experiencing an issue when using hump.camera with STI. When the camera moves, sometimes some black stripes appear and disapear quickly on the screen (I think they correspond to the delimitations of the tiled map in Tiled). I have no idea what may be causing that.
Attached is love file of the game, you may need to move around a bit before expriencing the bug. I have had this problem on 2 computers, so I don't think hardware is the problem. You essentialy want to look at the game.lua and map.lua, that's where the main logic operates.
Thank you for any help ! Have a good day
[SOLVED] Black stripes from Tiled grid visible with camera
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
[SOLVED] Black stripes from Tiled grid visible with camera
- Attachments
-
- Problem_Tiled.love
- (354.75 KiB) Downloaded 142 times
Last edited by Kymiko on Sun Jun 05, 2016 3:11 am, edited 2 times in total.
Re: Black stripes from Tiled grid visible with camera
For the looks of it, it seems you're running into this problem: https://bitbucket.org/rude/love/issues/ ... ing-images
I'm not yet sure if it's a LÖVE bug or a GL bug, or whether it's fixable at all.
I'm not yet sure if it's a LÖVE bug or a GL bug, or whether it's fixable at all.
Re: Black stripes from Tiled grid visible with camera
Try math.floor'ing the camera coordinates before translating. There's other solutions with transparent borders between tiles in the tilemap, you should be able to find threads about it as it's a pretty common issue.
Re: Black stripes from Tiled grid visible with camera
math.floor the camera coordinates made it, thank you very much, pretty simple in the end !
-
- Prole
- Posts: 14
- Joined: Thu Mar 16, 2017 1:53 am
Re: [SOLVED] Black stripes from Tiled grid visible with camera
Hey! So I ended up math.floor'ing my coordinates and it worked fine, but once I enter in a zoom level for hump.camera these black lines are reintroduced. Two questions I have here, do you know why the zoom might be causing issues still even with the coordinates rounded? Then secondly, why does math.floor'ing the x, y coordinates work in the first place when my x, y coordinates are always integers anyways? Thank you for checking this out I appreciate it!
- Jasoco
- Inner party member
- Posts: 3725
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: [SOLVED] Black stripes from Tiled grid visible with camera
Because the scaling is still decimal. You need to pad your tiles with extra repeated pixels at the edges to hide it.
Or not allow for decimal (Non-whole number) scaling.
Or do extra work and always draw to a large canvas at 1x scale and scale that instead.
Or not allow for decimal (Non-whole number) scaling.
Or do extra work and always draw to a large canvas at 1x scale and scale that instead.
Who is online
Users browsing this forum: No registered users and 51 guests