Thread Tools Display Modes
01-12-16, 10:04 AM   #1
TheSecretSquirrel
A Murloc Raider
Join Date: Jan 2016
Posts: 9
Question Issue with textures

Hello!

I'm trying to make a bar at the base of my screen, however when I try to change the texture or colour of the bar, it is displayed green, even if the path to the texture is correct.

I've looked around, but none of the solutions seem to work.

code:

Code:
local MainBackgroundFrame = CreateFrame("Frame",nil,UIParent)
MainBackgroundFrame:SetFrameStrata("BACKGROUND")
MainBackgroundFrame:SetWidth(1920)
MainBackgroundFrame:SetHeight(32)

local MainBackgroundTexture = MainBackgroundFrame:CreateTexture(nil,"BACKGROUND")
MainBackgroundTexture:SetTexture("Interface\\AddOns\\UIADDONTEST\\Textures\\backdrop.tga")
MainBackgroundTexture:SetAllPoints(MainBackgroundFrame)
MainBackgroundFrame.texture = MainBackgroundTexture

MainBackgroundFrame:SetPoint("bottom",0,0)
MainBackgroundFrame:Show()
Thanks

Squirrel
  Reply With Quote
01-12-16, 10:17 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Most comon problems are people adding new textures and not completly exiting the game before using.

The length of the sides of the texture must be a power of 2 (not just divisible by 2) eg. 16, 32, 64, 128, 256, or 512.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
01-12-16, 10:23 AM   #3
TheSecretSquirrel
A Murloc Raider
Join Date: Jan 2016
Posts: 9
Awesome, fixed it with a restart

Another quick question: How would I change the alpha of this texture, or can I not (do I have to change the base image, outside of wow).
  Reply With Quote
01-12-16, 10:27 AM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Texture:SetAlpha(n) where n is a number between zero and one.

Here's a list of texture methods.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
01-12-16, 10:28 AM   #5
TheSecretSquirrel
A Murloc Raider
Join Date: Jan 2016
Posts: 9
Awesome, thank you so much
  Reply With Quote
01-12-16, 10:29 AM   #6
Yukyuk
A Chromatic Dragonspawn
 
Yukyuk's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 179
Use MainBackgroundTexture:SetAlpha(Number)

Number - a floating-point number between 0 and 1: 1 is fully opaque, 0 is transparent (in fact, invisible).
__________________
Better to fail then never have tried at all.
  Reply With Quote
01-12-16, 10:31 AM   #7
Yukyuk
A Chromatic Dragonspawn
 
Yukyuk's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 179
Originally Posted by Yukyuk View Post
Use MainBackgroundTexture:SetAlpha(Number)

Number - a floating-point number between 0 and 1: 1 is fully opaque, 0 is transparent (in fact, invisible).
Aww, beaten by Fizzlemizz
__________________
Better to fail then never have tried at all.
  Reply With Quote
01-12-16, 06:06 PM   #8
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
http://wowprogramming.com/docs/widgets

You can use wowprogramming to look up any type of widget, their defined methods and inherited methods.
__________________

Last edited by MunkDev : 01-12-16 at 06:12 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Issue with textures


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