ID:273664
 
I am having a little trouble making overlays appear above(North of) my icons. Is there a way i can set the pixel_y var to be equal to the icon height(varies)?

I've looked at the pixel_y in the help file but nothing and i cant find a variable for icon height to set it to.

Can anyone point me in the right direction?

Many thanks.
Unfortunately, the only way to really detect an icon's height is to make a new temporary /icon object and read it using icon.Height(), like so:
var/icon/i = icon('some icon.dmi') //or icon(src.icon)
src << "Your icon's dimensions are [i.Width()]x[i.Height()]"

As far as I know, creating new /icon objects in DM isn't very fun for the CPU, whether you're using it visually or not. That said, it is more efficient to just pre-define a height var for all of your objects, which would default to world.icon_size, which defaults to 32.
In response to Kaiochao
Thanks,and your right, its not good for the CPU at all.

A predefined height would be more suitable and I think I'm just going to have to settle for that since the reaction time is killer.

But thank you for your help, it has been very useful.