Graphics

 View Only
  • 1.  H Spacing Animation

    Posted 11-16-2017 21:28
    Is it possible to set key frames in order to animate H spacing values in Scene Fonts? I'm trying to do an effect where letters kern out to reveal, and cannot achieve the desired result with a simple x-scale.


  • 2.  RE: H Spacing Animation

    Posted 11-17-2017 07:10
    Have you tried a stagger animation? Not the same as Kerning but may get close to the effect you're trying to achieve.
    #XPression


  • 3.  RE: H Spacing Animation

    Posted 11-21-2017 10:08
    Yes you can, with scripting !

    OnSceneOnline
    [PHP]
    Dim MaFont as xpfont
    Engine.GetFontByName("Font1", MaFont)
    MaFont.Spacing = -11.50 'Here adjust IN value
    [/PHP]



    OnRender
    [PHP]
    Dim MaFont as xpfont
    Engine.GetFontByName("Font1", MaFont)
    MaFont.Spacing = MaFont.Spacing + 0.15 'Here the speed of "grow"
    [/PHP]



    If you want to stop it a moment, add a condition like
    [PHP]
    If MaFont.Spacing < 20 Then
    MaFont.Spacing = MaFont.Spacing + 0.15 'Here the speed of "grow"
    End if
    [/PHP]
    #XPression


  • 4.  RE: H Spacing Animation

    Posted 11-21-2017 17:09
    Terrific, thanks very much!
    #XPression


  • 5.  RE: H Spacing Animation

    Posted 11-21-2017 19:44
    A suggestion....

    I've found the animatable items in Xpression to be quite limiting, but there is a trick you can use to achieve most goals - create a dummy group and you can keyframe animate one of it's fields (like the X Position), and use visual logic to tie that value to what you actually want animated (like a color).

    Now, that's not possible with Fonts, because the only thing accessible (I'm using 6.7) are font materials, and not the font itself, so you can use code similar to what vinz posted to tie the two together yourself - and then you can keyframe animate it as you wish.

    dim font as XpFont
    dim dummyObj as XpBaseObject

    if Engine.GetFontByName("Font1", font) then
    if Self.GetObjectByName("Group1", dummyObj) then
    font.Spacing = dummyObj.PosX
    end if
    end if


    EDIT: To clarify, that code would be OnRender.
    #XPression