Jump to content


Photo

Questions regarding text objects

helprequestpleasenovicenewbietextobjects

    3 replies to this topic

    #1 allibear17

    allibear17

      Newbie

    • Members
    • Pip
    • 9 posts

      Posted 15 March 2016 - 04:05 AM

      Hi everyone.  Long time windower fan, new to lua and coding in general.  Most of my coding experience is in actionscript and some minor C++ classes.

      I'm attempting to write my own addon that will display the Party's HP% on screen, because I can't stand having to look in the corner constantly as a healer.  I'm having a little trouble getting it to work.  I've been reading through the texts.lua alongside the developer wiki and looking at other code, such as enemybar and tparty.  I was hoping someone might find a little time to help me understand a few portions.
       

       

      p1hpp = texts.new(' HP: ${hpp|(100)}%', my_settings)
       

      This should create a text object, with the settings I've defined (I copied the default from texts.lua and made changes to them as needed) which will display "HP: 100%" as a default, or replace 100, with whatever value is in p1hpp.hpp correct?

      When I take the party info, and set party.p1.hpp to p1hpp.hpp, do I need to type cast it as a str? 

      Do I need to define .hpp inside settings?

       

       

      Thanks in advance if you make the time to reply! 



      #2 sdahlka

      sdahlka

        Advanced Member

      • Members
      • PipPipPip
      • 324 posts

        Posted 15 March 2016 - 06:41 AM

        Hi everyone.  Long time windower fan, new to lua and coding in general.  Most of my coding experience is in actionscript and some minor C++ classes.

        I'm attempting to write my own addon that will display the Party's HP% on screen, because I can't stand having to look in the corner constantly as a healer.  I'm having a little trouble getting it to work.  I've been reading through the texts.lua alongside the developer wiki and looking at other code, such as enemybar and tparty.  I was hoping someone might find a little time to help me understand a few portions.
         

         

        p1hpp = texts.new(' HP: ${hpp|(100)}%', my_settings)
         

        This should create a text object, with the settings I've defined (I copied the default from texts.lua and made changes to them as needed) which will display "HP: 100%" as a default, or replace 100, with whatever value is in p1hpp.hpp correct?

        When I take the party info, and set party.p1.hpp to p1hpp.hpp, do I need to type cast it as a str? 

        Do I need to define .hpp inside settings?

         

         

        Thanks in advance if you make the time to reply! 

        i probably have forgotten more about texts then any other

        this is my display for my gearswap it might help you out

        https://github.com/s...ore/Display.lua

        https://github.com/s...Display_sub.lua



        #3 allibear17

        allibear17

          Newbie

        • Members
        • Pip
        • 9 posts

          Posted 15 March 2016 - 09:58 PM

          This is helpful, since you create/handle them a little differently.  I was able to create a text object on screen, and manipulate it.  Thanks!
           

          I should have a completed addon for testing soon.



          #4 allibear17

          allibear17

            Newbie

          • Members
          • Pip
          • 9 posts

            Posted 16 March 2016 - 03:59 AM

            I have a rough version working right now, including the settings.xml (I hope)

             

            https://github.com/a...ar17/PartyP.git







            Also tagged with one or more of these keywords: help, request, please, novice, newbie, text, objects

            1 user(s) are reading this topic

            0 members, 1 guests, 0 anonymous users