Author Topic: Hyperspin Theme Wheel's fade out  (Read 9365 times)

Himura95

  • Newbie
  • *
  • Posts: 3
    • View Profile
Hyperspin Theme Wheel's fade out
« on: March 25, 2016, 12:21:45 PM »
At first, Thanks a lot for this amazing frontend and sorry for my english...

I test hypersin themes and it work good but in hyperspin the wheel spin disapear after a certain time (1 seconde ?) without actions and show again if you move.

I like to reproduce this but it is difficult for me ^^

I think I need modify Hyperspin.nut and esspecialy the end but I test to insert a condition (a "if"...) but all I do is broke the layout ^^ :

Code: [Select]
// 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" );

If anyone would help to add this feature or give me the correct way, I thank you in advance ;)
« Last Edit: March 25, 2016, 12:34:45 PM by Himura95 »

kingtink

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Hyperspin Theme Wheel's fade out
« Reply #1 on: November 05, 2016, 02:07:36 PM »
did you ever get it to work? im looking for the wheel to disappear too

Himura95

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Hyperspin Theme Wheel's fade out
« Reply #2 on: November 28, 2016, 02:20:29 AM »
No and I never have a response too :(

massale

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Hyperspin Theme Wheel's fade out
« Reply #3 on: November 30, 2016, 05:54:34 AM »
I've done something that could do the job. It's available on github here : https://raw.githubusercontent.com/renebigot/attract/master/config/loader/hyperspin.nut

You can download this file and replace your config/loader/hypersin.nut with it.

A pull request is open, I hope it will be merge !


Himura95

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Hyperspin Theme Wheel's fade out
« Reply #4 on: December 01, 2016, 01:09:55 AM »
Thanks !!!

It works like I want with your code ;)

massale

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Hyperspin Theme Wheel's fade out
« Reply #5 on: December 02, 2016, 12:11:12 AM »
My code has been merge with the main branch of Attract Mode, it should be available in the next release :)
« Last Edit: December 02, 2016, 02:40:25 AM by massale »