Register Forum Rules FAQ Members List Social Groups Search Today's Posts Mark Forums Read

 AnimeSuki Forum how to create color fading text effect by ass ???
 User Name Remember Me? Password

2007-08-22, 09:45   Link #21
MexFX
Waiting...
Fansubber

Join Date: Jan 2007
Location: Arabian world
Age: 28
sorry , I was to lazy & I didn't expect someone will need it

OK , but I warn you , my english is crap

Code:
-- Original written by Haider Ben Abu Baker

description = "Stupid gradient Effect "

configuration = {}
version, kind = 3, 'basic_ass'

function do_syllable(meta, styles, config, line, syl)
local output = {n=0}
local x=syl.center + line.centerleft
local y = 40

l = copy_line(line)
l.text = string.format("{\\an8\\pos(%d,%d)\\1c&H0000FF&}%s",x,y,

syl.text_stripped)
l.layer = 0  -- put the red (copy?) at lower layer
table.insert(output, l)

-- make 15 copies , each one will be at seprate layer

for i = 0,14 do

l = copy_line(line)
l.text = string.format("{\\be1\\an8\\pos(%d,%d)\\1c&H%02X%02XFF&\\clip

(0,0,640,%d)}%s",x,y,i*5,i*20+10,62-i ,syl.text_stripped)

l.layer = i   --put every copy at a layer equals to the loop variable
-- that mean , every layer will be at top of the (previos)

table.insert(output, l)

end

return output

end

--[[
string.format("{\\be1\\an8\\pos(%d,%d)\\1c&H%02X%02XFF&\\clip(0,0,640,%d)}%

s",x,y,i*5,i*20+10,62-i ,syl.text_stripped)

will , it's hard to say it in english }{

I just chnge the color of each copy & tried to make change for (red) to yellow
by using this format (1c&H%02X%02XFF)

the red chaneel is (constat) but blue &green are change throw the loop ,
I just add\multiply to the loop variable to icrease Blue & Green , so the color goes from red\orange\yellow
%02X convert loop variable to Hexadicimal

for \clip , it clips the text form the center (62 atthis case ) then decrease the place to clip by the loop cariable (62-i) .

]]

oh yeah , if wish to move the text , change that two copies with this

Quote:
 l = copy_line(line) l.text = string.format("{\\an8\\move(%d,%d,%d,%d)\\1c&H0000 FF&}%s",x,y,x-50,y+50, syl.text_stripped) l.layer = 0 table.insert(output, l) for i = 0,15 do l = copy_line(line) l.text = string.format("{\\be1\\an8\\move(%d,%d,%d,%d)\\1c& H%02X%02XFF&\\clip(0,0,640,%d)\\t(\\clip(%d,%d,%d, %d)}%s",x,y,x-50,y+50,i*5,i*20+10,62-i ,0-50,0+50,640-50,(62-i)+50,syl.text_stripped) l.layer = i table.insert(output, l)

I know it's Ugly~ and Unreadable , but it works fine(will... the movment is really Ugly...)

now you just have change the (x)&(y) values as you like & then change the 4th clip parameter to the center of the word position (I get it manually coz I don't know a way to get it with Auto\Lua >< jfs may help us with this,,,nooop I don't think he'll did ...Auto3 is dead for him )