Riftui

Riftui (https://www.riftui.com/forums/index.php)
-   AddOn Search/Requests (https://www.riftui.com/forums/forumdisplay.php?f=6)
-   -   Placing Images on the UI (https://www.riftui.com/forums/showthread.php?t=231)

Rustycage 03-01-12 11:17 AM

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.

Nivlix 03-05-12 09:52 AM

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"

Rustycage 03-05-12 01:17 PM

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.

Nivlix 03-05-12 01:52 PM

check your PMs


All times are GMT -6. The time now is 04:28 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2022 MMOUI