Whenever event happens, eg. key press, mouse click, on quit, all of these "Event Handler Objects" will be notified.
It is basically a class with some empty functions - onClick, onMousePressed, onKeyPressed, etc.
when user calls "love.events.newEventHandler", a new object will be returned. The user can edit its functions, and when event happens, it will be notified and the corresponding function to the event will be called.
This reduces the number of loops the user will have to write in Lua inside the "function keyreleased( key ) ... end" and "function mousepressed( x, y, button ) ... end" and puts those loops in C instead, thus potentially increasing performance.
i.e, when user makes a set of buttons, user creates an eventhandler for each and every one of those button, instead of looping through each.
Not to mention it is rather convenient.
What do you think?
I have been doing an equivalent thing to LOVE for a while, and after poring over the LOVE documentation this is the only thing I have got to offer. ><
Suggestion: Event Object.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Suggestion: Event Object.
Yeah, I see how that can be useful, especially for GUI programming ...
But, because this is feairly easy to implement in Lua, and I don't think the performance gain will be that significant (even when there's many objects), I'm going to focus on more exiting stuff first, like physics (<-- mini preview).
But don't let that pulverize your feedback-mojo. Suggestions, requests, and demands are always welcome.
But, because this is feairly easy to implement in Lua, and I don't think the performance gain will be that significant (even when there's many objects), I'm going to focus on more exiting stuff first, like physics (<-- mini preview).
But don't let that pulverize your feedback-mojo. Suggestions, requests, and demands are always welcome.
Re: Suggestion: Event Object.
this physics engine looks great!
- Sardtok
- Party member
- Posts: 108
- Joined: Thu Feb 21, 2008 2:37 pm
- Location: Norway/Norge/諾威/挪威 (Yes, I'm teh back!)
- Contact:
Re: Suggestion: Event Object.
Yeah, physics look awesome, but I think it's more exciting than exiting, but then again, I don't know exactly what it's supposed to be exiting.rude wrote:I'm going to focus on more exiting stuff first, like physics (<-- mini preview).
Take off every Zigg for great rapist.
Now, outgay that!
Now, outgay that!
Re: Suggestion: Event Object.
It's exiting. It's outta here!
Who is online
Users browsing this forum: No registered users and 7 guests