1
Scripting / Re: Hyperspin Theme Wheel's fade out
« on: December 01, 2016, 01:09:55 AM »
Thanks !!!
It works like I want with your code
It works like I want with your code
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
// Set up the wheel
//
fe.load_module( "conveyor" );
local flw = fe.layout.width;
local flh = fe.layout.height;
local wheel_w = 300;
local wheel_x = [ flw*0.70, flw*0.695, flw*0.656, flw*0.625, flw*0.60, flw*0.58, flw*0.54, flw*0.58, flw*0.60, flw*0.625, flw*0.656, flw*0.66, ];
local wheel_y = [ -flh*0.22, -flh*0.105, flh*0.0, flh*0.105, flh*0.215, flh*0.325, flh*0.436, flh*0.61, flh*0.72 flh*0.83, flh*0.935, flh*0.99, ]
local wheel_w = [ wheel_w, wheel_w, wheel_w, wheel_w, wheel_w, wheel_w, wheel_w*1.5, wheel_w, wheel_w, wheel_w, wheel_w, wheel_w ];
local wheel_a = [ 80, 80, 80, 80, 80, 80, 255, 80, 80, 80, 80, 80, ];
local wheel_r = [ 30, 25, 20, 15, 10, 5, 0, -10, -15, -20, -25, -30, ];
class WheelEntry extends ConveyorSlot
{
constructor()
{
base.constructor( ::fe.add_artwork( "wheel" ) );
}
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 = 0;
m_obj.preserve_aspect_ratio=true;
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 num_arts = 10;
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() );
wheel <- Conveyor();
wheel.set_slots( wheel_entries );
wheel.transition_ms = wheel_ms;
if ( my_config["show_prompts"] == "yes" )
{
::special1 <- fe.add_image( "" );
::special2 <- fe.add_image( "" );
}
// make sure the override transition object is drawn over the wheel
::hs_ent["override_transition"].obj.zorder=9999;
hs_animation <- AnimationCore();
//
// don't register the AnimationCore transition callback, our transition
// callback will call into AnimationCore itself
//
fe.add_ticks_callback( hs_animation, "ticks_callback" );