Thread Tools Display Modes
11/07/14, 06:08 AM   #1
geron
Join Date: Nov 2014
Posts: 4
2 noob questions :)

Hey, I'm totally new to lua and xml, all I did so far was following the first addon tutorial on the wiki (http://wiki.esoui.com/Writing_your_first_addon)

It's working well so far, but I have two problems that I can't find a solution for...

1) I would like to increase the size of the "fighting" text appearing on my screen. It is a label in the xml file, is there a way to just incease the font size somehow? What I found already was that I can change the font to something different, but that ends up being smaller. And I found a scale command that I can add, but that looks horrible xD

2) When the "fighting" label is visible on the screen and I press ESC to enter the settings etc. the label stays on top of everything. Most other addons just disappear when I press ESC and come back when I continue the game. How are they doing this?

Thanks
  Reply With Quote
11/07/14, 07:27 AM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by geron View Post
1) I would like to increase the size of the "fighting" text appearing on my screen. It is a label in the xml file, is there a way to just incease the font size somehow? What I found already was that I can change the font to something different, but that ends up being smaller. And I found a scale command that I can add, but that looks horrible xD
Here's how you can set font properties: http://www.esoui.com/forums/showpost...77&postcount=4

Here are predefined fonts:
xml Code:
  1. <GuiXml>
  2.     <String name="MEDIUM_FONT" value="EsoUi/Common/Fonts/Univers57.otf" />
  3.     <String name="BOLD_FONT" value="EsoUi/Common/Fonts/Univers67.otf" />
  4.     <String name="CHAT_FONT" value="EsoUi/Common/Fonts/Univers57.otf" />
  5.     <String name="ANTIQUE_FONT" value="EsoUI/Common/Fonts/ProseAntiquePSMT.otf" />
  6.     <String name="HANDWRITTEN_FONT" value="EsoUI/Common/Fonts/Handwritten_Bold.otf" />
  7.     <String name="STONE_TABLET_FONT" value="EsoUI/Common/Fonts/TrajanPro-Regular.otf" />
  8.     <String name="GAMEPAD_LIGHT_FONT" value="EsoUI/Common/Fonts/FuturaStd-CondensedLight.otf" />
  9.     <String name="GAMEPAD_MEDIUM_FONT" value="EsoUI/Common/Fonts/FuturaStd-Condensed.otf" />
  10.     <String name="GAMEPAD_BOLD_FONT" value="EsoUi/Common/Fonts/FuturaStd-CondensedBold.otf" />
  11.  
  12.     <Font name="ZoFontWinH1" font="$(BOLD_FONT)|30|soft-shadow-thick" />
  13.     <Font name="ZoFontWinH2" font="$(BOLD_FONT)|24|soft-shadow-thick" />
  14.     <Font name="ZoFontWinH3" font="$(BOLD_FONT)|20|soft-shadow-thick" />
  15.     <Font name="ZoFontWinH4" font="$(BOLD_FONT)|18|soft-shadow-thick" />
  16.     <Font name="ZoFontWinH5" font="$(BOLD_FONT)|16|soft-shadow-thick" />
  17.  
  18.     <Font name="ZoFontWinT1" font="$(BOLD_FONT)|18|soft-shadow-thin" />
  19.     <Font name="ZoFontWinT2" font="$(BOLD_FONT)|16|soft-shadow-thin" />
  20.  
  21.     <Font name="ZoFontGame" font="$(MEDIUM_FONT)|18|soft-shadow-thin" />
  22.     <Font name="ZoFontGameMedium" font="$(MEDIUM_FONT)|18|soft-shadow-thin" />
  23.     <Font name="ZoFontGameBold" font="$(BOLD_FONT)|18|soft-shadow-thin" />
  24.     <Font name="ZoFontGameOutline" font="$(BOLD_FONT)|18|soft-shadow-thin" />
  25.     <Font name="ZoFontGameShadow" font="$(BOLD_FONT)|18|soft-shadow-thin" />
  26.  
  27.     <Font name="ZoFontGameSmall" font="$(BOLD_FONT)|13|soft-shadow-thin" />
  28.     <Font name="ZoFontGameLarge" font="$(MEDIUM_FONT)|18|soft-shadow-thin" />
  29.     <Font name="ZoFontGameLargeBold" font="$(BOLD_FONT)|18|soft-shadow-thick" />
  30.     <Font name="ZoFontGameLargeBoldShadow" font="$(BOLD_FONT)|18|soft-shadow-thick" />
  31.  
  32.     <Font name="ZoFontHeader" font="$(BOLD_FONT)|18|soft-shadow-thick" />
  33.     <Font name="ZoFontHeader2" font="$(BOLD_FONT)|20|soft-shadow-thick" />
  34.     <Font name="ZoFontHeader3" font="$(BOLD_FONT)|24|soft-shadow-thick" />
  35.     <Font name="ZoFontHeader4" font="$(BOLD_FONT)|26|soft-shadow-thick" />
  36.  
  37.     <Font name="ZoFontCallout" font="$(BOLD_FONT)|36|soft-shadow-thick" />
  38.     <Font name="ZoFontCallout2" font="$(BOLD_FONT)|48|soft-shadow-thick" />
  39.     <Font name="ZoFontCallout3" font="$(BOLD_FONT)|54|soft-shadow-thick" />
  40.  
  41.     <Font name="ZoFontEdit" font="$(MEDIUM_FONT)|18|shadow"/>
  42.     <Font name="ZoLargeFontEdit" font="$(BOLD_FONT)|25|shadow"/>
  43.    
  44.     <Font name="ZoFontChat" font="$(CHAT_FONT)|18|soft-shadow-thin" />
  45.     <Font name="ZoFontEditChat" font="$(CHAT_FONT)|18|shadow" />
  46.    
  47.     <Font name="ZoFontWindowTitle" font="$(BOLD_FONT)|30|soft-shadow-thick" />
  48.     <Font name="ZoFontWindowSubtitle" font="$(BOLD_FONT)|18|soft-shadow-thick" />
  49.    
  50.     <Font name="ZoFontTooltipTitle" font="$(BOLD_FONT)|22" />
  51.     <Font name="ZoFontTooltipSubtitle" font="$(MEDIUM_FONT)|18" />
  52.    
  53.     <Font name="ZoFontAnnounce" font="$(BOLD_FONT)|28|soft-shadow-thick" />
  54.     <Font name="ZoFontAnnounceMessage" font="$(BOLD_FONT)|24|soft-shadow-thick" /> <!-- and a better name for this one... -->
  55.     <Font name="ZoFontAnnounceSmall" font="$(BOLD_FONT)|16|soft-shadow-thick" />
  56.     <Font name="ZoFontAnnounceMedium" font="$(BOLD_FONT)|24|soft-shadow-thick" />
  57.     <Font name="ZoFontAnnounceLarge" font="$(BOLD_FONT)|36|soft-shadow-thick" />
  58.  
  59.     <Font name="ZoFontCenterScreenAnnounceLarge" font="$(BOLD_FONT)|40|soft-shadow-thick" />
  60.     <Font name="ZoFontCenterScreenAnnounceSmall" font="$(BOLD_FONT)|30|soft-shadow-thick" />
  61.    
  62.     <Font name="ZoFontAlert" font="$(BOLD_FONT)|24|soft-shadow-thick" />
  63.    
  64.     <Font name="ZoFontConversationName" font="$(BOLD_FONT)|28|soft-shadow-thick" />
  65.     <Font name="ZoFontConversationText" font="$(BOLD_FONT)|24|soft-shadow-thick" />
  66.     <Font name="ZoFontConversationOption" font="$(BOLD_FONT)|22|soft-shadow-thick" />
  67.     <Font name="ZoFontConversationQuestReward" font="$(BOLD_FONT)|20|soft-shadow-thick" />
  68.  
  69.     <Font name="ZoFontKeybindStripKey" font="$(MEDIUM_FONT)|20|soft-shadow-thin" />
  70.     <Font name="ZoFontKeybindStripDescription" font="$(BOLD_FONT)|25|soft-shadow-thick" />
  71.     <Font name="ZoFontDialogKeybindDescription" font="$(BOLD_FONT)|20|soft-shadow-thick" />
  72.  
  73.     <Font name="ZoInteractionPrompt" font="$(BOLD_FONT)|24|soft-shadow-thick" />
  74.    
  75.     <Font name="ZoFontBookPaper" font="$(ANTIQUE_FONT)|20" />
  76.     <Font name="ZoFontBookSkin" font="$(ANTIQUE_FONT)|20" />
  77.     <Font name="ZoFontBookRubbing" font="$(ANTIQUE_FONT)|20" />
  78.     <Font name="ZoFontBookLetter" font="$(HANDWRITTEN_FONT)|20" />
  79.     <Font name="ZoFontBookNote" font="$(HANDWRITTEN_FONT)|22" />
  80.     <Font name="ZoFontBookScroll" font="$(HANDWRITTEN_FONT)|26" />
  81.     <Font name="ZoFontBookTablet" font="$(STONE_TABLET_FONT)|30|soft-shadow-thick" />
  82.     <Font name="ZoFontBookPaperTitle" font="$(ANTIQUE_FONT)|30" />
  83.     <Font name="ZoFontBookSkinTitle" font="$(ANTIQUE_FONT)|30" />
  84.     <Font name="ZoFontBookRubbingTitle" font="$(ANTIQUE_FONT)|30" />
  85.     <Font name="ZoFontBookLetterTitle" font="$(HANDWRITTEN_FONT)|30" />
  86.     <Font name="ZoFontBookNoteTitle" font="$(HANDWRITTEN_FONT)|32" />
  87.     <Font name="ZoFontBookScrollTitle" font="$(HANDWRITTEN_FONT)|34" />
  88.     <Font name="ZoFontBookTabletTitle" font="$(STONE_TABLET_FONT)|48|soft-shadow-thick" />
  89.  
  90.     <Font name="ZoFontCreditsHeader" font="$(BOLD_FONT)|24" />
  91.     <Font name="ZoFontCreditsText" font="$(BOLD_FONT)|18" />
  92.  
  93.     <Font name="ZoFontGamepad54" font="$(GAMEPAD_MEDIUM_FONT)|54|soft-shadow-thick" />
  94.     <Font name="ZoFontGamepad48" font="$(GAMEPAD_MEDIUM_FONT)|48|soft-shadow-thick" />
  95.     <Font name="ZoFontGamepad40" font="$(GAMEPAD_MEDIUM_FONT)|40|soft-shadow-thick" />
  96.     <Font name="ZoFontGamepad37" font="$(GAMEPAD_MEDIUM_FONT)|37|soft-shadow-thick" />
  97.     <Font name="ZoFontGamepad32" font="$(GAMEPAD_MEDIUM_FONT)|32|soft-shadow-thick" />
  98.     <Font name="ZoFontGamepad30" font="$(GAMEPAD_MEDIUM_FONT)|30|soft-shadow-thick" />
  99.     <Font name="ZoFontGamepad24" font="$(GAMEPAD_MEDIUM_FONT)|24|soft-shadow-thick" />
  100.     <Font name="ZoFontGamepad22" font="$(GAMEPAD_MEDIUM_FONT)|22|soft-shadow-thick" />
  101.     <Font name="ZoFontGamepad20" font="$(GAMEPAD_MEDIUM_FONT)|20|soft-shadow-thick" />
  102.     <Font name="ZoFontGamepad18" font="$(GAMEPAD_MEDIUM_FONT)|18|soft-shadow-thick" />
  103.     <Font name="ZoFontGamepad16" font="$(GAMEPAD_MEDIUM_FONT)|16|soft-shadow-thick" />
  104.    
  105.     <Font name="ZoFontGamepadCondensed54" font="$(GAMEPAD_LIGHT_FONT)|54|soft-shadow-thick" />
  106.     <Font name="ZoFontGamepadCondensed48" font="$(GAMEPAD_LIGHT_FONT)|48|soft-shadow-thick" />
  107.     <Font name="ZoFontGamepadCondensed40" font="$(GAMEPAD_LIGHT_FONT)|40|soft-shadow-thick" />
  108.     <Font name="ZoFontGamepadCondensed37" font="$(GAMEPAD_LIGHT_FONT)|37|soft-shadow-thick" />
  109.     <Font name="ZoFontGamepadCondensed32" font="$(GAMEPAD_LIGHT_FONT)|32|soft-shadow-thick" />
  110.     <Font name="ZoFontGamepadCondensed30" font="$(GAMEPAD_LIGHT_FONT)|30|soft-shadow-thick" />
  111.     <Font name="ZoFontGamepadCondensed24" font="$(GAMEPAD_LIGHT_FONT)|24|soft-shadow-thick" />
  112.     <Font name="ZoFontGamepadCondensed22" font="$(GAMEPAD_LIGHT_FONT)|22|soft-shadow-thick" />
  113.     <Font name="ZoFontGamepadCondensed20" font="$(GAMEPAD_LIGHT_FONT)|20|soft-shadow-thick" />
  114.     <Font name="ZoFontGamepadCondensed18" font="$(GAMEPAD_LIGHT_FONT)|18|soft-shadow-thick" />
  115.     <Font name="ZoFontGamepadCondensed16" font="$(GAMEPAD_LIGHT_FONT)|16|soft-shadow-thick" />
  116.  
  117.     <Font name="ZoFontGamepadBold54" font="$(GAMEPAD_BOLD_FONT)|54|soft-shadow-thick" />
  118.     <Font name="ZoFontGamepadBold48" font="$(GAMEPAD_BOLD_FONT)|48|soft-shadow-thick" />
  119.     <Font name="ZoFontGamepadBold40" font="$(GAMEPAD_BOLD_FONT)|40|soft-shadow-thick" />
  120.     <Font name="ZoFontGamepadBold37" font="$(GAMEPAD_BOLD_FONT)|37|soft-shadow-thick" />
  121.     <Font name="ZoFontGamepadBold32" font="$(GAMEPAD_BOLD_FONT)|32|soft-shadow-thick" />
  122.     <Font name="ZoFontGamepadBold30" font="$(GAMEPAD_BOLD_FONT)|30|soft-shadow-thick" />
  123.     <Font name="ZoFontGamepadBold24" font="$(GAMEPAD_BOLD_FONT)|24|soft-shadow-thick" />
  124.     <Font name="ZoFontGamepadBold22" font="$(GAMEPAD_BOLD_FONT)|22|soft-shadow-thick" />
  125.     <Font name="ZoFontGamepadBold20" font="$(GAMEPAD_BOLD_FONT)|20|soft-shadow-thick" />
  126.     <Font name="ZoFontGamepadBold18" font="$(GAMEPAD_BOLD_FONT)|18|soft-shadow-thick" />
  127.     <Font name="ZoFontGamepadBold16" font="$(GAMEPAD_BOLD_FONT)|16|soft-shadow-thick" />
  128.        
  129. <!-- Suspect fonts that should be evaluated for being replaced with something more consistent -->
  130.     <Font name="ZoFontBossName" font="$(BOLD_FONT)|20|soft-shadow-thin" />
  131.     <Font name="ZoFontBoss" font="$(BOLD_FONT)|12|soft-shadow-thin" />
  132. </GuiXml>

