Thread Tools Display Modes
06-07-14, 02:42 AM   #1
ImportedDj
A Deviate Faerie Dragon
Join Date: Jun 2014
Posts: 10
Extremely New to Making addons for WoW.. Need some help! :)

Hey guys,

So I'm new to WoW Addons, LUA and XML.. I wish to learn these two languages and since they work well with a game i play everyday.. I thought perhaps making addons would be the best starting place.. So Far Im currently trying to figure out how to get a simple image on the screen.. XML has always been a problem for me.. I've avoided it for years.. I've done other programming languages before so Lua should be fairly easy to catch onto.. But Right now im trying to get a simple Image on the screen.. This image will be on the bottom area which serves as a background for Actionbars the char area.. This is what the current image looks like

The current code i have for this is

Code:
 <Ui xmlns="http://www.blizzard.com/wow/ui/"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Texture name="BgIMG" file="Background\BgIMG" alphaMode="ADD">
  <Size>
    <AbsDimension x="13" y="13"/>
  </Size>
  <Anchors>
    <Anchor point="BOTTOM">
      <Offset>
        <AbsDimension x="0" y="0"/>
      </Offset>
    </Anchor>
  </Anchors>
</Texture>
I am probably missing quite a bit.. I have the TOC file loaded and when i check addons in WoW it appears in the list.. However when going into game nothing appears on the screen.. Would anyone be able to assist with this? (Please note. I've been reading up on the wowwiki.com site.. but since every area is so spread out.. and it doesnt give a example or template of what the standard anchors are for a texture.. Im sure i've done something wrong)
  Reply With Quote
06-07-14, 05:01 AM   #2
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
The good news is, you're not gonna need to learn XML at all! At least not until you start making raid frames. :P

As for the issue at hand; for starters a texture needs to be created on a frame. Not sure how you'd do that in XML without creating the frame at the same time. Also the texture path is wrong I noticed now. (see comments)

Anyway, here's how you could do this in Lua:
Code:
local texture = UIParent:CreateTexture()
texture:SetSize(13, 13) -- width, height
texture:SetPoint("BOTTOM") -- if you don't specify offsets that means 0, 0
texture:SetTexture("Interface\\AddOns\\MyAddonFolder\\Background\\BgIMG") -- always put double backslashes in paths if you use citation marks
-- also paths are always relative to the WoW base folder, not your addon folder
UIParent is like the base frame in the UI. If you're making your "first" frame that isn't going to be inside another frame, always use UIParent as its parent. Otherwise UI scaling won't be applied, and also it won't hide with Alt-Z.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
06-07-14, 06:20 AM   #3
ImportedDj
A Deviate Faerie Dragon
Join Date: Jun 2014
Posts: 10
Thanks for the reply! .. So Do i just add in the .LUA to the toc file instead of an XML then?
  Reply With Quote
06-07-14, 07:03 AM   #4
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Yep!

/10chars
__________________
Grab your sword and fight the Horde!
  Reply With Quote
06-07-14, 07:35 AM   #5
ImportedDj
A Deviate Faerie Dragon
Join Date: Jun 2014
Posts: 10
Ok, So i tried what you gave me and it worked however its a big green box, which im presuming means my Ratio's are off.. do you know what ratios it requires in order to be a valid image?
  Reply With Quote
06-07-14, 08:11 AM   #6
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Right. Yeah dimensions need to be a power of two (32, 256, etc) I believe.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
06-07-14, 08:48 AM   #7
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
The image also needs to be a targa or a blp.
  Reply With Quote
06-07-14, 09:17 AM   #8
ImportedDj
A Deviate Faerie Dragon
Join Date: Jun 2014
Posts: 10
Thanks for the help guys Just one last question before i leave you all in peace.. While i have most of my UI coming into place.. How does one remove all of Blizzards UI.. Do i go through and do a :hide() on each component or is there a global option for this?
  Reply With Quote
06-07-14, 11:25 AM   #9
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
No easy way. You could :Hide all of them, but many of them will appear again due to various events. In many cases unregistering relevant events on them will work.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
06-08-14, 08:11 AM   #10
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by ImportedDj View Post
Thanks for the help guys Just one last question before i leave you all in peace.. While i have most of my UI coming into place.. How does one remove all of Blizzards UI.. Do i go through and do a :hide() on each component or is there a global option for this?
If you're talking about the actionbar cluster, take a look at this (marked in yellow):
https://github.com/p3lim-wow/pAction...rd.lua#L39-L74
It's how I hide every unused texture for my actionbar addon, it is basically a list of every texture that I iterate over and replace the textures with nothing (nil), or set them to be see-through (:SetAlpha(0))

If you're talking about everything (like every window), it'll take a lot more work, and you'll end up with something like Aurora

Last edited by p3lim : 06-08-14 at 08:13 AM.
  Reply With Quote
06-08-14, 09:30 AM   #11
ImportedDj
A Deviate Faerie Dragon
Join Date: Jun 2014
Posts: 10
Thanks, I plan on Doing a complete overhaul of the interface, however since im learning on the go.. I'm just trying to pick up basic things..
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Extremely New to Making addons for WoW.. Need some help! :)


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