Xev-
Alright, here is a skinny version with all the particle effect stuff taken out. This should help you isolate what you need for the wheel or you can just use this and add to it. If you want to copy and paste the wheel part then you will need to copy the Class Userconfig section, the local config section, the conveyor module section, and the transitions section. But, the easiest thing would be to just copy all this as your layout.nut and use it as a foundation to build upon.
//
// Attract-Mode Front-End - "Omega's SpinWheel" layout
//
class UserConfig {
</ label="SpinWheel", help="The artwork to spin", options="marquee,flyer,wheel" /> orbit_art="wheel";
</ label="Transition Time", help="Time in milliseconds for wheel spin." /> transition_ms="25";
}
local config = fe.get_config();
//fe.layout.width=1024;
//fe.layout.height=768;
local flx = fe.layout.width;
local fly = fe.layout.height;
local flw = fe.layout.width;
local flh = fe.layout.height;
//fe.layout.font="porkys";
// Image shadow/outline thickness
local offset = 4;
fe.add_image("bg", flw*0.0, flh*0.0, flw, flh);
local marquee = fe.add_artwork( "marquee", flw*0.0, flh*0.0, flw*0.4, flh*0.2 );
local snap = fe.add_artwork( "snap", flw*0.09, flh*0.30, flw*0.41, flh*0.545 );
local play = fe.add_text( " [PlayedCount] ", flw*0.7, flh*0.95, flw*0.3, flh*0.03 );
play.set_rgb( 255, 255, 255 );
play.align = Align.Right;
//text stuff
local title = fe.add_text( "[Title]", flw*0.105, flh*0.87, flw*0.4, flh*0.03 );
title.set_rgb( 255, 255, 255 );
title.align = Align.Left;
title.rotation = 0;
local year = fe.add_text( " [Year] [Manufacturer] ", flw*0.1, flh*0.91, flw*0.4, flh*0.03 );
year.set_rgb( 255, 255, 255 );
year.align = Align.Left;
year.rotation = 0;
local filter = fe.add_text( "[ListFilterName]: [ListEntry]-[ListSize]", flw*0.105, flh*0.95, flw*0.3, flh*0.03 );
filter.set_rgb( 255, 255, 255 );
filter.align = Align.Left;
filter.rotation = 0;
fe.load_module( "conveyor" );
local wheel_x = [ flx*0.80, flx*0.795, flx*0.756, flx*0.725, flx*0.70, flx*0.68, flx*0.64, flx*0.68, flx*0.70, flx*0.725, flx*0.756, flx*0.76, ];
local wheel_y = [ -fly*0.22, -fly*0.105, fly*0.0, fly*0.105, fly*0.215, fly*0.325, fly*0.436, fly*0.61, fly*0.72 fly*0.83, fly*0.935, fly*0.99, ];
local wheel_w = [ flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.25, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, ];
local wheel_a = [ 80, 80, 80, 80, 80, 80, 255, 80, 80, 80, 80, 80, ];
local wheel_h = [ flh*0.11, flh*0.11, flh*0.11, flh*0.11, flh*0.11, flh*0.11, flh*0.168, flh*0.11, flh*0.11, flh*0.11, flh*0.11, flh*0.11, ];
local wheel_r = [ 31, 26, 21, 16, 11, 6, 0, -11, -16, -21, -26, -31, ];
//local wheel_r = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ];
local num_arts = 10;
class WheelEntry extends ConveyorSlot
{
constructor()
{
base.constructor( ::fe.add_artwork( config["orbit_art"] ) );
}
function on_progress( progress, var )
{
local p = progress / 0.1;
local slot = p.tointeger();
p -= slot;
slot++;
if ( slot < 0 ) slot=0;
if ( slot >= 10 ) slot=10;
m_obj.x = wheel_x[slot] + p * ( wheel_x[slot+1] - wheel_x[slot] );
m_obj.y = wheel_y[slot] + p * ( wheel_y[slot+1] - wheel_y[slot] );
m_obj.width = wheel_w[slot] + p * ( wheel_w[slot+1] - wheel_w[slot] );
m_obj.height = wheel_h[slot] + p * ( wheel_h[slot+1] - wheel_h[slot] );
m_obj.rotation = wheel_r[slot] + p * ( wheel_r[slot+1] - wheel_r[slot] );
m_obj.alpha = wheel_a[slot] + p * ( wheel_a[slot+1] - wheel_a[slot] );
}
};
local wheel_entries = [];
for ( local i=0; i<num_arts/2; i++ )
wheel_entries.push( WheelEntry() );
local remaining = num_arts - wheel_entries.len();
// we do it this way so that the last wheelentry created is the middle one showing the current
// selection (putting it at the top of the draw order)
for ( local i=0; i<remaining; i++ )
wheel_entries.insert( num_arts/2, WheelEntry() );
local conveyor = Conveyor();
conveyor.set_slots( wheel_entries );
conveyor.transition_ms = 50;
try { conveyor.transition_ms = config["transition_ms"].tointeger(); } catch ( e ) { }
local message = fe.add_text("Ready Player One",0,300,fe.layout.width,80);
message.alpha = 0;
message.style = Style.Bold;
// Transitions
fe.add_transition_callback( "fancy_transitions" );
function fancy_transitions( ttype, var, ttime ) {
switch ( ttype )
{
case Transition.StartLayout:
case Transition.ToNewList:
case Transition.ToNewSelection:
case Transition.EndLayout:
break;
case Transition.FromGame:
if ( ttime < 255 )
{
foreach (o in fe.obj)
o.alpha = ttime;
message.alpha = 0;
return true;
}
else
{
foreach (o in fe.obj)
o.alpha = 255;
message.alpha = 0;
}
break;
case Transition.EndLayout:
if ( ttime < 255 )
{
foreach (o in fe.obj)
o.alpha = 255 - ttime;
message.alpha = 0;
return true;
}
else
{
foreach (o in fe.obj)
o.alpha = 255;
message.alpha = 0;
}
break;
case Transition.ToGame:
if ( ttime < 255 )
{
foreach (o in fe.obj)
o.alpha = 255 - ttime;
message.alpha = ttime;
return true;
}
break;
}
return false;
}