WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Graphics Help (https://www.wowinterface.com/forums/forumdisplay.php?f=14)
-   -   Circluar frame/mask with kgPanels - help me understand how? (https://www.wowinterface.com/forums/showthread.php?t=35851)

Shanyn 10-17-10 02:47 PM

Circluar frame/mask with kgPanels - help me understand how?
 
So let's say I have a square unit portrait, and I'd like to make it into a circle with a thin border. Like this:


Can someone give me the basics on how I might make all the square corners and bits outside the circular texture transparent?

Note: I understand photoshop. Alpha channels, masks, all that stuff--I can make any TEXTURES I need for this without explanation. What I don't understand is the actual execution. How many textures I need, what to mask in which--it seems like I'd take a transparent texture and mask out the corners, but... if it's a transparent texture... wouldn't it do nothing?

I know it's possible; I have an example of a UI that does this (here), but I've looked at the textures in the art pack and still can't figure out exactly how.

Maul 10-17-10 04:21 PM

You have to trick the eye. If you look at circle skins for buttons, you will notice they have a black ring on the outside or inside of the visual circle to cover the square edges.

There is no true way to mask-off a texture. I have asked for this in the past but was told that the graphics engine the UI uses would have to be re-done, which would be low-priority since the existing engine works fine for Blizzard's UI.

Grimsin 10-21-10 07:54 PM

that isn't true for the minimap though is it? i know i masked the minimap from circle to square and back again via Minimap:SetMaskTexture([[Interface\BUTTONS\WHITE8X8]])

without having to compensate the edges. i always thought this is how the circle buttons were done but as i have never used circle buttons other then the ones that were in Necrosis i have no idea.

has anyone tried setting the mask texture to their own mask file? or to any number of the files in bliz's art that would work? is that not how the fancy hud bars are done to?

edit - and to answer the initial question to some degree - No, you would not use a transparent texture but rather you would have to set the player portrait texture mask to a circle, a white one? I think. At lest that is how i would think to do it. That is how i did it with the minimap via the code line i entered above. This may be something only the minimap can do but as i have seen a ton of round char portrait stuff and i know the char portrait stuff has a ton of special functions in its code, i would go look through that and see if you find something there maybe and try that line above.

Shanyn 10-22-10 12:43 AM

Thank you for the assistance, I'll look into that. :) I know the basic circular char portraits are actually built in to WoW itself, but I was looking to do 3D ones, which are only ever square in any unit frame addon I've used.

jeffy162 11-13-10 01:10 PM

I know this is a bit late, but have a look at how SquidFrame does it. I'm not sure if the 3D portraits are round, though.

Lyelu 11-23-10 05:36 AM

I was working on the same thing... Maul's right. The only place that masking works in-game is in the minimap.
:(

If you will look closely at the image you linked, the layers will be like this, from bottom to top:

1. A round background, which is transparent at the outer edges.
2. A square 3d portrait, which is smaller than the background.
3. A round overlay, which shades away the bottom edges, so you can't see the fact that the very bottom of the 3d portrait isn't there.

I'll be done with my oUF in a week or so, if you want to bookmark my portal, then you could use the oUF code after it's done. I also have a page there about graphics, if you need to know how to get your TGAs to be transparent.

It does seem like Blizz uses round portraits, but I am fairly (90%) certain there's no way we can. Which makes no sense, but I'm not queen of the world so I didn't get to decide.

Xubera 11-23-10 12:26 PM

SetPortraitToTexture(texture or "texture", "texturePath") - Sets the texture to be displayed from a file applying a circular opacity mask making it look round like portraits.

Dawn 11-23-10 03:37 PM

Quote:

Originally Posted by Xubera (Post 219247)
SetPortraitToTexture(texture or "texture", "texturePath") - Sets the texture to be displayed from a file applying a circular opacity mask making it look round like portraits.

That works for 3D, too? Seems like this is only used for 2D. Worth a try, though. :rolleyes:

Lyelu 11-23-10 05:31 PM

I did try earlier (for a good hour this morning, while researching the topic) and couldn't even get WoW to recognize the name SetPortraitToTexture or SetPortraitTexture. Want to provide a working example, please? I think if they did work, which they might outside my oUF, but I couldn't convince them to work in oUF), then the resulting image would probably be flat, leading to the look like in SquidFrame picture.

zork 11-24-10 12:50 AM

Marked for testing.

Xubera 11-24-10 06:57 AM

i didnt realize it was 3d, didnt see that in your initial post

Elloria 11-24-10 08:38 AM

Man if you guys figure this out i have a few interfaces that would certainly benefit from this.

Elloria 07-04-11 01:06 PM

Any luck on figuring this out yet?

zork 07-06-11 05:47 AM

Yeah I did. It is worthless. What it does it applies an radial mask to a rectangular texture. But you can do the same and even better by adding a radial alpha layer yourself in the TGA file.

It only makes sense if you want to apply it to textures that have no radial mask by itself.

Where it _can_ be cool is actionbutton and aura icon textures. (You could make them all radial)

My Test: http://code.google.com/p/rothui/sour...trunk/rGalaxy/
http://code.google.com/p/rothui/sour...xy/rGalaxy.lua


All times are GMT -6. The time now is 11:39 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI