ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Changing icon size using LUA command structure (https://www.esoui.com/forums/showthread.php?t=10490)

akanderson 03/17/23 05:38 PM

Changing icon size using LUA command structure
 
I'm just starting to ease myself into learning LUA and I had a question.

Is there a way to change the size of an icon when adding it to a line of code within an addon LUA? As an example would I be able to shrink or enlarge /esoui/art/icons/ability_u24_drg_breath_frost.dds from its default size by adding coding to the line?

Any help you can provide would be greatly appreciated.

Baertram 03/17/23 06:06 PM

If you put the icon to a texture control (controls: https://wiki.esoui.com/Controls) of type CT_TEXTURE you just need to change the size of the control via
textureControl:SetDimension(x, y)
or
textureControl:SetWidth(number)
textureControl:SetHeight(number)

Controls get anchored to other controls so make sure the anchors are removed before resizing, as else the anchors could keep it "not resized" as they grab left/right at other controls to stretch it.

textureControl:ClearAnchors()

Afterwards you can resize and reposition it and then re-anchor it f needed via
textureControl:SetAnchor(parameters here)
-> https://wiki.esoui.com/Control:SetAnchor


If you do not use any texture control but only text output of a texture, within a String, you can resize them too via ZOs API functions:
https://wiki.esoui.com/Text_Formatting#Texture

akanderson 03/17/23 07:49 PM

Thank you very much for the quick reply. Learning this makes me lookback and realize how easy Pascal was in comparison. :D

Baertram 03/18/23 04:21 AM

Well lua is easy too, the API of this game is the thing you need to learn though :)


All times are GMT -6. The time now is 12:56 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI