Game Development Community

Mouse events with gui controls

by Charlie Malbaurn · in Torque Game Builder · 04/11/2005 (4:57 pm) · 24 replies

Hey all,


I started a gui control using a GuiWindowCtrl. I tried to use a mousedown function so that when i click on it, it gives me a message.

Well, I get errors so I am wondering if the gui's have mouse events or not? If so, can someone point me in the right direction to find out what it's arguments would be?

here is the code that I tried. Basically a copy of Matthew's mouse move tuts.

Function test1::onMouseDown()
{
echo("Mouse Down");
}

I realize that the arguments are not there but that is because I don't know what they are for that control.

Any help would be most welcome.

Edit test1 is what I named my GuiWindowCtrl
Page«First 1 2 Next»
#21
04/15/2005 (12:53 am)
These are Note Supported by me, lol I don't pretend to know all the complexities that could be effected by this... with simple testing this works fine, but no garantees :)
#22
04/15/2005 (2:56 am)
Well maybe I should explain what I am trying to do. And what I think might work. And if you have the time, I would really like your input since you are the king of GUI:

Anyway, I am making a game where I need an inventory system that will be able to drag one Item over the other and then have them add together. Sort of like your old fashion adventure games. (Grab jelly->put over bread=sandwich) That is basically why I needed the mouse down, mouse drag, etc...

I was thinking, if it is possible (and I got the idea from your object selection tut) that I could use fxSceneObject2D objects as the menu items.

But I don't know if this is possible or not. I figure doing that I would have the mouse control and I would also have the collision checking to see if the two items being brought together are indeed the two Items needed.

What do you think?

Either way, Thank you Matt for taking the time to answer me

And of course, you to Stephen!
#23
04/15/2005 (3:04 pm)
Lol the king of GUI... I'll take that as a compliment, though I don't know what all of the controls do =/

What I'd suggest you do is do it in T2D and use a tilemap for the background... I think someone was using that for their inventory in T2D, and I think I will also

seems to do it in the GUI you'd have to hack in some of your own GUI controls... now later I may consider this, but I think making it in T2D will be better :) and easier with no source changes lol...

I'm still deciding what my C++ tutorial will extend fxSceneObject2D to do... was thinking path points... possibly triggers... maybe even some inventory management things... when I get some time tonight I'll work it out... I need to do an inventory system for my teams game anyways
#24
04/15/2005 (3:09 pm)
In my GID , the main screen that fades in then fades out in seperate peices is made in T2D, including the Play button
Page«First 1 2 Next»