🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Event System / User Interfaces

Published September 06, 2008
Advertisement
Event System
After spending some time with the event system, it seems to be working quite well. I have implemented about six different messages regarding the cursor position (entering area, leaving area, and over area) and the mouse button state (button up, down, and pressed). I'm using these to interact with the 3D objects that are representing my UI controls. The process of adding an event type is pretty straight-forward, which is what I am looking for from the system.

3D User Interfaces
With a useable event system ready for action, I've turned my attention back to the 3D user interface. The idea is to define an aggregate class to represent a given type of control. The aggregate contains a scenegraph node and adds the appropriate entity objects to represent the physical portion of the control. One additional aggregate class, a Dialog class, also contains a scene node and serves as the container to add controls to. When a control is added to a dialog, the control's node is connected to the dialog's node providing a single point of access for the entire set of controls in the dialog.

Semantically, this is quite similar to an MFC dialog view (its the most frequently used system in my recent past...) although the framework depends solely on my existing scene graph / rendering system. I'm starting out small and planning to have two controls initially:

1. Static Control: Allows for text display
2. Button Control: Displays text on its area, and generates events when pressed by the cursor

The interesting portion still to come is implementing the text rendering system. I traditionally use the ID3DXFont interface to render the text, but in the context of a 3D UI it only really works for producing a 'floating' text string - something like the name of a unit floating above an RTS unit. This is an interesting feature that I will be supporting, but the more interesting text rendering is to use my render view system to update a dynamic texture, which is then applied to the objects in the dialog. With this capability, the text will be appearing on the surface of objects serving as controls - including occlusion, angle of view, and parallax effects on uneven surfaces [grin][grin] I am very much looking forward to getting this one together.

Before that though, I need to implement a couple more ray-to-shape intersection tests to add to the UI controls. Currently I only have sphere/ray intersections, so I'll be adding an oriented box routine as well. After that will be a general ray/triangle interface for some 'home-made' shape definitions. The next week or two should be quite fun...
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement