Author Topic: Rotate and sweep artwork together  (Read 26 times)

BadFurDay

  • Full Member
  • ***
  • Posts: 34
    • View Profile
Rotate and sweep artwork together
« on: October 09, 2017, 02:43:54 PM »
Hi people,

I was able to animate the cartart (discs) of my Playstation theme to ether sweep from behind the boxart or stick out but rotate. I'd like to have the option for it to do both at the same time, sweep from behind while rotating and continue to rotate indefinitely. This is the code I have so far:

//Cart art to be displayed
if ( my_config["enable_gcartart"] == "Static" )
{
local cartart = fe.add_artwork("cartart", flx*0.55, fly*0.562, flw*0.178, flh*0.34 );
cartart.preserve_aspect_ratio = true;
}

if ( my_config["enable_gcartart"] == "Sweep" )
{
local cartart = fe.add_artwork("cartart", flx*0.442, fly*0.562, flw*0.178, flh*0.34 );
cartart.preserve_aspect_ratio = true;
{
local cartartx = {
    when = Transition.StartLayout ,
    property = "x",
    start = flx*0.442
    end = flx*0.55
    time = 500,
 } 
animation.add( PropertyAnimation ( cartart, cartartx ) );
}
{
local cartartx = {
    when = Transition.ToNewList ,
    property = "x",
    start = flx*0.442
    end = flx*0.55
    time = 500,
 } 
animation.add( PropertyAnimation ( cartart, cartartx ) );
}
{
local cartartx = {
    when = Transition.ToNewSelection,
    property = "x",
    start = flx*0.442
    end = flx*0.55
    time = 500,
 } 
animation.add( PropertyAnimation ( cartart, cartartx ) );
}
}

if ( my_config["enable_gcartart"] == "Rotate" )
{
local cartart = fe.add_artwork("cartart", flx*0.53, fly*0.562, flw*0.178, flh*0.34 );
cartart.preserve_aspect_ratio = true;
{
local cartart_rotate_onload = {
    when = Transition.StartLayout,
    property = "rotation",
    start = 0,
    end = 360,
    time = 3000,
    loop=true
 }
animation.add( PropertyAnimation ( cartart, cartart_rotate_onload ) );
}
{
local cartart_rotate_onload = {
    when = Transition.ToNewList,
    property = "rotation",
    start = 0,
    end = 360,
    time = 3000,
    loop=true
 }
animation.add( PropertyAnimation ( cartart, cartart_rotate_onload ) );
}
{
local cartart_rotate_onload = {
    when = Transition.ToNewSelection
    property = "rotation",
    start = 0,
    end = 360,
    time = 3000,
    loop=true
 }
animation.add( PropertyAnimation ( cartart, cartart_rotate_onload ) );
}
}


If I put the code together under a new option selection "Sweep & Rotate" I can get it to do it together but for some reason when it is done with the sweep the cartart simply disappears.

Any help is greatly appreciated.