You can use either SetFont("ZoFontGameLarge") or SetFont("$(MEDIUM_FONT)|18|soft-shadow-thin") or SetFont("EsoUi/Common/Fonts/Univers57.otf|18|soft-shadow-thin"), result should be the same.

Originally Posted by geron View Post
2) When the "fighting" label is visible on the screen and I press ESC to enter the settings etc. the label stays on top of everything. Most other addons just disappear when I press ESC and come back when I continue the game. How are they doing this?
Simplest way is to create a TopLevelControl, put in a scene fragment, and add that fragment to scenes it should display in. And create all your controls as descendants of the TopLevelControl.
xml Code:
  1. <TopLevelControl name="myAddonWidget" hidden="true">
  2.     <OnInitialized>
  3.         myAddon.initWidget(self)
  4.     </OnInitialized>
  5.     ...
  6. </TopLevelControl>
Lua Code:
  1. myAddon = {}
  2.  
  3. function myAddon.initWidget(control)
  4.     local fragment = ZO_SimpleSceneFragment:New(control)
  5.     HUD_SCENE:AddFragment(fragment)
  6.     HUD_UI_SCENE:AddFragment(fragment)
  7.     SIEGE_BAR_SCENE:AddFragment(fragment)
  8.     ...
  9. end
  Reply With Quote
