Graphics

 View Only
  • 1.  Animating a graphic on and off using Visual Logic?

    Posted 05-28-2020 20:49

    I have a text bar that I'd like to have animate on and off, while also having it wrapped to the text that is inputted. I already successfully created the Visual Logic for the bar grow based on text, but this is resulting in the image being displayed static on/off instead of transitioning across the screen with the keyframes I had previously made to fly the bar on/off.

    Any help/guidance here would be immensely appreciated!

     

    Andy Brill

    646-456-9655

    abrill72@yahoo.com



  • 2.  RE: Animating a graphic on and off using Visual Logic?

    Posted 05-30-2020 13:59

    Hi Andy,

    I assume that you have sized the bar to your text using the width-property of the quad?

    Then you can easily use the X or Y-scale to animate the bar in or out of the scene.

     

    IF on the other hand, you used the X-scale to size your bar, then you have a problem.

    So I would suggest to use the width.

     

    Below you will find an example Logic

    As you can see I'm using the BoundingBox.WidthScaled to get the actual width of the text.

    Why the WidthScaled? Well it's in case you have an autosqueeze enabled.

    Next I'm feeding it into an offset to add some spacing to the front and back of the bar before assigning it to the width of the bar.

    You will also see that on top, I'm taking the position of the Text and I'm subtracting 20pixels of the X-Position as the X-Position of the bar so that the bar starts before the text.

    I'm doing this because the text is left-aligned. For this I also need to make sure the bar is left-aligned and when it grows, it grows to the right. For this reason, I'm using a piece of logic that gets the width of the bar, divides it by -2 and assigns that value to the x-Pivot of the bar. This sets the pivot of the bar on the left edge.

    If your text is right-aligned, you would have to divide it by 2 and if the text is centered, you don't have to change the pivot at all.

    Note you will also have to change the X-position if you change the pivot.

     

    But using this method, the X and Y-scales are available to animate the bar in.


    #XPression


  • 3.  RE: Animating a graphic on and off using Visual Logic?

    Posted 05-30-2020 17:12

    Thank you so much Kenneth - I'm going to take a look at this later - I sincerely appreciate your feedback!!

     

    Andy


    #XPression