BuildableDef uiIcon uses mainImage drawsize

Started by skullywag, February 05, 2016, 04:31:33 AM

Previous topic - Next topic

skullywag

More of a modder quality of life tweak this but i could see it being handy for the main game as well.

Gonna use the turret as an example here.

At the moment if you define a uiIconPath on a turret itll use the drawsize of the actual turret and thefore break out of the bounds of the box in the build menu (the base game doesnt suffer as it doesnt use the UI icon option, leaving out the UI icon and therefore using the base texture as the UI icon seems to scale correctly???), adding whitespace around the image (increasing canvas size) is a workaround here.

If possible i feel having graphicProperties for the ui icon as per the main image would be beneficial for everyone. We would be able to define everything about the ui icon and as an added bonus would be able to add shaders and masks allowing us to have for example a correct representation of a turret with its gun (not just the empty base...) and not have it change colour when stuff is switched only the base would change. Everybody wins. Core gets better UI and modders can actually have correct and easily handleable ui images.

Thanks for reading.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

ison

Quote from: skullywag on February 05, 2016, 04:31:33 AM
At the moment if you define a uiIconPath on a turret itll use the drawsize of the actual turret and thefore break out of the bounds of the box in the build menu (the base game doesnt suffer as it doesnt use the UI icon option, leaving out the UI icon and therefore using the base texture as the UI icon seems to scale correctly???), adding whitespace around the image (increasing canvas size) is a workaround here.

Fixed, thanks.

Quote from: skullywag on February 05, 2016, 04:31:33 AM
If possible i feel having graphicProperties for the ui icon as per the main image would be beneficial for everyone. We would be able to define everything about the ui icon and as an added bonus would be able to add shaders and masks allowing us to have for example a correct representation of a turret with its gun (not just the empty base...) and not have it change colour when stuff is switched only the base would change.

Hmm, so you suggest using Graphic instead of just Texture2D for UI. It's not possible currently. Drawing GUI and drawing things on the map (which is where Graphics are used) are two different things. We would need something like UITexture which would be an inheritable Texture2D wrapper. I'll think about it.