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!!
Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]
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()
So update() will now be written love.update()
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]
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)).
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)).
Help us help you: attach a .love.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]
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:
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]
That's a very bad idea. Unless you plan on having objects no bigger than 10 pixels big.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)
Box2D's documentation:
This setMeter() this is the scaling system they recommend. Don't stress a physics engine, it's a pretty delicate thing.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.
"When in doubt, use brute force." Ken Thompson
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]
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.
- The Burrito
- Party member
- Posts: 153
- Joined: Mon Sep 21, 2009 12:14 am
- Contact:
Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]
Constants just became strings.
example:
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]
Actually it's ' ', not 'space'. But yeah.
To quit, you need to call love.event.push('q').
To quit, you need to call love.event.push('q').
Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]
What is the string for the default font?
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Porting Your LÖVE to Zero Point Six Point Zero [0.6.0]
The default font used to be love._vera_ttf... poking around in the source makes it appear it still is.
Who is online
Users browsing this forum: Google [Bot] and 77 guests