Author Topic: Add paremeter in Layout options of my theme  (Read 9302 times)

empardopo

  • Full Member
  • ***
  • Posts: 49
    • View Profile
Add paremeter in Layout options of my theme
« on: March 19, 2016, 11:50:57 AM »
I've added this code to my layout

Code: [Select]
local snap = fe.add_artwork( "snap", flw*0.0775, flh*0.253, flw*0.525, flh*0.486 );
// AnimaciĆ³n sobre el eje X Aparece el logo desde la parte izquierda
local movex_cfg = {
    when = Transition.ToNewSelection,
    property = "x",
    start = -100,
    end = snap.x,
    tween = Tween.Bounce,
    [color=blue]time = 3500[/color]
}
animation.add( PropertyAnimation( snap, movex_cfg ) );

I would like add a paremeter to my layout; the time could be name snaptransitionX_ms and I add this to my layout.

Code: [Select]
class UserConfig {
   </ label="Snap Transition Time", help="Time in milliseconds for snap." /> snaptransitionX_ms="35";
   
}

local config = fe.get_config();

My problem is how can I use this paremeter? I've changed my code to this

Code: [Select]
local snap = fe.add_artwork( "snap", flw*0.0775, flh*0.253, flw*0.525, flh*0.486 );
// AnimaciĆ³n sobre el eje X Aparece el logo desde la parte izquierda
local movex_cfg = {
    when = Transition.ToNewSelection,
    property = "x",
    start = -100,
    end = snap.x,
    tween = Tween.Bounce,
    [color=blue]time = "snaptransitionX_ms"[/color]
}
animation.add( PropertyAnimation( snap, movex_cfg ) );

but it doesn't work fine.

Any help, please?

Thanks in advance.