samedi 7 mars 2015

RTS style of drag and select system


I'm trying to make a click and drag selection system in c++ and SDL2 like the kind used in real time strategy games. You click with the mouse and drag it over what you want to select. How can I go about making it?


Edit: I know how to handle the mouse inputs. I have used a Rect structure to track the size of the selection zone. However while the zone draws correctly, the objects inside the zone don't react at all. However individually clicking on them works fine every time.


I guess my question is what is the best way to check for a group selection vs individual object selection?




Aucun commentaire:

Enregistrer un commentaire