How to find which gui object is on top?
by Dean · in Torque Game Engine · 07/11/2007 (1:31 pm) · 1 replies
In my code, when i click on two overlapping gui objects, it registers on both. I only want the top control to respond to the mouse click, but I don't know how to actually tell which one is on top. From what I know of the function pushtoback, it seems to depend on the object's order in the objectlist, but I can't find any commands to access the list and get a certain object's index in it.
Or I could just be wrong. anyone know?
Or I could just be wrong. anyone know?
Torque Owner Dean
added this to tAlgorithm.h
template <class Iterator, class Value> S32 findindex(Iterator first, Iterator last, Value value) { S32 index = 0; while (first != last && *first != value) { ++first; index ++; } return index; }added this to simBase.h
S32 findindex( iterator first, iterator last, SimObject *obj) { return ::findindex(first, last, obj); }and here was my usage