Ugly outlines

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
akopyl
Prole
Posts: 21
Joined: Fri Jun 27, 2014 1:20 pm

Ugly outlines

Post by akopyl »

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 99 times
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

Re: Ugly outlines

Post by Ranguna259 »

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.
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
User avatar
Cucurbitacée
Prole
Posts: 47
Joined: Fri Dec 14, 2012 10:22 am
Location: Frankfurt am Main

Re: Ugly outlines

Post by Cucurbitacée »

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:

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
Not sure if it's the right way to do it, though.
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

Re: Ugly outlines

Post by Ranguna259 »

Yeah that can fix it too, just use math.floor() or math.ceil() on the coordinates.
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
User avatar
akopyl
Prole
Posts: 21
Joined: Fri Jun 27, 2014 1:20 pm

Re: Ugly outlines

Post by akopyl »

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:

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
Not sure if it's the right way to do it, though.
Ranguna259 wrote:Yeah that can fix it too, just use math.floor() or math.ceil() on the coordinates.
Thanks guys. Seem that this solves the problem!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 152 guests