Object Selection
by Carpenter Software · in Torque Game Engine · 12/21/2006 (8:19 pm) · 5 replies
I have seen blogs and resources on Object Selection using the cross hairs....
Question: Can a cursor move on a layer during Game Play in TGE 1.4.2 or TGE 1.5.0 and select an object?
This is my next project.
Question: Can a cursor move on a layer during Game Play in TGE 1.4.2 or TGE 1.5.0 and select an object?
This is my next project.
#2
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7335
This is what I started with for object selection in the AFX CoreTech product, which includes a complete solution for selecting objects and highlighting them with special effects.
12/23/2006 (12:11 pm)
The basics of object selection are covered in this excellent resource:www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7335
This is what I started with for object selection in the AFX CoreTech product, which includes a complete solution for selecting objects and highlighting them with special effects.
#3
I have this resource and have been going over it.
Curious, can you change the cursor image as it passes over (without a mouse button click) an object based on item (Object) type? Also can you get your cursors to animate?
I like the special effects (light effects).
12/23/2006 (1:19 pm)
Thanks JeffI have this resource and have been going over it.
Curious, can you change the cursor image as it passes over (without a mouse button click) an object based on item (Object) type? Also can you get your cursors to animate?
I like the special effects (light effects).
#4
[added]
In the resource, the object selection is done on the server as a result of a mouse down. One of my customizations was to do client-side raycasts in the scene control's onMouseMove() handler, in order to detect rollover objects. The raycasting function returns an id for the object under the cursor which could be used to change the cursor according to type.
I think an animated cursor would require some code customization in order to create an animated alternative of a GuiCursor object. The hard part would be finding the right place to update it regularly with timing info.
12/26/2006 (10:31 am)
I've never tried changing the cursor image, just made the selection operation work and did rollover feedback by raising object ambience. I'll take a look at the code to see how hard that would be.[added]
In the resource, the object selection is done on the server as a result of a mouse down. One of my customizations was to do client-side raycasts in the scene control's onMouseMove() handler, in order to detect rollover objects. The raycasting function returns an id for the object under the cursor which could be used to change the cursor according to type.
I think an animated cursor would require some code customization in order to create an animated alternative of a GuiCursor object. The hard part would be finding the right place to update it regularly with timing info.
#5
edited:
If there is a callback for mouse movement then there must be a way to use raycast to determine object id. Once the object has been determined then a call can be made to change the cursor.
Animated cursors may be a good idea but first, lets try to get mouse movement to determine object id.
Thanks
12/26/2006 (3:10 pm)
The idea is to change the cursor for object selection if the object is an inventory item for example or maybe a piece of the game puzzle. This will inform the player (clue) as to what he may do with the item.Quote: Jeff Faust
The raycasting function returns an id for the object under the cursor which could be used to change the cursor according to type.
edited:
If there is a callback for mouse movement then there must be a way to use raycast to determine object id. Once the object has been determined then a call can be made to change the cursor.
Animated cursors may be a good idea but first, lets try to get mouse movement to determine object id.
Thanks
Torque Owner Carpenter Software
Thanks