ID:2730126
 
(See the best response by Shadowkaroth.)
Code:
None to show.


Problem description:
Is it possible to adjust the pixel positions of an individual icon_state at runtime? If so, how would it be done? I've got icon_states I want to adjust the pixel_y of by -1, but another that I want to adjust the pixel_y of by -2. I know it'd be doable by just making more icons and applying during appropriate situations, but if there's a way for the program to handle it, I'd rather go about that route.
No you cannot change offset per icon_state but you can change the offsets of /atoms and add them as overlays that take all "appearance" values of the object when used as an Overlay.

obj
Overlay
icon_state = "u"
pixel_x = 6

mob
Login()
overlays += new /obj/Overlay
That much I do know about. I'm working on a character customization system for a game I'm working on. The female characters are 1 pixel shorter than the males; the hair/outfits are already overlays that are merged onto the base icon via Blend(), but it's only a handful of icon_states I want to adjust rather than the whole icon.

Though knowing it can't be done via code, I'll take another approach. Appreciate the quick response.
In response to Oondivinezin
Best response
Any specific reason you are blending their icon/overlays together?

I could point you in a few different ways that would remedy this rather quickly with minimal effort and shouldn't affect much unless of course you have a unique reason.

Although none of them without making some special function will act per icon_state.

Also, it sounds like that the entire hair icon should need shifted down. Blend can do this when adding the hair..
if(gender=="female")
Blend(hair.dmi, y=-1)
Instead of using Blend(), you're probably better off just making these overlays. You can use the KEEP_TOGETHER flag on the main icon so all the overlays render with it as one seamless unit.