Do you have to use the callback functions?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
NilPirate
Prole
Posts: 5
Joined: Wed Sep 07, 2011 12:38 am

Do you have to use the callback functions?

Post by NilPirate »

Hi, I've only recently begun programming in LOVE, and I'm liking it so far. However, the callback functions are a bit strange for me, and i was wondering if I could use the love lib outside of the callback functions. Thanks!
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Do you have to use the callback functions?

Post by Taehl »

I assume you mean callbacks like love.keypressed and love.mousereleased? No, you don't have to use them if you don't want to. But you do need to at least use love.update and love.draw.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Do you have to use the callback functions?

Post by slime »

You can redefine the game loop if you want.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Do you have to use the callback functions?

Post by Taehl »

Oh, yeah, that too. I forgot about that.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Do you have to use the callback functions?

Post by BlackBulletIV »

slime wrote:You can redefine the game loop if you want.
Yeah. So basically, the only one you have to use is love.run. Still, love.update and love.draw only makes things cleaner and easier.
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Do you have to use the callback functions?

Post by slime »

Indeed. Pretty much every game in existence has update and draw functions, in one form or another.
Post Reply

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot] and 235 guests