Page 1 of 2

Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]

Posted: Wed Sep 30, 2009 10:57 am
by appleide
Between LÖVE 0.5.0 to LÖVE 0.6.0 there have been alot of changes, breaking many .love files!!! This is a thread for everyone to post what to change in a .love file needs to have changed for it to work in the new LÖVE!

I'll start:

love.filesystem.require has been changed to just require.

Help everyone!!

Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]

Posted: Wed Sep 30, 2009 11:15 am
by nevon
Well, all the old callbacks like update(), load(), draw() etc. are now going to have to be prefixed with love.
So update() will now be written love.update()

Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]

Posted: Wed Sep 30, 2009 1:57 pm
by Robin
A difference we noticed much when porting LBP was the following:

Old Colors are gone. You can only use setColor(r, g, b) or setColor(r, g, b, a) anymore. You can emulate old Colors by putting the color values in a table, and doing setColor(unpack(color_x)).

Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]

Posted: Wed Sep 30, 2009 2:15 pm
by bartbes
Physics has inbuilt scaling now, so if you want it to be pixels again, create the world bigger and set the scaling to 1.
The default scale value is 30 px/m, so:

Code: Select all

world = love.physics.newWorld(xsize * 30, ysize * 30)
world:setMeter(1)

Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]

Posted: Mon Oct 05, 2009 10:43 am
by Tenoch
bartbes wrote:Physics has inbuilt scaling now, so if you want it to be pixels again, create the world bigger and set the scaling to 1.
The default scale value is 30 px/m, so:

Code: Select all

world = love.physics.newWorld(xsize * 30, ysize * 30)
world:setMeter(1)
That's a very bad idea. Unless you plan on having objects no bigger than 10 pixels big.

Box2D's documentation:
Box2D is tuned for MKS units. Keep the size of moving objects roughly between 0.1 and 10 meters. You'll need to use some scaling system when you render your environment and actors.
This setMeter() this is the scaling system they recommend. Don't stress a physics engine, it's a pretty delicate thing.

Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]

Posted: Wed Oct 07, 2009 2:45 pm
by bartbes
It is bad, but if you rely on the current working, or, like me already scale before feeding it into the engine, you're going to need such code.

Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]

Posted: Tue Oct 13, 2009 9:24 pm
by The Burrito
Constants just became strings.

example:

Code: Select all

--old
if love.keyboard.isDown(love.key_space) then
love.graphics.polygon(love.draw_line, shape:getPoints())
end
--new
if love.keyboard.isDown('space') then
love.graphics.polygon('line',shape:getPoints())
end

Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]

Posted: Wed Oct 14, 2009 8:52 pm
by bmelts
Actually it's ' ', not 'space'. But yeah.

To quit, you need to call love.event.push('q').

Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]

Posted: Mon Oct 26, 2009 10:14 am
by kalle2990
What is the string for the default font?

Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]

Posted: Mon Oct 26, 2009 10:46 am
by bartbes
The default font used to be love._vera_ttf... poking around in the source makes it appear it still is.