Basically, I want to make a proc, that auto-centres the overlay or icon on the user because, I have to use
var/AURA = image(icon=src.icon,pixel_x = -31)
Problem description:
Basically, I want to make a proc, that auto-centres the overlay or icon on the user because, I have to use
var/AURA = image(icon=src.icon,pixel_x = -31)
|
Feb 23 2015, 1:19 pm
|
|
If the overlay's dimensions are higher than your player's icon, or the object's icon you are overlaying, that's the correct way to do so.
|
If the icon you want as overlay, has a size higher than the icon that's holding that overlay, you will have to offset pixels on the x & y axis accordingly.
DM does not provide any sort of function that automatically detects the size and offsets it, you would have to go write your own implementation. Take a look into the icon.Height() and icon.Width() procedures. EDIT2: I removed the old example, it was not working. Here I provide an example that actually is easy to use: proc/get_pixel_x(icon/base, icon/overlay) To use it you would just add an overlay like: mob.overlays += image('TheOverlay.dmi', |