custom events

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
jpott
Prole
Posts: 8
Joined: Fri May 05, 2017 7:36 pm

custom events

Post by jpott »

so on the love.event page https://love2d.org/wiki/love.event it says
It is possible to define new events by appending the table love.handlers. Such functions can be invoked as usual, via love.event.push using the table index as an argument.

i thought maybe this was a table i could access using table.insert(love.handlers,) or something along these lines. I'm having trouble finding any more documentation, or comments, or any other information regarding it.

I'm trying to make custom events that I can push when a button has been clicked (think gui not keyboard).
hopefully I've worded this clearly enough.
thanks
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: custom events

Post by bartbes »

It's not indexed numerically, because then how would it associate handlers to events? Instead it's indexed by the event name. So love.handlers.cake handles the event named "cake".
Post Reply

Who is online

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