Texture:SetMask()
Since when do we have this function?
http://wowprogramming.com/docs/widgets/Texture/SetMask Is it a new api function in legion? Until now we only had function to mask minimap textures. |
Heh, I knew this sounded familiar.
I extracted the exact same blp file that the interface uses this function with ("Interface\\CharacterFrame\\TempPortraitAlphaMask"), and it does nothing but make my texture disappear when I try to call SetMask with it. It works when you reference the texture that's inside the game files, but it doesn't appear to be possible to create your own masks. |
You can use any built in Blizzard textures to mask another texture, SetPortraitTexture works very similar, it masks a round circle on the square race icons.
There is a hexagon texture, masked with the HOTS icon from the game: Lua Code:
The problem is that the resolution/edges are highly based on the quailty of the masker AND the original image. Another instresting masker images: Lua Code:
The possibilites are endless. |
I noticed it being used in Blizzard_EncounterJournal.lua when they added the suggesting part.
|
Quote:
Lua Code:
|
lightspark can you post a more detailed example? Maybe even with screenshots?
|
Quote:
Old screenshot piece of an early prototype: Here is code that adjusts texture according to daytime. I used default blizz textures for both artwork and mask: |
Thanks. To bad one can only use masks predefined wow textures. But good to know anyway. Cool idea btw.
|
Quote:
|
The same mask works very well for creating round action buttons. Setting the mask on the icon texture removes the need of using that portrait function that Blizzard has for creating round textures. After setting the mask, the texture can just be updated as per usual with :SetTexture() and it seems it perfectly hides the square border on most icons.
|
Has anybody found a way to recycle the masked textures? Once a mask is applied, Texture:GetTexture() returns a mask ID instead of the actual texture, but attempting to apply that texture reference elsewhere doesn't do anything.
I've noticed that the ID at the end keeps growing, even when you apply the same mask to the same texture, which means it keeps creating new masked textures instead of using the old ones. Since masking seems to be a very expensive task (try applying masks in an update script), I was hoping to find a way to re-use the masked textures I've already created. |
What would be the safest way to completely remove the mask? (if there is any)
|
All times are GMT -6. The time now is 10:45 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI