Mudlet - Vyzor Gauges

I've been trying and enjoying making myself a GUI in mudlet using Vyzor. And all was going okaish, until I got to the gauges and... I've been trying to find a solution myself for, lets leave it at just "long". 

I have no leads, so would be great if someone could help me out here.  

NioSys["HpFront"] = Vyzor.Frame( "HpFront" )

NioSys.HpFront:Add( NioSys.BrightRedBG )

NioSys["HpBack"] = Vyzor.Frame( "HpBack" )

NioSys.HpBack:Add( Niosys.DarkRedBG )

NioSys["HpOver"] = Vyzor.Frame( "HpOver" )

NioSys.HpOver:Add( NioSys.WhiteBG )

NioSys["HpGauge"] = Vyzor.Gauge( "HpGauge", "gmcp.Char.Vitals.hp", "gmcp.Char.Vitals.maxhp", NioSys.HpBack, NioSys.HpFront, LeftRight, NioSys.HpOver )

NioSys.HpFrame:Add( NioSys.HpGauge )


This is the code for my Hp gauge. The BG variables contain the colored backgrounds. the HpFrame is the frame (5th frame deep into the bottom border)  that I'm using to position the HP gauge exactly where I want it to be.

It doesnt draw itself, and it canceles the drawing of the other frames I am using for the layout :C

