Thread Tools Display Modes
05-23-20, 07:43 AM   #1
Lybrial
A Flamescale Wyrmkin
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 120
How to make circular frames?

Hi,

is there a ways to create rounded / circular frames?
  Reply With Quote
05-23-20, 09:30 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
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.
__________________
  Reply With Quote
05-24-20, 02:21 AM   #3
Lybrial
A Flamescale Wyrmkin
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 120
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?
  Reply With Quote
05-24-20, 04:53 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
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.
__________________
  Reply With Quote
05-24-20, 07:46 AM   #5
Lybrial
A Flamescale Wyrmkin
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 120
Thanks, you made it clear. I guess I know what I have to do.
  Reply With Quote
05-24-20, 08:46 AM   #6
jeruku
A Cobalt Mageweaver
 
jeruku's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 223
SetPortraitToTexture doesn't create circular frames but it will create circular textures by clipping the square edges for you.
  Reply With Quote
05-24-20, 01:15 PM   #7
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
Originally Posted by jeruku View Post
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 )
__________________
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How to make circular frames?

Thread Tools
Display Modes

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