[LUA] Otras cosas basicas sobre colores aleatorios .....
Sunday, November 8, 2009 7:44:37 PM
Se los relatare tipo bitácora XD
bueno en mi intento de jugar con los colores aleatorios, recordé el ending de K-ON que realizo AnS, así que me di a la tarea de ver como era y hacer un efecto con estas características, mas no el mismo... aunque se vea fácil para algunos yo no tenia ni la menor idea o.o... pero con un par de consejos con de asedark pude lograrlo:
pero antes de explicarles les diré que me di cuenta que seria mas fácil si:
c%s = 1c&H%s&
3c%s = 3c&H%s&
y en ves de ser:
colores = {"FFFFFF", "FFD6FF"}
seria:
colores= {"&H6DE668&","&H79F8F1&","&HFF6A00&","&HEF00FF&"}
si no son iguales, sirven para lo mismo y no me crean error. Así que empece a usar de esta manera a la hora de escribir ya que me ahorraba 3 letras (según yo xD).
colores= {"&H6DE668&","&H79F8F1&","&HFF6A00&","&HEF00FF&"}
--Silabas estáticas
l = table.copy(line)
l.text = string.format("{\\an5\\bord2\\blur5\\shad0\\pos(%d,%d)\\3c%s}%s", x, y,colores[math.random (1,4)],syl.text_stripped)
l.start_time = line.start_time
l.end_time = line.end_time
l.layer = 2
subs.append(l)
resultado:
Se los pondré cuando encuentre como se hace el flash.
Y pensé que ya la había logrado pero no D:!!!.... Por lógica si quisiera darle efectos usando esta manera... no conseguiría algo similar sino que tendría colores aleatorios por cada efecto:
es decir usando esto:
if i ==1 then
tiempo=0
end
tiempo=tiempo+(1000/line.kara.n)
colores= {"&H6DE668&","&H79F8F1&","&HFF6A00&","&HEF00FF&"}
--Efecto de inicio
l = table.copy(line)
l.text = string.format("{\\fad(600,0)\\bord2\\blur5\\shad0\\frx180\\an5\\move(%d,%d,%d,%d)\\3c%s\\t(\\frx0)}%s",x+25,y,x,y,colores[math.random (1,4)],syl.text_stripped)
l.start_time = line.start_time +tiempo-600
l.end_time = line.start_time+tiempo
l.layer=0
subs.append(l)
--Efecto + Silabas estáticas
l = table.copy(line)
l.text = string.format("{\\an5\\bord2\\blur5\\shad0\\pos(%d,%d)\\3c%s}%s", x, y,colores[math.random (1,4)],syl.text_stripped)
l.start_time = line.start_time+tiempo-200
l.end_time = line.start_time + syl.start_time
l.layer = 2
subs.append(l)
--Efecto
l = table.copy(line)
l.text = string.format("{\\an5\\blur5\\3c%s\\bord2\\shad0\\pos(%d,%d)\\t(\\fscx60\\fscy60)}%s",colores[math.random (1,4)], x, y,syl.text_stripped)
l.start_time = line.start_time + syl.start_time
l.end_time = line.start_time + syl.start_time + (syl.duration/2)
l.layer = 3
subs.append(l)
l = table.copy(line)
l.text = string.format("{\\an5\\blur5\\bord2\\shad0\\3c%s\\pos(%d,%d)\\fscx60\\fscy60\\t(\\fscx100\\fscy100)}%s",colores[math.random (1,4)], x, y,syl.text_stripped)
l.start_time = line.start_time + syl.start_time + (syl.duration/2)
l.end_time = line.start_time + syl.start_time + syl.duration
l.layer = 3
subs.append(l)
---Silabas estaticas hasta el final
l = table.copy(line)
l.text = string.format("{\\an5\\blur5\\bord2\\shad0\\3c%s\\pos(%d,%d))}%s",colores[math.random (1,4)], x, y,syl.text_stripped)
l.start_time = line.start_time + syl.start_time + syl.duration
l.end_time = line.end_time +1000
l.layer = 2
subs.append(l)
y el resultado era:
Se los pondré cuando encuentre como se hace el flash....
Después de 30 minutos de andar con prueba y error llegue a la respuesta:
colores= {"&H6DE668&","&H79F8F1&","&HFF6A00&","&HEF00FF&"}
array_color = colores[math.random (1,4)]
entonces el lua me quedo así:
if i ==1 then
tiempo=0
end
tiempo=tiempo+(1000/line.kara.n)
colores= {"&H6DE668&","&H79F8F1&","&HFF6A00&","&HEF00FF&"}
array_color = colores[math.random (1,4)]
--Efecto de inicio
l = table.copy(line)
l.text = string.format("{\\fad(600,0)\\bord2\\blur5\\shad0\\frx180\\an5\\move(%d,%d,%d,%d)\\3c%s\\t(\\frx0)}%s",x+25,y,x,y,array_color,syl.text_stripped)
l.start_time = line.start_time -600+tiempo
l.end_time = line.start_time+tiempo
l.layer=0
subs.append(l)
--Efecto + Silabas estáticas
l = table.copy(line)
l.text = string.format("{\\an5\\bord2\\blur5\\shad0\\pos(%d,%d)\\3c%s}%s", x, y,array_color,syl.text_stripped)
l.start_time = line.start_time -200+tiempo
l.end_time = line.start_time + syl.start_time
l.layer = 2
subs.append(l)
--Efecto
l = table.copy(line)
l.text = string.format("{\\an5\\blur5\\3c%s\\bord2\\shad0\\pos(%d,%d)\\t(\\fscx60\\fscy60)}%s",array_color, x, y,syl.text_stripped)
l.start_time = line.start_time + syl.start_time
l.end_time = line.start_time + syl.start_time + (syl.duration/2)
l.layer = 3
subs.append(l)
l = table.copy(line)
l.text = string.format("{\\an5\\blur5\\bord2\\shad0\\3c%s\\pos(%d,%d)\\fscx60\\fscy60\\t(\\fscx100\\fscy100}%s",array_color, x, y,syl.text_stripped)
l.start_time = line.start_time + syl.start_time + (syl.duration/2)
l.end_time = line.start_time + syl.start_time + syl.duration
l.layer = 3
subs.append(l)
---Silabas estaticas hasta el final
l = table.copy(line)
l.text = string.format("{\\an5\\blur5\\bord2\\shad0\\3c%s\\pos(%d,%d))}%s",array_color, x, y,syl.text_stripped)
l.start_time = line.start_time + syl.start_time + syl.duration
l.end_time = line.end_time +1000
l.layer = 2
subs.append(l)
y el resultado fue:
que alguien me enseñe como poner la muestra xD
bueno eso es toda la clase(?)
Editando XD















Alexnicklechama # Monday, November 9, 2009 3:29:21 AM
Sobre los flash...pues yo lo hago creando un clip en avi, y luego convirtiéndolo a flash con el Free Video To Flash Converter.
PD...ahhh cuantas veces lo he sufrido en carne propia!!!
CaoSCaoS90 # Monday, November 9, 2009 3:49:29 AM
Originally posted by zheox:
a ya vi error mio esta mal el ejemplo que puse, eso fue por andar haciendo otras cosas mientras posteaba xD
no si aplique el math.random en los colores...
postee esto:
colores= {"&H6DE668&","&H79F8F1&","&HFF6A00&","&HEF00FF&"} --Efecto de inicio l = table.copy(line) l.text = string.format("{\\fad(600,0)\\bord2\\blur5\\shad0\\frx180\\an5\\move(%d,%d,%d,%d)\\3c%s\\t(\\frx0)}%s",x+25,y,x,y,colores= {"&H6DE668&","&H79F8F1&","&HFF6A00&","&HEF00FF&",syl.text_stripped) l.start_time = line.start_time -600+tiempo l.end_time = line.start_time+tiempo l.layer=0 subs.append(l) etc....en vez de de esto:
--Efecto de inicio l = table.copy(line) l.text = string.format("{\\fad(600,0)\\bord2\\blur5\\shad0\\frx180\\an5\\move(%d,%d,%d,%d)\\3c%s\\t(\\frx0)}%s",x+25,y,x,y,colores[math.random (1,4)],syl.text_stripped) l.start_time = line.start_time -600+tiempo l.end_time = line.start_time+tiempo l.layer=0 subs.append(l) etc...