View Single Post
03-03-16, 05:31 AM   #22
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by zork View Post
You can solve any framelevel and strata issues via frame stacking. This can be done by parenting any frame to the last frame you created.

Like if you want power below health you create power first with all the desired layers and anchor your base health frame to your highest power frame (overlay?).

Example:
local power = CreateFrame("Statusbar",nil,self)
power.overlay = CreateFrame("Frame",nil,power)
local health = CreateFrame("Statusbar",nil,power.overlay)
self.power =power
self.health = health

For statusbar texture. Your texture is 258x34 pixel. If that is the case that is the wrong size. It has to be 256x32 pixel. (Multiplier of 8).

By default any statusbar is stretched into the space given. StatusbarTexture accepts two types of variables. A texture path string and a texture object. You could create a texture beforehand and pass into to SetStatusbarTexture. You do not have to do it that way because GetStatusbarTexture will return the texture object.

Either way. A texture objext can have SetVertTile and SetHorizTile. This will prevent texture stretching and will repeat the texture the way you defined it.

http://wowprogramming.com/docs/widgets/Texture
http://wowprogramming.com/docs/widgets/StatusBar
Hi zork!

First of all, the reason why my texture had a size of 258x34 was because the website that I use to upload does only support .jpeg/.png/.gif and some kind of basic image formats.

I could've just change the format of this texture with some utilities (like BLP2PNG(?)), but was too lazy to do so ...

So, after all, I just captured an image and the image got the size of 258x34 and the format of .png.



And about the SetStatusBarTexture/GetStatusBarTexture, could you please explain me with some in details?

In order to create a texture object, don't I need a frame which is going to use that particular texture object?

Like:
Lua Code:
  1. frame.texture = frame:CreateTexture(nil, "OVERLAY");

If so, you mean by this?
Lua Code:
  1. frame.texture = frame:CreateTexture(nil, "OVERLAY");
  2.  
  3. frame.texture:SetTexCoord(0, 1, 1, 0);
  4.  
  5. frame:SetStatusBarTexture(frame.texture);
  Reply With Quote