- UID
- 1152
- 积分
- 137
- 帖子
- 8
- 主题
- 2
- 论坛币
- 850
- 威望
- 0
- EP值
- 223
- MP值
- 0
- 阅读权限
- 50
- 注册时间
- 2013-4-11
- 在线时间
- 13 小时
- 最后登录
- 2023-10-29
|
本帖最后由 ALKOON 于 2014-12-14 13:16 编辑
Hi everyone
This is a simple Fx, actually first test I make by NyuFx(Lua), so I thought it's better to make it by using TCAX
but unfortunately the second FX_02 wasn't as I want, so I hope from Milky. or saiy to find a sulation for this problem that I got XD
NyuFx_Lua(Demo): http://www.dailymotion.com/video/x2cdr55_demotest_creation
TCAX_Python(Demo) : http://www.dailymotion.com/video/x2cert7_tcax-simple-test
Script:- from tcaxPy import *
- from pixLibs.ImageStone.pixStone import *
- def tcaxPy_Init():
- global _FD
- global _Fs
- global _Length
- global _Width
- global _Height
- global Font
- global FontOut
- global PIX_tex
- global PIX_tex2
- _FD = 1000 / GetVal(val_FXFPS)
- _Fs = GetVal(val_FontSize)
- _Length = GetVal(val_TextLength)
- _Height = GetVal(val_TextHeight)
- _Width = GetVal(val_TextWidth)
- _FontFileName = GetVal(val_FontFileName)
- _FaceID = GetVal(val_FaceID)
- Font = InitFont(_FontFileName, _FaceID, _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), MakeRGB(0, 0, 0), 0, 0)
- FontOut = InitFont(_FontFileName, _FaceID, _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), MakeRGB(0, 0, 0), 2, 0)
- PIX_tex = ImagePix(abspath('img (13).png'), _Fs, 0)
- PIX_tex2 = ImagePix(abspath('img (13).png'))
-
- def tcaxPy_Fin():
- FinFont(Font)
-
- def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _x, _y, _a, _txt):
- ASS_BUF = []
- TCAS_BUF = []
- PIX_t = TextPix(Font, _txt)
- dx = _x - int(_a / 2 + 0.5) + PIX_t[0][0]
- dy = _y - int(_Fs / 2 + 0.5) + PIX_t[0][1]
-
- PIX_t = PixTexture(PIX_t, PIX_tex)
- PIX_out = TextPix(FontOut, _txt)
- PIX_out = PixTexture(PIX_out, PIX_tex2)
- PIX_out = PixColorMul(PIX_out, 1, 1, 1, 1)
- PIX_out = PixBlur(PIX_out, 0)
- PIX_ori = CombinePixs(PIX_out, PIX_t)
- points = PixPoints(PIX_ori)
- pt_num = len(points)
- pt = pt_num
-
- x = dx
- y = dy
-
- for i in range(pt):
- w = points[i][0]
- h = points[i][1]
- idx = 4 * (h * PIX_ori[1][0] + w)
- PixR = PIX_ori[2][idx + 0]
- PixG = PIX_ori[2][idx + 1]
- PixB = PIX_ori[2][idx + 2]
- PixA = PIX_ori[2][idx + 3]
-
- x = dx + points[i][0]
- y = dy + points[i][1]
- syl_dur = _KT
- start = _BT
- end = _BT + _SK
- w_mov = (points[i][0]/ _Width[_i] [_j])*syl_dur
-
- EFT1 = an(7)+shad(0)+blur(2)+bord(2)+move(x,y,x,y)+alpha3(242)+fscxy(90,90)+alpha1(255-PixA)+color1(FmtRGB(PixR,PixG,PixB)) +color3(FmtRGB(PixR,PixG,PixB))
- ass_main(ASS_BUF, SubL(start,end+w_mov,3,Pix_Style), EFT1, PixPt())
- ### --(I tried to cut the text_pixle from half (make it half-falf, but it's not coming as I want so I think sthe problem is with _Height[_i][_j] I guess )-- ###
- py = points[i][1] < _Height[_i][_j] / 2 and -1 or 1
- xr_mov = -70 + randint(-10,10)
- yr_mov = randint(-15,15)
- start1 = end+w_mov
- end1 = start1 +100
- ttt = end - start
- x1 = x+xr_mov
- y1 = y+yr_mov
- y2 = y1*py
- FRZ = t(frz(580))+t(frz(-330))
-
- #FX_01 (Normal-Frz)
- if _i ==0 :
- EFT1 = an(7)+FRZ+blur(2)+bord(2)+org(x,y)+move(x+randint(-1,1),y,x1,y1)+fad(0,150)+alpha3(245)+fscxy(90,90)+alpha1(255-PixA) +color1(FmtRGB(PixR,PixG,PixB)) +color3(FmtRGB(PixR,PixG,PixB))
- ass_main(ASS_BUF, SubL(start1,end1,3,Pix_Style), EFT1, PixPt())
- #FX_012 ( Pixels (half\falf) )
- if _i == 1:
- EFT1 = an(7)+FRZ+blur(2)+bord(2)+org(x,y)+move(x+randint(-1,1),y,x1,y2)+fad(0,150)+alpha3(240)+fscxy(90,90)+alpha1(255-PixA) +color1(FmtRGB(PixR,PixG,PixB)) +color3(FmtRGB(PixR,PixG,PixB))
- ass_main(ASS_BUF, SubL(start1,end1,3,Pix_Style), EFT1, PixPt())
- #FX_03 (pixels Down)
- if _i == 2:
- EFT1 = an(7)+blur(2)+bord(2)+move(x+randint(-1,1),y,x+randint(-5,5),y+randint(35,45))+fad(0,150)+alpha3(240)+fscxy(90,90)+alpha1(255-PixA) +color1(FmtRGB(PixR,PixG,PixB)) +color3(FmtRGB(PixR,PixG,PixB))
- ass_main(ASS_BUF, SubL(start1,end1,3,Pix_Style), EFT1, PixPt())
- return (ASS_BUF, TCAS_BUF)
复制代码 |
|