Quote:Original post by Calin How can you highlight a unit while you are making your selection box ( while you are dragging the mouse )if you didn`t make the selection yet? |
Ok, I think you're confused on what I meant. As I mentioned in the addendum to my post, there are two meanings of selection that I'm using.
In an RTS game, everyone knows that you click on units (or drag a selection box around them) to select them; I'll refer to this as
unit selection. When doing OpenGL programming, there is also the technique of selecting polygonal objects; I'll refer to that as
picking.
What I was suggesting was that you contain your
picking code within the mouse-move events. That way, as you are dragging your selection region, you can draw an outlined box of the region that you are currently going to be selecting from as it expands, as well as possibly highlighting which units fall under the selection region to help the user distinguish which units are going to be selected more easily.
However, you would then have the actual
unit selection take place upon release of the mouse button at which time the user would now have the newly selected "sqaud" at their command.
Sorry if I'm still not making sense. If there's something about it you still don't understand, please feel free to let me know.