Centering an icon with a transparent bg on a checkbox

Place to get help with not working mods / modding interface.
JasonC
Filter Inserter
Filter Inserter
Posts: 449
Joined: Tue Mar 22, 2016 3:05 am
Contact:

Centering an icon with a transparent bg on a checkbox

Post by JasonC »

When I create a checkbox with an icon in it, and the icon has a transparent background (the game's battery icon is a good example), the game automatically crops the image to the non-transparent area before drawing it on the checkbox.

How can I center it on the button?
  • align="center" has no effect
  • I can't use "shift" unless I know exactly what the contents of the image are at design time, which in this case I don't.
  • What I *do* know is the size of the image itself including the background (e.g. 32x32), so I can certainly use shift, etc., to center that 32x32 box, if it didn't crop the image.
Alternately, how can I disable the auto cropping (which incidentally also messes with image scaling on buttons)?
Took a break from 0.12.29 to 0.17.79, and then to ... oh god now it's 1.something. I never know what's happening.
Post Reply

Return to “Modding help”