Graphics

 View Only
  • 1.  Changing Font Based on Higher Value

    Posted 08-24-2018 00:20
    Hey all,

    I'm basically trying to put something together in Visual Logic that compares two values and changes the font of the larger one. I'm sure it's something simple but I've been trying different things for hours and just can't figure it out.


  • 2.  RE: Changing Font Based on Higher Value

    Posted 08-24-2018 09:19

    Hi,
    I'm a beginner and I don't know if this the best/easyest way, but it works: create 2 text object and hide one.

    I made it like this:
    Create 2 text object using 2 different font styles and place them in the same position (as center or how you want)
    Create other text for value (but you can use the first text value too) and hide this text clicking on eye near the object name.
    Create a simple visual logic 



    Copy the text content from Text 1 to Text 2 in order to have the same text content.
    Using the Value of the Text 3 and compare it - in my test compare if the value us greater than 50.
    If the condition is true, the out boolean value is 1 and it trigger the visibility of the fist text (using the one font style).
    If the condition is false, the boolean value is 0, the first text it will not be visible but the second condition Equal To will be true (condition equal to 0) and the visibility of the second text will be turned on and the second font style will be visible. (In the first case when the boolean value is 1, is not equal with 0 and the decond text is not visible)

    Have FUN!


    #XPression


  • 3.  RE: Changing Font Based on Higher Value

    Posted 08-24-2018 14:15

    If the first example is good, you can go further and compare 2 numbers.
    Create 3 copies for each 2 number and rename them like this:
    TEXT 1 SMALL, BIG, EQUAL
    TEXT 2 SMALL, BIG, EQUAL
    Assign a small font just for SMALL version and a bigger font for BIG and EQUAL version; Superpose SMALL, BIG and EQUAL for each number.
    Create the visual logic:



    - Copy numbers for BIG and EQUAL after SMALL (Public just the SMALL)
    - Compare numbers and make visible just the true one.

    Have FUN!

     


    #XPression


  • 4.  RE: Changing Font Based on Higher Value

    Posted 08-24-2018 17:09

    That seems much easier than what I ended up with :p


    #XPression


  • 5.  RE: Changing Font Based on Higher Value

    Posted 08-28-2018 00:04
    Yeah, that will work, but speaking from experience, once you get down to making duplicate text objects to drive different font values, its a slippery slope and ultimately a very inefficient way in which to work (while being needlessly taxing on the system at the same time) Your setup, press4rt is actually the 'more correct' approach as you are feeding font values to the same text object via string values and concatenate. At first blush, it seems like it should be working, is it not, or did you get it sorted?
    #XPression