5E Product Walkthrough Playlist

Thread: Label Controls

  1. #1

    Label Controls

    Trying to dynamically control the text in a Label.
    Is the Label object a Text Widget?

  2. #2
    You should probably take a read over the Developer Guide to get a rough idea of all the pieces:
    https://fantasygroundsunity.atlassia...eveloper+Guide

    A label is actually a template, that ends up resolving to a stringcontrol object type.
    https://fantasygroundsunity.atlassia...or+code+re-use
    https://fantasygroundsunity.atlassia.../stringcontrol

    And you probably need to know about window/control relationships to make sure you're changing the right ones.
    https://fantasygroundsunity.atlassia...Panels+Widgets

    But, your best bet is to read over the Dev Guide.

    Regards,
    JPG

  3. #3
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,654
    Blog Entries
    1
    Hi bloodylemming,

    Code:
    function onValueChanged()
    	if getValue() < 9 then 
    		window.Label1.setValue("Below Average");
    	elseif getValue() > 13 then
    		window.Label1.setValue("Above Average");
    	end
    end

  4. #4
    Quote Originally Posted by damned View Post
    Hi bloodylemming,

    Code:
    function onValueChanged()
    	if getValue() < 9 then 
    		window.Label1.setValue("Below Average");
    	elseif getValue() > 13 then
    		window.Label1.setValue("Above Average");
    	end
    end
    This is the direction I was going, but I kept getting an error. Got it to work on some labels but not others. Created a new character and now it works fine. Weird....
    Thanks. This is going to come in really handy. Wish you could center regular text fields.

  5. #5
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,654
    Blog Entries
    1
    Add custom control property with property name of center
    Dont use labels instead of text fields
    just making things hard for yourself

  6. #6
    Quote Originally Posted by damned View Post
    Add custom control property with property name of center
    Dont use labels instead of text fields
    just making things hard for yourself
    I'm not finding information on how to do this. Have you done this in a video you can point me to?

  7. #7

  8. #8
    Quote Originally Posted by damned View Post
    Well, that explains it. I'm only on episode 10. !)

    Thanks!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in