General discussion about LÖVE, Lua, game development, puns, and unicorns.
-
Jasoco
- Inner party member
- Posts: 3655
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
-
Contact:
Post
by Jasoco » Wed Mar 03, 2010 3:44 am
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?
-
thelinx
- The Strongest
- Posts: 848
- Joined: Fri Sep 26, 2008 3:56 pm
- Location: Sweden
Post
by thelinx » Wed Mar 03, 2010 4:50 am
What isn't working for you? According to
the wiki, image:setFilter is the way to go.
-
Jasoco
- Inner party member
- Posts: 3655
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
-
Contact:
Post
by Jasoco » Wed Mar 03, 2010 5:07 am
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.
-
thelinx
- The Strongest
- Posts: 848
- Joined: Fri Sep 26, 2008 3:56 pm
- Location: Sweden
Post
by thelinx » Wed Mar 03, 2010 6:13 am
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: 3655
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
-
Contact:
Post
by Jasoco » Wed Mar 03, 2010 6:17 am
But does it work on Quads and imageFonts?
-
thelinx
- The Strongest
- Posts: 848
- Joined: Fri Sep 26, 2008 3:56 pm
- Location: Sweden
Post
by thelinx » Wed Mar 03, 2010 6:37 am
Jasoco wrote:But does it work on Quads and imageFonts?
I guess not.
-
TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Denver, CO
-
Contact:
Post
by TechnoCat » Wed Mar 03, 2010 2:52 pm
Should work just fine with quads.
-
Attachments
-
quad.love
- (859 Bytes) Downloaded 101 times
-
Jasoco
- Inner party member
- Posts: 3655
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
-
Contact:
Post
by Jasoco » Thu Mar 04, 2010 1:57 am
Looks like it does. I'll examine the code and see where I was going wrong.
Thanks
-
Jasoco
- Inner party member
- Posts: 3655
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
-
Contact:
Post
by Jasoco » Thu Mar 04, 2010 5:12 am
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.
Users browsing this forum: No registered users and 28 guests