﻿################################################################################
### description:
### fade in with font size animation


from tcaxPy import *


def tcaxPy_Init():
    global _FD                              # frame duration, in millisecond
    global _Fs
    global _Blur
    
    _Blur = GetVal(val_Blur)
    _FD = 1000 / GetVal(val_FXFPS)
    _Fs = GetVal(val_FontSize)



def tcaxPy_Fin():
    pass


time_gap = 1    # you can change this value to 0, or 2 or any other number
time_fac = 1    # you can change this value to 0, or 2 or any other number

def tcaxPy_Main(_i, _j, _n, _start, _end, _elapk, _k, _x, _y, _a, _txt):
    ASS_BUF  = []        # used for saving ASS FX lines
    TCAS_BUF = []        # used for saving TCAS FX raw data


    duration = 12 * _FD
    ts = _start + _j * time_fac * _FD / 10 - time_gap * _FD / 10 - duration / 10
    te = _start + _j * time_fac * _FD / 10 - time_gap * _FD / 10

    if _Blur > 0:
        EFT = an(5)+mov(_x+50,_y,_x,_y)+org(_x,_y)+fad(200,0)+t(fr(-720))+blur(_Blur)
    
    ass_main(ASS_BUF,SubL(ts-5,te,0), EFT, _txt)
    

    return (ASS_BUF, TCAS_BUF)
