Thread Tools Display Modes
03/17/23, 05:38 PM   #1
akanderson
Join Date: Mar 2017
Posts: 8
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.
  Reply With Quote
03/17/23, 06:06 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,966
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
  Reply With Quote
03/17/23, 07:49 PM   #3
akanderson
Join Date: Mar 2017
Posts: 8
Thank you very much for the quick reply. Learning this makes me lookback and realize how easy Pascal was in comparison.
  Reply With Quote
03/18/23, 04:21 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,966
Well lua is easy too, the API of this game is the thing you need to learn though
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Changing icon size using LUA command structure


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off