ID:1960675
 
(See the best response by Konlet.)
Problem description:
I've created a drag selection algorithm and works just fine but how do I render the box in the screen. Note that I want it to be pixel precise.

By drag selection I mean the dragbox kind of selection where you drag the mouse and a box appears.



Best response
You're describing an atomic process known as MouseDrag(). MouseDrag uses the arguments (over_object,src_location,over_location,src_control,over_cont rol,params)

For specific pixel precise location, you'll have to grab it out of params like I did with my GiaD submission '.vapor'.

client/MouseDrag(params)
..()
params = params2list(params)
var/pixelX = params["icon-x"] //Grab the value associated with 'icon-x' in the list 'params'.
var/pixelY = params["icon-y"] //Grab the value associated with 'icon-y' in the list 'params'.


"icon-x" and "icon-y" are the pixel locations stored in the params list. Hope this was helpful.