love.graphics.translate by whole numbers
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
love.graphics.translate by whole numbers
I'm having a problem with moving the camera in my game. Every update, I'm setting the camera's position to the player's. However, since the player's position is a decimal number, there's noticeable screen tearing whenever the camera is moved. The problem is that if I use math.floor or math.ceil to round the camera's position, the player itself jitters around whenever the camera moves. How can I make sure the player doesn't jitter without causing screen tearing?
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: love.graphics.translate by whole numbers
I believe you can floor the player coords as well.
Re: love.graphics.translate by whole numbers
That works fine for the x axis, but rounding the player's y coordinate, at least to a whole number, is not an option.
Edit: Er, scratch that, turns out I can round the y coordinate if I put in some workarounds, but I'd still prefer if there was a way to do this without changing the player's coordinates.
Edit: Er, scratch that, turns out I can round the y coordinate if I put in some workarounds, but I'd still prefer if there was a way to do this without changing the player's coordinates.
- DaedalusYoung
- Party member
- Posts: 413
- Joined: Sun Jul 14, 2013 8:04 pm
Re: love.graphics.translate by whole numbers
Don't change the actual player's coordinates, just round them during draw.
Who is online
Users browsing this forum: Amazon [Bot], Bing [Bot], Google [Bot] and 9 guests