Generic Hitbox

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
JNighthawk
Just popping in
Just popping in
Posts: 7
Joined: Sun Apr 17, 2005 04:55

Generic Hitbox

Postby JNighthawk » Sun Apr 17, 2005 04:58

Is there a generic hitbox widget? I want to have an area that will execute a function when clicked on using CEGUI. Any suggestions? I was thinking about just having an invisible button, but it would be nice if there was a generic hitbox widget that will display nothing, but still take input.

User avatar
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Re: Generic Hitbox

Postby spannerman » Mon Apr 18, 2005 16:47

Well I think all the widgets inherit the basic events, so you could listen to the onMouseClicked event from just a blank GUISheet (if you want it blank, doesnt have to be). Create a GUISheet something like this:

Code: Select all

(GUISheet*)WindowManager::getSingleton().createWindow("DefaultGUISheet", "myHitBox");


Hope that helps

User avatar
JNighthawk
Just popping in
Just popping in
Posts: 7
Joined: Sun Apr 17, 2005 04:55

Re: Generic Hitbox

Postby JNighthawk » Wed Apr 20, 2005 09:52

Wouldn't the GUI sheet cover the entire screen? And can't you only show one GUI sheet at a time? If I wanted to use this with an already existing GUI sheet, I could just subscribe the click event to the sheet? I would definitly prefer a much cleaner widget (such as a polygon widget? I can provide code to test for a point in a convex polygon if it's a problem).

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: Generic Hitbox

Postby lindquist » Wed Apr 20, 2005 16:49

the gui sheet is just a window like everything else.

you can add a gui sheet as a child of any window and you can resize it to fit your needs.

it just gives just a default window that does'nt draw anything (edit: except its children...)


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 11 guests