Game Development Community

Can I... Make a button component?

by Will O-Reagan · in Torque X 2D · 03/30/2007 (7:14 pm) · 4 replies

Anyone have ideas for best practices on creating buttons, for in game play. I am planning upwards of 200-300 or more buttons. I havn't really written any GUI classes, or pushed buttons yet. But I was thinking of writing a component for the button, and going that route..

About the author

I have a degree in dramatic art, and literature, from UC Santa Barbara. I've worked for a few studios, also at Animax Ent in 2008, and some smaller studios. Currently studying Computer Science at CSU Channel Islands.


#1
03/30/2007 (11:47 pm)
The GUI system is a light port of our existing GUI tech, so it wasn't built with components in mind. However, it would be interesting to see what could be done with this.
#2
03/31/2007 (9:16 am)
Do you mean a button that the game itself interacts with and not the player or do you mean a button that the player can click on/hit a key to activate?

www.linkedin.com/img/webpromo/btn_viewmy_160x25.gif

www.mmogamedev.info/images/imgdc_ad1.gif
#3
03/31/2007 (3:53 pm)
I'm going down a route that focuses on player input.

A template button that will be cloned,

a single button component, that will be altered dynamically.

Its going to be sensitive to an orb, which will hover around, and snap to center positions of buttons, depending on which button is active,

and which way the analog stick is pushed.

data for what happens when a button, (such as A), will reset when a certain button is hit as will the data for where the analog stick will be directing the orb. for instance, if it reaches the end of the array. the orb won't be able to snap the next button in line, so that will be null. when the button exectues, it will delete itself and all sibling buttons that were created, and the regular input map will take over again.

The main idea is that the game continues, but when a button is cloned, all controls for the player are null, until it is deleted.

Thats the plan anyways, I was inspired by the new blaster tutorial i guess. (it has a firing component attached to the main ship)

basically, my game is just too complicated and I am just too inept with my GUI, for me to try and get the same sort of versatality from the GUI that I'll be getting from my cloned buttons. I hope it works. If anyone has any ideas, I'd be glad to hear it.

edit: Actually I just figured out, I'm trying to use the Trigger component... I hope nobody is trying to site this as a resource, this is all pretty theoretical.
#4
04/08/2007 (12:07 pm)
Just be careful with using triggers. They are a little expensive as far as resources. If you don't specifically need enter, stay, and leave you should consider just using regular collision.