Reply
Thread Tools Display Modes
Unread 03-01-12, 11:17 AM   #1
Rustycage
Claw of Regulos
 
Rustycage's Avatar
Join Date: Jun 2011
Posts: 20
Placing Images on the UI

I was wondering, is it possible to place box shaped images on the UI, so you can create sections in a UI design, and put the frames or anything you want there, on top of them and make them fit within the correct place?

For example, there is a WoWInterface UI addon pack, that has images where damage meter and other different stuff fit in sections on top of some images, the UI is called LUI. I wanted to create something similar, with the default UI, but combine sections that aren't combined, and maybe later incorporate the myUI unit frames in there somehow, to make it more custom, for those that would want to use them. I figure if some addons can have custom images, why can't you put images where you want, and put stuff on top of them, that way you can make a custom UI to some degree, despite the API?

What do you guys think, can it be done, and if so, how do we go about doing that. I hope I can understand it, because I want to try to do it. I don't know how to code, but I want to learn.
Rustycage is offline   Reply With Quote
Unread 03-05-12, 09:52 AM   #2
Nivlix
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2012
Posts: 6
You would need to create a context, and then create a set of texture frames for that context. Once you have the frames you could set the texture to whatever image file you wanted, set the width, height, position, and basically put it where you wanted it. Then you would set the layer to 1. I believe that most of the default UI elements would be drawn above a layer 1 frame. If you wanted for instance the L shape like LUI's bottom corners you would create two frames like this

Code:
mcf = UI.CreateContext("My Custom Frames")
lvert = UI.CreateFrame("Texture", "LeftVertFrame", mcf)
lhori = UI.CreateFrame("Texture", "LeftHoriFrame", mcf)

lvert.SetTexture = ("<SOURCE>", "<FILE>")
lvert.SetHeight(200)
lvert.SetWidth(50)
lvert.SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 10, 10)
lvert.SetLayer(1)

lhori.SetTexture = ("<SOURCE>", "<FILE>")
lhori.SetHeight(50)
lhori.SetWidth(200)
lhori.SetPoint("BOTTOMLEFT", lvert, "BOTTOMRIGHT", 0, 0)
lvert.SetLayer(1)
The above example is very basic and is not complete, but should give you a good starting point
<SOURCE> = the source of the file "Rift" if its a texture provided by trion or "Your Addon Name" for one you are providing
<FILE> = the location of the file relative to the source, so lets say you used a file, texture.png, that you provided and its in a folder called Textures which is inside your addon folder then it would be "Textures\\texture.png"
Nivlix is offline   Reply With Quote
Unread 03-05-12, 01:17 PM   #3
Rustycage
Claw of Regulos
 
Rustycage's Avatar
Join Date: Jun 2011
Posts: 20
Thank you. I'll fiddle with what you gave me, and try to get it working. I'm so new to this stuff, but I have some visions in my head that would really make some awesome UI stuff.
Rustycage is offline   Reply With Quote
Unread 03-05-12, 01:52 PM   #4
Nivlix
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2012
Posts: 6
check your PMs
Nivlix is offline   Reply With Quote
Reply

Go BackRiftui » AddOns, Layouts and Macros » AddOn Search/Requests » Placing Images on the UI


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