Page 1 of 1

The style in which scaled images are rendered; how do I make them "rough" instead of "smooth?"

Posted: Mon Mar 20, 2017 5:48 pm
by sanjiv
I've used love.graphics.draw in order to draw an image with sx and sy > 1, but the image looks fuzzy. How do I make it not look fuzzy?

I thought it'd be something like love.graphics.setLineStyle( 'rough' ), but that's not working for me.

If you want to look inside the love file, the file to look at would be
scene > 0 > draw megaman
line 35.

The relevant code would be

Code: Select all

		love.graphics.draw(
			img,
			quadTable[qy][qx],
			o.x,o.y,
			o.r, --r?
			o.sx*a, --sx?
			o.sy, --sy?
			o.ox+o.w/o.sx/2-turn_adjustment/o.sx,--ox
			o.oy+o.h/o.sy/2--oy
			)

Re: The style in which scaled images are rendered; how do I make them "rough" instead of "smooth?"

Posted: Mon Mar 20, 2017 6:26 pm
by Tjakka5
Either use (Image):setFilter or love.graphics.setDefaultFilter as ('nearest', 'nearest').

Re: The style in which scaled images are rendered; how do I make them "rough" instead of "smooth?"

Posted: Mon Mar 20, 2017 8:26 pm
by sanjiv
works great! I set it right after I created a newImage, like so

Code: Select all

	s.img[1] = lg.newImage('megaman/sprite sheets/classicMegaManSprites.png')
	s.img[1]:setFilter( "nearest", "nearest" )