Texture Coordinates problem.
I'm trying to display a progress bar made with a texture file in a frame. The goal is to set the width of this texture according to a given parameter: let's say from 0 (no visible texture) to 1 (texture fills all the frame's width). At 0.5, the left side of the bar must be filled with the texture.
At this time, I have: Lua Code:
The bar size is 100 (w) x 15 (h) px. The TGA file is 8 (w) x 16 (h) px. I know it would be easier to create a child frame inside the "bar" frame, fill it with texture and then set the width of the child frame, but in my case, it will lead to others problem. So I would prefer to manage the texture coordinates... If it is possible. Thank you. |
SetTexCoord sets a subsection of the texture file to show as the texture like the minimap pips are all in one file and they pull each pip out by its coordinates.
https://wowpedia.fandom.com/wiki/API_Texture_SetTexCoord perhaps a statusbar would work better. You could use your texture for the fill, have a background or not, set colors, have it mouse interactable or not... and more |
something like this
lua Code:
|
Though initially I didn't want to create another frame/object, your solution is fine (just added SetSize()).
Thank you Billtopia :) |
All times are GMT -6. The time now is 08:13 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI