View Single Post
04-25-13, 10:20 PM   #1
Ledii
A Deviate Faerie Dragon
 
Ledii's Avatar
Join Date: Apr 2013
Posts: 10
Exclamation Need help with SetTexture()

Hey, so I'm trying to learn about how the frames work. So I want to get a image up on the screen.
I have already created a main frame where i put all the other frames of my addon so that I can hide and show all at the same time easily.

The problem I'm having is that there is not very many good tutorials on how to do this and any ways to find out what properties and methods all different objects have. And When I try to load the image I keep getting a green square!

I have this file setup:
AddOns(folder)
> MyAddon(folder)
> > code.toc(file)
> > code.lua(file)
> > Textures(folder)
> > > test.tga(file)

And my code to get the image showing on the screen is like this...
MakeFrame() is a function I made that just assigns the parameters into the wanted frame and returns the result. (Don't worry about this, it works as intended)

local newTex = MakeFrame("ScrollFrame", "FW_Icon", {100, 100}, {100, -150}, mainFrame, nil, nil)
local tex = newTex:CreateTexture(newTex:GetName() .. "_Image", mainFrame)
tex:SetAllPoints()
tex:SetTexture("Interface\\AddOns\\FrameWork\\Textures\\test.tga")
print(prefix .. "Loaded " .. '"' .. tex:GetTexture() .. '"')

I did a google search on "wow lua settexture green" and tried everything i found. No use though.
__________________
Take it as it comes...
  Reply With Quote