Ugly outlines
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Ugly outlines
I have a problem, where my character animated with AnAL has strange and ugly outlines. What is causing them and how can i get rid of them?
- Attachments
-
- Indev 1.love
- (42.12 KiB) Downloaded 104 times
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: Ugly outlines
I once fixed something like this by messing around with [wiki]love.graphics.setDefaultFilter[/wiki], my problem was fixed by setting it to "nearest" but this doesn't seam to do it for you.
Try coding your own animation lib, I now that I had a problem with AnAL before and I ended up coding my own animations.
Try coding your own animation lib, I now that I had a problem with AnAL before and I ended up coding my own animations.
- Cucurbitacée
- Prole
- Posts: 47
- Joined: Fri Dec 14, 2012 10:22 am
- Location: Frankfurt am Main
Re: Ugly outlines
Hi,
This happened to me before, that's because you are drawing at x coordinate that is not an integer. Here is what I did to fix it:
Not sure if it's the right way to do it, though.
This happened to me before, that's because you are drawing at x coordinate that is not an integer. Here is what I did to fix it:
Code: Select all
function player.draw()
if love.keyboard.isDown('left') == false and love.keyboard.isDown('right') == false
and player.y == 528 and player.facingR then
player.idleRAnim:draw(math.floor(player.x), player.y)
elseif love.keyboard.isDown('left') == false and love.keyboard.isDown('right') == false
and player.y == 528 and player.facingR == false then
player.idleLAnim:draw(math.floor(player.x), player.y)
end
if love.keyboard.isDown('right') then
player.walkingRAnim:draw(math.floor(player.x), player.y)
elseif love.keyboard.isDown('left') and love.keyboard.isDown('right') == false then
player.walkingLAnim:draw(math.floor(player.x), player.y)
end
end
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: Ugly outlines
Yeah that can fix it too, just use math.floor() or math.ceil() on the coordinates.
Re: Ugly outlines
Cucurbitacée wrote:Hi,
This happened to me before, that's because you are drawing at x coordinate that is not an integer. Here is what I did to fix it:Not sure if it's the right way to do it, though.Code: Select all
function player.draw() if love.keyboard.isDown('left') == false and love.keyboard.isDown('right') == false and player.y == 528 and player.facingR then player.idleRAnim:draw(math.floor(player.x), player.y) elseif love.keyboard.isDown('left') == false and love.keyboard.isDown('right') == false and player.y == 528 and player.facingR == false then player.idleLAnim:draw(math.floor(player.x), player.y) end if love.keyboard.isDown('right') then player.walkingRAnim:draw(math.floor(player.x), player.y) elseif love.keyboard.isDown('left') and love.keyboard.isDown('right') == false then player.walkingLAnim:draw(math.floor(player.x), player.y) end end
Thanks guys. Seem that this solves the problem!Ranguna259 wrote:Yeah that can fix it too, just use math.floor() or math.ceil() on the coordinates.
Who is online
Users browsing this forum: Google [Bot] and 4 guests