Thread Tools Display Modes
05/27/16, 11:59 PM   #1
dorrino
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 50
CenterScreenAnnounce and flipped texture

Hi there.

In my addon i'm trying to output a horizontally flipped ZOS icon (which corresponds to the current subzone POI icon) along with some text to 'CenterScreenAnnounce' and can't seems to find a way to do it.

I can easily flip the icon in a Texture Control using SetTextureCoords(1,0,0,1), but i can't figure a way to put the flipped icon version into CenterScreenAnnounce since at least the AddMessage method accepts only text messages. I can use a default version of the icon using zo_iconTextFormat, but since it only accepts path to the icon, which i obviously don't have, i can't use it for the flipped texture.

My question is: is there a way to supply the modified texture from a Texture Control as an input to CenterScreenAnnounce object?

Or any other way to take a ZOS icon, flip it horizontally and make it appear in a message in CenterScreenAnnounce queue?

Thanks

PS. Totally unrelated. It seems that EVENT_COMBAT_EVENT nevers fires for ACTION_RESULT_ROOTED. I observed that ACTION_RESULT_SNARED fires for both roots and snares, though. Is there a way to determine if your character is rooted and rooted only? SCT rooted event seems to fire alright, but how do you register for SCT events?

Last edited by dorrino : 05/28/16 at 12:34 AM.
  Reply With Quote
05/28/16, 06:19 AM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
Texture paths in the game's UI are generally easy to know. Either the path is returned by some method, or well known beforehand, or you can just retrieve it via GetTextureFilename if you already have a texture control. For the current POI icon you can use GetCurrentSubZonePOIIndices and GetPOIMapInfo for example:
Lua Code:
  1. local function GetCurrentSubZonePOITexture()
  2.     local zoneIndex, poiIndex = GetCurrentSubZonePOIIndices()
  3.     if(zoneIndex) then
  4.         local _, _, _, texture = GetPOIMapInfo(zoneIndex, poiIndex)
  5.         return texture
  6.     end
  7.     return nil
  8. end
Flipping it with zo_iconTextFormat then just requires a negative horizontal width.

About the totally unrelated question I have no idea. Maybe someone with more insight into the combat API and new SCT API can answer it.
  Reply With Quote
05/28/16, 09:18 AM   #3
dorrino
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 50
Originally Posted by sirinsidiator View Post
Texture paths in the game's UI are generally easy to know. Either the path is returned by some method, or well known beforehand, or you can just retrieve it via GetTextureFilename if you already have a texture control.
It's interesting, MyTextureControl:GetTextureFilename() returns an error that GetTextureFilename() is nil. Maybe i'm doing something wrong.

Anyway is it really that the game takes a texture path, draws a texture in a texture control and then if you alter the texture controls is creates a dynamic texture path for that control?

My assumption was that if let's say we set MyTextureControl:SetTexture("mypath/mytexture.dds") then no matter what transformation on the screen the MyTextureControl had it always point to the same texture path ("mypath/mytexture.dds") unless you explicitly replace that texture path with a new one.

So

MyTextureControl:SetTexture("mypath/mytexture.dds")
MyTextureControl:SetTextureCoords(0.5,1,0.5,1)
MyTextureControl:GetTexture() - not sure it's a correct function to call;

will still return "mypath/mytexture.dds".

Is it correct?

But as to my original question - THANK YOU. Negative width in zo_iconTextFormat did the trick. That was exactly what i was looking for.

Last edited by dorrino : 05/28/16 at 09:21 AM.
  Reply With Quote
05/28/16, 10:20 AM   #4
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
You are right. The path always stays the same regardless of what you do with the texture control.
The method name is case-sensitive. Looks like I wrote it wrong. The correct one is "GetTextureFileName".
  Reply With Quote
05/28/16, 03:53 PM   #5
dorrino
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 50
Originally Posted by sirinsidiator View Post
You are right. The path always stays the same regardless of what you do with the texture control.
Then i have a question. Since apparently we can not export a texture in the runtime, the only way to apply textures to text inputs is zo_iconTextFormat (or generally string.format) and it only works with already existing paths to textures. Is there a way to modify a texture (like Texture Control object) and then use it as a source for zo_iconTextFormat? Is there a way to feed the modified texture to a function with text input?

Manually exporting, photoshopping and putting it back obviously only works if you know exactly what textures your addon will use.

The only approach i see right now is to calculate the position of the target text output on the screen and then synchronize it with a texture control. Is there anything else besides that?
  Reply With Quote
05/29/16, 01:59 AM   #6
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
AFAIK there is no way to feed a texture control to a string via icon text format, so manually aligning may be the only way to do it.

What exactly do you want to do with these textures? Depending on that, there may be ways to do it with just text formats.
  Reply With Quote
05/30/16, 02:44 PM   #7
dorrino
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 50
Originally Posted by sirinsidiator View Post
AFAIK there is no way to feed a texture control to a string via icon text format, so manually aligning may be the only way to do it.

What exactly do you want to do with these textures? Depending on that, there may be ways to do it with just text formats.
Thanks, i figured as much.

You've already provided me the solution to flipping textures in texts, so my current problem is solved.

I've been asking general questions on how Lua/ESO api works. I'm very new to this. Thanks for explanations
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » CenterScreenAnnounce and flipped texture


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