Page 1 of 1

Blurry canvas drawing

Posted: Tue Sep 25, 2018 4:11 pm
by GijsB
I'm again having some problems with canvases!

I have 2 situations which should(?) be identical :

1.

Code: Select all

function love.draw()
	love.graphics.printf("lol",0,0,100,"left")
end
2.

Code: Select all

function love.load()
	c1 = love.graphics.newCanvas(100,100)
	love.graphics.setCanvas(c1)
		love.graphics.printf("lol",0,0,100,"left")
	love.graphics.setCanvas()
end

function love.draw()
	love.graphics.draw(c1)
end
however case 2 the text is appears blurry even though i'm still drawing on integer coordinates...

Anyone know why?

Edit : added small example .love

Re: Blurry canvas drawing

Posted: Tue Sep 25, 2018 4:48 pm
by grump

Code: Select all

function love.draw()
	x = math.floor(math.sin(love.timer.getTime()*0.1)*100+100)
	love.graphics.setBlendMode('alpha', 'premultiplied')
	love.graphics.draw(c1,x,0)
	love.graphics.setBlendMode('alpha', 'alphamultiply')
	love.graphics.printf("this is a test sentence",x,20,200,"left")
end

Re: Blurry canvas drawing

Posted: Wed Sep 26, 2018 11:39 am
by GijsB
Thanks, it works!