ID:163296
 
This should be simple and obvious, but for some reason today I keep drawing a blank.

turf
Clicker
icon = 'Click.dmi'
Click()
world<<"You clicked [pixel x] pixels deep into the Clicker!"


How can I click on a turf (or any atom) and have it return how many pixels across x I clicked? Thanks a lot!

~Ease~
BYOND 4.0 has this built right into all of it's mouse procedures. You'll want to use the params argument. icon_x is what you're looking for.

See the skin reference for more information. Alternatively, looking up "mouse control" may help.

-- Data
turf
MouseUp(object,location,control)
var/listy[]=params2list(control)
world<<listy["icon-x"]
In response to Falacy
Falacy wrote:
> turf
> MouseUp(object,location,control)
> var/listy[]=params2list(control)
> world<<listy["icon-x"]
>


turf/Click(location,control,params)
var/list/L=params2list(params)
.=L["icon-x"]


MouseUp() occurs when the mouse button is released while pointing to the object, Click() is for actual clicking of an object.

-- Data
In response to Android Data
Thank you both very much!

~Ease~
In response to Ease
eh, that code i posted was modded from a shooter game i was working on, where mouse up was more appropriate <.<
either way it works pretty much the same though