Comments

  • edited February 2014
    Are there any erros sowing in the error console (the red excalamation mark)?

    Two wrong things I can see are your LeftRight not being Vyzor.GaugeFill.LeftRight and the overflow argument (the last argument) is supposed to be an indexed table of frames, not a single frame.
  • edited February 2014
    No errors :C
    I changed it to this to experiment, but - same result. 


    NioSys["HpFront"] = Vyzor.Frame( "HpFront" )
    NioSys.HpFront:Add( NioSys.BrightRedBG )
    NioSys["HpBack"] = Vyzor.Frame( "HpBack" )
    NioSys.HpBack:Add( Niosys.DarkRedBG )
    NioSys["HpGauge"] = Vyzor.Gauge( "HpGauge", "gmcp.Char.Vitals.hp", "gmcp.Char.Vitals.maxhp", NioSys.HpBack, NioSys.HpFront )
    NioSys.HpFrame:Add( NioSys.HpGauge ) [/text]


    Whole code of it if necessary:


    function Layout()
    --setting draw order and creating invisible frames
    Vyzor.Options.DrawOrder = {"bottom", "top", "left", "right"}
    Vyzor.Options.HandleBorders = true
    Vyzor.Options.Borders = {Top = 0, Bottom = 0.1, Left = "dynamic", Right = "dynamic"}


    --creating the RIGHT frame
    NioSys["RightFrame"] = Vyzor.Frame("RightFrame")
    NioSys.RightFrame:Add( Vyzor.Border( nil, nil, Vyzor.Image( NioSys.Images.."BasicBG.png" )))
    Vyzor.Right:Add( NioSys.RightFrame )


    --creating the LEFT frame
    NioSys["LeftFrame"] = Vyzor.Frame("LeftFrame")
    NioSys.LeftFrame:Add( Vyzor.Border( nil, nil, Vyzor.Image( NioSys.Images.."BasicBG.png" )))
    Vyzor.Left:Add( NioSys.LeftFrame )

    --creating the BOTTOM frame
    NioSys["BottomFrame"] = Vyzor.Frame("BottomFrame")
    NioSys.BottomFrame:Add( Vyzor.Border( nil, nil, Vyzor.Image( NioSys.Images.."BasicBG.png" )))
    Vyzor.Bottom:Add( NioSys.BottomFrame )

    --creating the MAP frame & drawing MAP
    NioSys["MapArea"] = Vyzor.Frame( "MapArea", 0, 0.5, 1, 0.5 )
    NioSys["NMap"] = Vyzor.Map( 0, 0, 1.0, 1.0 )
    NioSys.MapArea:Add( NioSys.NMap )
    NioSys.RightFrame:Add( NioSys.MapArea )

    --creating the BottomDetail Cage
    NioSys["BottomDetail"] = Vyzor.Frame( "BottomDetail", 0.25, 0, 0.5, 1 )
    NioSys.BottomDetail:Add( NioSys.GreyBG )
    NioSys.BottomFrame:Add( NioSys.BottomDetail )

    --creating the BottomArea
    NioSys["BottomArea"] = Vyzor.Frame( "BottomArea", 0.07, 0, 0.86, 1 )
    NioSys.BottomArea:Add( NioSys.GreyBG )
    NioSys.BottomDetail:Add( NioSys.BottomArea )

    --creating the EXPERIENCE gauge frame
    NioSys["ExpFrame"] = Vyzor.Frame( "ExpFrame", 0, 0, 1, 0.1 )
    NioSys.ExpFrame:Add( NioSys.PurpleBG )
    NioSys.BottomArea:Add( NioSys.ExpFrame )

    --creating the MAIN GAUGES frame
    NioSys["MainGauges"] = Vyzor.Frame( "MainGauges", 0, 0.1, 0.75, 0.6 )
    NioSys.MainGauges:Add( NioSys.CyanBG )
    NioSys.BottomArea:Add( NioSys.MainGauges )

    --creating the SECONDARY GAUGES frame
    NioSys["SecondaryGauges"] = Vyzor.Frame( "SecondaryGauges", 0.75, 0.1, 0.25, 0.6 )
    NioSys.SecondaryGauges:Add( NioSys.PinkBG )
    NioSys.BottomArea:Add( NioSys.SecondaryGauges )

    --creating the INFO AREA frame
    NioSys["InfoArea"] = Vyzor.Frame( "InfoArea", 0, 0.7, 1, 0.3 )
    NioSys.InfoArea:Add( NioSys.YellowBG )
    NioSys.BottomArea:Add( NioSys.InfoArea )

    --creating MAIN STATS frames
    NioSys["HpFrame"] = Vyzor.Frame( "HpFrame", 0, 0, 0.5, 0.6 )
    NioSys.HpFrame:Add( NioSys.RedBG )
    NioSys.MainGauges:Add( NioSys.HpFrame )
    NioSys["MpFrame"] = Vyzor.Frame( "MpFrame", 0.5, 0, 0.5, 0.6 )
    NioSys.MpFrame:Add( NioSys.BlueBG )
    NioSys.MainGauges:Add( NioSys.MpFrame )
    NioSys["EndFrame"] = Vyzor.Frame( "EndFrame", 0, 0.6, 0.5, 0.4 )
    NioSys.EndFrame:Add( NioSys.GoldBG )
    NioSys.MainGauges:Add( NioSys.EndFrame )
    NioSys["WillFrame"] = Vyzor.Frame( "WillFrame", 0.5, 0.6, 0.5, 0.4 )
    NioSys.WillFrame:Add( NioSys.VioletBG )
    NioSys.MainGauges:Add( NioSys.WillFrame )


    --Drawing Gauges

    NioSys["HpFront"] = Vyzor.Frame( "HpFront" )
    NioSys.HpFront:Add( NioSys.BrightRedBG )
    NioSys["HpBack"] = Vyzor.Frame( "HpBack" )
    NioSys.HpBack:Add( Niosys.DarkRedBG )
    --NioSys["HpOver"] = Vyzor.Frame( "HpOver" )
    --NioSys.HpOver:Add( NioSys.WhiteBG )
    NioSys["HpGauge"] = Vyzor.Gauge( "HpGauge", "gmcp.Char.Vitals.hp", "gmcp.Char.Vitals.maxhp", NioSys.HpBack, NioSys.HpFront )
    NioSys.HpFrame:Add( NioSys.HpGauge )

    Vyzor.HUD:Draw()

    end




    And here are the colors pulled from a different script of mine:


      --Gauges Colors

    --HP

    NioSys["BrightRed"] = Vyzor.Color( Vyzor.ColorMode.Name, "OrangeRed" )

    NioSys["DarkRed"] = Vyzor.Color( Vyzor.ColorMode.Name, "a_darkred" )

    NioSys["BrightRedBG"] = Vyzor.Background( Vyzor.Brush( NioSys.BrightRed ))

    NioSys["DarkRedBG"] = Vyzor.Background( Vyzor.Brush( NioSys.DarkRed ))

  • edited February 2014
    NioSys.HpBack:Add( Niosys.DarkRedBG ) should be NioSys.HpBack:Add( NioSys.DarkRedBG )

    notice the capital S in NioSys. This should've thrown an error (unless you also have a Niosys table)

    This worked for me: http://hastebin.com/puvovasaji.avrasm

    I had to create your global NioSys table, set NioSys.Images to getMudletHomeDir() (I don't have the images you have so they don't show up), add a few colors you left out and call Layout() at the end but it worked on a fresh profile with Vyzor installed. Here's a screenshot: http://i.imgur.com/ctAkCrX.png
  • Yup, thanks guys, got it all going today morning, just came back. And don't seem to be having any other problems, yet either. I did have to make something a bit differently than oneymus told me on the forums, but its all nice and beautiful by now :)
Sign In or Register to comment.