Create a new inputarea.
Create a new inputarea. An inputarea is a spot on the screen that will respond to mouse/joystick buttons when the cursor is within its borders. The LUI system uses this for its gadgets.Freeing an inputarea is a simple matter of removing it from its list and calling iarea_free().
Supported tags
- IA_DATA
- Data to pass on to the hook functions.
- IA_CLICK_HOOK
- Left mousebutton hook.
- IA_MCLICK_HOOK
- Middle mousebutton hook.
- IA_RCLICK_HOOK
- Right mousebutton hook.
- IA_PASS_HOOK
- Pass-over hook. Called when no mousebuttons are pressed.
- IA_INPUT
- A mask of controllers to respond to. The choices are:
- IA_CTL_MOUSE
- Ordinary mouse, two or three buttons (unless you suffer from a Mac).
- IA_CTL_JOY
- Sticks and pads may break my code. Not implemented yet.
- IA_MBUTTONS
- Mask of mousebuttons to respond to.
- IA_JBUTTONS
- Mask of joybuttons to respond to. Note that only eight bits are available. Since joystick support hasn't been written yet, this will probably be expanded to include hats, too. And we could always hope that Z axis and throttle makes its way into the code..
- IA_XPOS, IA_YPOS
- Position of upper left corner of this inputarea.
- IA_WIDTH, IA_HEIGHT
- Size of this inputarea. Clicks/pass-over functions are not called outside its limits. Beware of overlapping regions. No effort will be made to handle overlaps.
- IA_NAME
- Optional name.
- IA_ID
- Identifier returned by iarea_check() when the inputarea matches.
- IA_DELAY
- Milliseconds to delay before allowing an inputarea to be clicked again. If less than this number of milliseconds have passed since clicking a button, iarea_check() returns zero. SDL_GetTicks() is called to get current ticks iff this tag has been specified.