11/07/14, 10:50 PM   #3
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by geron View Post
Hey, I'm totally new to lua and xml, all I did so far was following the first addon tutorial on the wiki (http://wiki.esoui.com/Writing_your_first_addon)

It's working well so far, but I have two problems that I can't find a solution for...

1) I would like to increase the size of the "fighting" text appearing on my screen. It is a label in the xml file, is there a way to just incease the font size somehow? What I found already was that I can change the font to something different, but that ends up being smaller. And I found a scale command that I can add, but that looks horrible xD
You can do what Merlight suggested, note though that you can also change the font size in the font definitions:
Lua Code:
  1. SetFont("$(MEDIUM_FONT)|18|soft-shadow-thin")
  2. SetFont("$(MEDIUM_FONT)|24|soft-shadow-thin")
  3. SetFont("$(MEDIUM_FONT)|36|soft-shadow-thin")

I don't know what the maximum font size is, but if you find one you like and there is not a larger version of it, just change those numbers.
  Reply With Quote
11/08/14, 03:08 PM   #4
geron
Join Date: Nov 2014
Posts: 4
Thank you both for your answers, everything is working now as i want it to

For the scenes i used HUD_SCENE and HUD_UI_SCENE, but im wondering what is the difference of those 2?
SIEGE_BAR_SCENE seems to be self explanatory^^
And also is there a list of all scenes available?
  Reply With Quote
11/08/14, 03:43 PM   #5
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by geron View Post
Thank you both for your answers, everything is working now as i want it to

For the scenes i used HUD_SCENE and HUD_UI_SCENE, but im wondering what is the difference of those 2?
SIEGE_BAR_SCENE seems to be self explanatory^^
And also is there a list of all scenes available?
SCENE_MANAGER.scenes.hud -- Is the normal game scene when you don't have any...other scenes open like the inventory, quest journal, ect... and your mouse movements control the camera

SCENE_MANAGER.scenes.hudui -- Is the normal game scene when you dont have any other open scenes like the inventory, quest journal, ect... BUT when your mouse is free & moving it moves a cursor around on the screen...(listed as "Toggle In-Game Cursor" in the keybindings).

I don't know of a list of scenes anywhere, but you can use zgoo to view them. If you have zgoo installed you can type:
/zgoo SCENE_MANAGER -- This is the scene manager that has all of the scene relevant stuff in it, controls all of the scenes

and then scroll down to scenes & click on it to open it up.

Or just go directly to the list of scenes by typing:
/zgoo SCENE_MANAGER.scenes
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » 2 noob questions :)


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