LÖVE 0.6.1

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: LÖVE 0.6.1

Post by Jasoco »

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:

Image

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?
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: LÖVE 0.6.1

Post by thelinx »

What isn't working for you? According to the wiki, image:setFilter is the way to go.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: LÖVE 0.6.1

Post by Jasoco »

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.
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: LÖVE 0.6.1

Post by thelinx »

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
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: LÖVE 0.6.1

Post by Jasoco »

But does it work on Quads and imageFonts?
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: LÖVE 0.6.1

Post by thelinx »

Jasoco wrote:But does it work on Quads and imageFonts?
I guess not.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: LÖVE 0.6.1

Post by TechnoCat »

Should work just fine with quads.
Attachments
quad.love
(859 Bytes) Downloaded 119 times
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: LÖVE 0.6.1

Post by Jasoco »

Looks like it does. I'll examine the code and see where I was going wrong.

Thanks
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: LÖVE 0.6.1

Post by Jasoco »

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.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: LÖVE 0.6.1

Post by TechnoCat »

Jasoco wrote: main.lua:92: Invalid filter mode: 1
[C] In function 'setFilter'
0.6.2 uses string constants for setFilter now. They are now "nearest" and "linear".
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.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 56 guests