0.6.0 Update

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
napco
Party member
Posts: 129
Joined: Fri Jun 12, 2009 9:28 pm
Location: Ital... ehm...

Re: 0.6.0 Update

Post by napco »

What can we do to make our 0.5.0 games work also with 0.6.0 withowt rewriting every script? (i know we could make the .exe file with 0.5.0, but then the source will be unreadable)
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: 0.6.0 Update

Post by bmelts »

napco wrote:What can we do to make our 0.5.0 games work also with 0.6.0 withowt rewriting every script? (i know we could make the .exe file with 0.5.0, but then the source will be unreadable)
Some of your code should be compatible going forward - how much exactly depends on what features your program uses. However, there's inevitably going to be some rewriting to make your code work properly.

Here's ten changes off the top of my head:
  • Built-in love functions must now be prefixed with "love.". So, instead of load() or keypressed(), it's love.load() and love.keypressed().
  • Any love.graphics.draw() calls for drawing text need to be replaced with love.graphics.print() or love.graphics.printf().
  • Colors have been removed. Replace any Colors with their equivalent in separate red, green, blue, and alpha values.
  • Animations have also been removed. There's no immediate replacement for that in LÖVE 0.6.0, but supposedly there's a library to help replicate its functionality coming soon.
  • love.graphics.setCenter() no longer exists - you specify the center of an image as two extra parameters in its love.graphics.draw() function instead.
  • love.default_font has been replaced with love._vera_ttf.
  • love.system is gone. Completely. Bye bye!
  • Some constants have been renamed - love.color_normal is now love.color_replace, and love.blend_normal is now love.blend_alpha.
  • Speaking of color modes, love.color_modulate is now the default color mode.
  • Images now have their origin default to the top left of the image instead of the center.
There's more that's changed between versions, of course, but that's all the stuff I can think of right now. If you -- or anyone else! -- have any more questions about things breaking between versions, you can post them in this thread (or ask on IRC, or PM me, or any other way you like).
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: 0.6.0 Update

Post by Jasoco »

anjo wrote:Any love.graphics.draw() calls for drawing text need to be replaced with love.graphics.print() or love.graphics.printf().
You mean the other way around?
Colors have been removed. Replace any Colors with their equivalent in separate red, green, blue, and alpha values.
I assume this means instead of:
love.graphics.setColor(love.graphics.newColor(255,255,255,255))
We just use:
love.graphics.setColor(255,255,255,255)?
Animations have also been removed. There's no immediate replacement for that in LÖVE 0.6.0, but supposedly there's a library to help replicate its functionality coming soon.
I only had one anyway, for testing, it was water, but I was probably just going to create my own animation feature anyway to make it easier on myself. (I want to put all the animations in one file, instead of having to use individual images for each animation.)
love.system is gone. Completely. Bye bye!
So, what, Restart and Exit are simple exit() and restart()? Or what have they been changed to?
Images now have their origin default to the top left of the image instead of the center.
I was wondering about that. I literally just changed all my code to paste images at 16 pixels offset anyway. Now I'll just remove that 16 pixel offset.

Cannot wait to get this puppy ported. I assume the engine will blue screen if/when it encounters an older command that was depreciated to make it easier to track it all down?
Mr. Strange
Party member
Posts: 101
Joined: Mon Aug 11, 2008 5:19 am

Re: 0.6.0 Update

Post by Mr. Strange »

rude wrote:Then you'll be delighted to hear, Mr Strange, that fonts are just as horrible as before. :neko:
Half of my pleasure comes from this confession, and half comes from the fact that I know 6.1 will be _all about_ a rewrite of the font system.

How much would you charge to support formatted text which is also rotated? I'll send you $300 right now if that would do it.

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

Re: 0.6.0 Update

Post by Jasoco »

I don't use the font system for real fonts. I just make my own as images. Painstakingly.
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: 0.6.0 Update

Post by bmelts »

Jasoco wrote:You mean the other way around?
No, I mean it the way I said - love.graphics.draw() is overloaded in 0.5.0 to draw both strings and images. In 0.6.0, drawing strings requires the use of the love.graphics.print[f] function.
Jasoco wrote: I assume this means instead of:
love.graphics.setColor(love.graphics.newColor(255,255,255,255))
We just use:
love.graphics.setColor(255,255,255,255)?
Correct.
Jasoco wrote:So, what, Restart and Exit are simple exit() and restart()? Or what have they been changed to?
Restart no longer exists, sorry. love.system.exit() has been replaced with love.event.quit().
Jasoco wrote:I assume the engine will blue screen if/when it encounters an older command that was depreciated to make it easier to track it all down?
Depends. For example, if you forget to change keypressed() to love.keypressed(), you won't be able to tell that something's wrong until you press a key and nothing happens, since LÖVE will simply not see a function to call when a key is pressed and ignore it. However, if you forget to change a love.graphics.draw to love.graphics.print, LÖVE will blue screen and complain about you passing the wrong type of argument to love.graphics.draw(). For the most part, if the change to 0.6.0 breaks something in your code, you'll probably be able to tell where the problem is. (Unless something goes horribly wrong and the program segfaults :joker:.)
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: 0.6.0 Update

Post by bartbes »

anjo wrote: [*]Animations have also been removed. There's no immediate replacement for that in LÖVE 0.6.0, but supposedly there's a library to help replicate its functionality coming soon.
Yes, that's where I come in, I have created AnAL, an animation lib which closely resembles the old animation system. It is already done, it works, I just need to upload it.
I only had one anyway, for testing, it was water, but I was probably just going to create my own animation feature anyway to make it easier on myself. (I want to put all the animations in one file, instead of having to use individual images for each animation.)
They are in one file?!
User avatar
Igmon
Prole
Posts: 9
Joined: Wed Mar 11, 2009 6:11 pm

Re: 0.6.0 Update

Post by Igmon »

Will there be a quick list of API functions coming soon for 0.6.0? That would really be helpful to start fiddling around with this new version. That way we can start posting some bugs for 0.6.0. ;)
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: 0.6.0 Update

Post by Jasoco »

anjo wrote:
Jasoco wrote:So, what, Restart and Exit are simple exit() and restart()? Or what have they been changed to?
Restart no longer exists, sorry. love.system.exit() has been replaced with love.event.quit().
But... why? How am I supposed to have the game restart itself when I need it to? I use Restart all the time. Like all the time. I have it bound to a press of the R key for testing without having to touch the mouse to double-click the file every time I want to load the new version. Is there a reason it was taken out?
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: 0.6.0 Update

Post by bmelts »

I don't know why it was removed (you'd have to ask rude, sorry). Fortunately, not all is lost - it's not impossible to write your own restart() function that goes something like this:

Code: Select all

function restart()
   love.load()
end
Post Reply

Who is online

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