Welcome Guest [Log In] [Register]
Welcome to Epee Engine. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Epee Engine Events; Documentation on Epee Engine Events
Topic Started: Mar 8 2007, 12:20 PM (268 Views)
Alan
Administrator
[ *  *  * ]
The Epee Engine supports all sdl events and post events using the SDL event manager.


Below are SDL_USEREVENTs that are defined and used in the Epee Engine

ANIMATION_EVENT 29
TEXT_BOX_CHANGED_EVENT 30
NETWORK_DATA_RECIVED 50
Offline Profile Quote Post Goto Top
 
Alan
Administrator
[ *  *  * ]
ANIMATION_EVENT

An animation frame even has occurred
frame events can be set by calling SetFrameEvent(int _frame)

only one frame can be set to be thrown at a time.
After the event is thrown you will have to reset the event frame by calling SetFrameEvent, if you want another event to be thrown when that frame is displayed again.
The frame event is cleared after the event is thrown

sdl event structure when an animation event is posted

event.type: SDL_USEREVENT
event.user.code: ANIMATION_EVENT
event.user.data1: pointer to the instance of the animation object that posted the event;
event.user.data2 = Not used


to find out what frame caused the event call GetFrameEvent or GetCurrentFrame

example:
SDL_Event event;
int eventFrame=0
//poll for events using event
//if event is SDL_USEREVENT and code is ANIMATION_EVENT

eventFrame=((*Animation)event.user.data1).GetFrameEvent()
or
eventFrame = ((*Animation)event.user.data1).GetCurrentFrame()
Offline Profile Quote Post Goto Top
 
Alan
Administrator
[ *  *  * ]
TEXT_BOX_CHANGED_EVENT

An TEXT_BOX_CHANGED_EVENT occurs when text is set in a text box by passing true to the SetText function (see SetText in the textBox documentation)
When a user types characters into a text box this event is always thrown for each character
This can be helpful to know when a user changes text in a textBox in a event driven game or application

sdl event structure when an TEXT_BOX_CHANGED_EVENT, event is posted

event.type = SDL_USEREVENT;
event.user.code = TEXT_BOX_CHANGED_EVENT;
event.user.data1 =pointer to the instance of the textBox object that posted the event;
event.user.data2 = Not used;
Offline Profile Quote Post Goto Top
 
« Previous Topic · Documentation · Next Topic »
Add Reply