Question. I heard mention of nearest neighbor scaling in 0.6.x, but cannot get it to work how I thought it would. I had thought image:setFilter(1,1) would allow me to scale an image without antialiasing. i.e. each pixel would scale up roughly and solidly. For instance:
The left would be enormously useful to me. The right is what I get when I try. Does it not exist in Löve? Was I mistaken?
LÖVE 0.6.1
Re: LÖVE 0.6.1
What isn't working for you? According to the wiki, image:setFilter is the way to go.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: LÖVE 0.6.1
Hmm. It works when I use draw, but not when I use quads. Does it not work with quads?
If I do draw then it works. But if I do drawq it uses the default antialised mode. Also, I can't use it with fonts, can I? I wish there was a way to set it globally instead of every image individually.
If I do draw then it works. But if I do drawq it uses the default antialised mode. Also, I can't use it with fonts, can I? I wish there was a way to set it globally instead of every image individually.
Re: LÖVE 0.6.1
Jasoco wrote:I wish there was a way to set it globally instead of every image individually.
Code: Select all
do
local nuimg = love.graphics.newImage
function love.graphics.newImage(...)
local i = nuimg(...)
i:setFilter(1,1)
return i
end
end
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: LÖVE 0.6.1
But does it work on Quads and imageFonts?
Re: LÖVE 0.6.1
I guess not.Jasoco wrote:But does it work on Quads and imageFonts?
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: LÖVE 0.6.1
Should work just fine with quads.
- Attachments
-
- quad.love
- (859 Bytes) Downloaded 152 times
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: LÖVE 0.6.1
Looks like it does. I'll examine the code and see where I was going wrong.
Thanks
Thanks
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: LÖVE 0.6.1
Heh. Well this is interesting. Rude, you'll want to look at this.
In my other thread, the one asking for help converting my game to 0.6.1 rude gave me an updated version of 0.6.1 that fixed the rectangles and font clipping. (I'll call it 0.6.1b) But before I downloaded that, Technocat gave me the above "quad.love" file. Which worked in 0.6.1. But now I try loading it in the new updated 0.6.1 and it crashes (Blue screen) when I try to switch to nearest neighbor. But it works fine in the release 0.6.1.
main.lua:92: Invalid filter mode: 1
[C] In function 'setFilter'
That's what I get when loading "quad.love" with 0.1.6b and press c to change modes. But it works fine in 0.6.1. I guess something changed.
In my other thread, the one asking for help converting my game to 0.6.1 rude gave me an updated version of 0.6.1 that fixed the rectangles and font clipping. (I'll call it 0.6.1b) But before I downloaded that, Technocat gave me the above "quad.love" file. Which worked in 0.6.1. But now I try loading it in the new updated 0.6.1 and it crashes (Blue screen) when I try to switch to nearest neighbor. But it works fine in the release 0.6.1.
main.lua:92: Invalid filter mode: 1
[C] In function 'setFilter'
That's what I get when loading "quad.love" with 0.1.6b and press c to change modes. But it works fine in 0.6.1. I guess something changed.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: LÖVE 0.6.1
0.6.2 uses string constants for setFilter now. They are now "nearest" and "linear".Jasoco wrote: main.lua:92: Invalid filter mode: 1
[C] In function 'setFilter'
http://love.hg.sourceforge.net/hgweb/lo ... ges.txt#l8
http://love.hg.sourceforge.net/hgweb/lo ... ge.cpp#l53
Last edited by TechnoCat on Thu Mar 04, 2010 5:35 am, edited 2 times in total.
Who is online
Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 4 guests