Something similar to 'setFilter' using push library

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
buby1
Prole
Posts: 2
Joined: Thu Aug 05, 2021 11:53 pm

Something similar to 'setFilter' using push library

Post by buby1 »

Am currently making my first game right now. I wanted to scale up my game because I am using pixel graphics, and the window is quite small when it's 256 x 256. I know when using

Code: Select all

love.graphics.scale()
to scale your game you can use something like

Code: Select all

sprites.player:setFilter('nearest', 'nearest')
in order to make the image not blurry when upscaled. However, I was just wondering if there was a way to make images upscale without being blurry using the push library.https://github.com/Ulydev/push Currently, my push code looks like this:

Code: Select all

push = require 'libraries/push/push'
push:setupScreen(256, 256, 768, 768, {fullscreen = false})

function love.draw()
	push:start()
		--draw character
	push:finish()
end
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Something similar to 'setFilter' using push library

Post by ReFreezed »

The push library doesn't seem to change the filtering for any images. Just call setFilter() on images when you load them as usual, or call love.graphics.setDefaultFilter("nearest","nearest") before loading any images.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
buby1
Prole
Posts: 2
Joined: Thu Aug 05, 2021 11:53 pm

Re: Something similar to 'setFilter' using push library

Post by buby1 »

Thank you. For some reason using setFilter() didn't work for me with push, but setting the default filter at the top of my program worked.
User avatar
pgimeno
Party member
Posts: 3656
Joined: Sun Oct 18, 2015 2:58 pm

Re: Something similar to 'setFilter' using push library

Post by pgimeno »

Push uses a canvas internally. You'd have to set that canvas' filter to make it work without setDefaultFilter.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 5 guests