Thread Tools Display Modes
10-27-14, 02:07 PM   #1
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
A way to set a texture widget to a specific area of a texture ressource?

I could split the triangle into single lines and set a new texture for each single line. But this seems to be a big overkill.

Last edited by Duugu : 10-28-14 at 07:45 AM.
  Reply With Quote
10-28-14, 04:32 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
The only thing I know that actually changes a wow texture is this function:
http://wowprogramming.com/docs/api/SetPortraitToTexture
But that function only make a square become a circle.

The other is for minimap objects only. (You could add a shape).

SetTexCoord will get you knowwhere.

The last and only cropping mechanism we have are scrollframes.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 10-28-14 at 04:37 AM.
  Reply With Quote
10-28-14, 10:43 AM   #3
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
There's a texture:SetMask(texturePath) function, but I've never managed to get it to work with a custom mask.
  Reply With Quote
10-28-14, 12:24 PM   #4
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Originally Posted by semlar View Post
There's a texture:SetMask(texturePath) function, but I've never managed to get it to work with a custom mask.
Ah. Hey. Thanks.

You're right, it is strange. The only way I could produce visible results was with "Atlas" textures instead of "file" textures. And even they are ... totaly distorted crap.

The client states:
usage: SetMask("maskName")
Whatever maskName is, it seems to be different from a simple texture/texture path.

[e] On the other hand ... they are using it like
Lua Code:
  1. self.info.instanceButton.icon:SetMask("Interface\\CharacterFrame\\TempPortraitAlphaMask");
on
Lua Code:
  1. <Texture name="$parentHeroicIcon" file="Interface\EncounterJournal\UI-EJ-HeroicTextIcon" parentKey="heroicIcon" hidden="true">
  2.     <Anchors>
  3.         <Anchor point="BOTTOMRIGHT" x="-7" y="7"/>
  4.     </Anchors>
  5. </Texture>
Weird. TempPortraitAlphaMask could be a special kind of blp. Using an other alpha_depth or alpha_type or mipmaps than the usual blps.

Unfortunatly the clients says also
SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy)....Cannot set tex coords when texture has mask
Whatever, I need to set the coords for my triangle 'mask' dynamically. So, I don't see a way to use it at all.


Originally Posted by zork View Post
The other is for minimap objects only. (You could add a shape).
Are you speaking of http://wowprogramming.com/docs/widge...SetMaskTexture ?
Hm. I could build my texture out of a lot of minimaps. Hm. Sounds strange. I'll dig deeper into that. Thanks.

Last edited by Duugu : 10-28-14 at 12:44 PM.
  Reply With Quote
10-28-14, 12:40 PM   #5
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Originally Posted by Duugu View Post
Hm. I could build my texture out of a lot of minimaps. Hm. Sounds strange. I'll dig deeper into that.
Whatever you're thinking about doing isn't going to work, you can't have multiple minimaps on screen unless they are identical.

Not to mention that they're minimaps, they're not textures.

Last edited by semlar : 10-28-14 at 12:44 PM.
  Reply With Quote
10-28-14, 12:47 PM   #6
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Ok. I'll skip it. Thank's for saving me that time.

So the only remaining approach seems to be to build them line by line or to skip the textured polygon at all. :/ *sigh*

Last edited by Duugu : 10-28-14 at 12:49 PM.
  Reply With Quote
10-28-14, 01:39 PM   #7
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Still not sure what are you trying to do.
  Reply With Quote
10-28-14, 02:11 PM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Resike View Post
Still not sure what are you trying to do.
He deleted the picture from his first post for some reason, but he wants a way to show only a triangular (or possibly other polygonial) region of a texture, rather than a rectangular region.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-28-14, 02:48 PM   #9
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Doh, ja, sorry. I've overwritten my own post by clicking on Edit instead of Quote witout realizing it. *fp*

I'm trying to map a texture onto a meshed polygon. For that I need a way to render a triangle part of a texture.
Example:


Originally Posted by Phanx View Post
He deleted the picture from his first post for some reason, but he wants a way to show only a triangular (or possibly other polygonial) region of a texture, rather than a rectangular region.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » A way to set a texture widget to a specific area of a texture ressource?


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