WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   How to make circular frames? (https://www.wowinterface.com/forums/showthread.php?t=58017)

Lybrial 05-23-20 07:43 AM

How to make circular frames?
 
Hi,

is there a ways to create rounded / circular frames?

Xrystal 05-23-20 09:30 AM

From what I can recall is that you create the square frames as normal but the images alpha out the areas not needed to be displayed.

You might want to have a look at how Blizzard does their frames that have circular images on.

https://www.townlong-yak.com/framexml/live


Find a frame and then locate the files likely to hold their layout ( xml ) and functionality ( lua ) from the list of files in the link above.

Lybrial 05-24-20 02:21 AM

Thx for the answer.

I could not find where blizzard creates circular frames. The player portrait for example is already a round texture. And the rest of the round stuff I could found were textures.

I dont think that I know what you mean with "alpha out the areas not needed to be displayed".
You can set an alpha on specific regions of a frame? I could imagine that showing a border would not work with this approach, right?

Xrystal 05-24-20 04:53 AM

Images are not really circular...

They are square/rectangular with the section to not be visible alpha'd out.

Alpha is simply the case of setting parts of the texture to not be visible. If the images didn't have the area around the circular area alpha'd out there would be a white section all around the image.

This is the player frame file for example:
https://www.townlong-yak.com/framexm...layerFrame.xml

And this is the section where the player's image is placed. Notice it is fully square and not round. The image that is fitted in will simply not show the part it doesn't want shown.

Lua Code:
  1. <Texture name="PlayerPortrait">
  2.           <Size x="64" y="64"/>
  3.           <Anchors>
  4.             <Anchor point="TOPLEFT" x="42" y="-12"/>
  5.           </Anchors>
  6.         </Texture>

So, as long as you have a texture that has the areas of the image to not be displayed set to alpha state of 0 and the areas you want displayed to an alpha state of 1 ( or any value above 0 for varying levels of visibility ) and some texture elements designed to hold that image. It should work fine.

I can't remember off hand which paint packages will work this way but I think I used to use Paint Shop Pro for alpha adjustments to images and I think they can create TGA images which were usable by WOW way back when.

I found this page which may help you create images, if it lets you save in tga format for use in wow. Otherwise you may need a converter tool to change from the file format to tga. If you have your own art package then you may be able to use this with the tools available in that art package.
https://www.thegunnysack.com/how-to-crop-circles/

Hopefully someone with more recent knowledge will be able to help further.

Lybrial 05-24-20 07:46 AM

Thanks, you made it clear. I guess I know what I have to do.

jeruku 05-24-20 08:46 AM

SetPortraitToTexture doesn't create circular frames but it will create circular textures by clipping the square edges for you.

Xrystal 05-24-20 01:15 PM

Quote:

Originally Posted by jeruku (Post 336017)
SetPortraitToTexture doesn't create circular frames but it will create circular textures by clipping the square edges for you.

I did forget about that command rofl, but it may not work for non blp textures, unless that has been changed recently ( going by the info on that link )


All times are GMT -6. The time now is 04:03 PM.

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