Author Topic: Animate a Shuffle List  (Read 472 times)

iOtero

  • Sr. Member
  • ****
  • Posts: 171
    • View Profile
Animate a Shuffle List
« on: June 28, 2018, 03:35:00 PM »
I want to make an animation of a Shuffle List made with the keilmillerjr module.

It is this:

Code: [Select]
// List
if (my_config["wheel_type"] == "list")
{

fe.load_module("shuffle");

local list = Shuffle(10, "text", "[Title]");

list.slots[0].set_pos(flx*0.75, fly*0.17, flw*0.25, flh*0.042);
list.slots[0].set_rgb(R,G,B);
list.slots[0].charsize = font_list_size;
list.slots[0].align = my_align;

list.slots[1].set_pos(flx*0.75, fly*0.20, flw*0.25, flh*0.042);
list.slots[1].set_rgb(R,G,B);
list.slots[1].charsize = font_list_size;
list.slots[1].align = my_align;

list.slots[2].set_pos(flx*0.75, fly*0.23, flw*0.25, flh*0.042);
list.slots[2].set_rgb(R,G,B);
list.slots[2].charsize = font_list_size;
list.slots[2].align = my_align;

list.slots[3].set_pos(flx*0.75, fly*0.26, flw*0.25, flh*0.042);
list.slots[3].set_rgb(R,G,B);
list.slots[3].charsize = font_list_size;
list.slots[3].align = my_align;

list.slots[4].set_pos(flx*0.75, fly*0.29, flw*0.25, flh*0.042);
list.slots[4].set_rgb(R,G,B);
list.slots[4].charsize = font_list_size;
list.slots[4].align = my_align;

list.slots[5].set_pos(flx*0.75, fly*0.32, flw*0.25, flh*0.042);
list.slots[5].set_rgb(R,G,B);
list.slots[5].charsize = font_list_size;
list.slots[5].align = my_align;

list.slots[6].set_pos(flx*0.75, fly*0.35, flw*0.25, flh*0.042);
list.slots[6].set_rgb(R,G,B);
list.slots[6].charsize = font_list_size;
list.slots[6].align = my_align;

list.slots[7].set_pos(flx*0.75, fly*0.38, flw*0.25, flh*0.042);
list.slots[7].set_rgb(R,G,B);
list.slots[7].charsize = font_list_size;
list.slots[7].align = my_align;

list.slots[8].set_pos(flx*0.75, fly*0.41, flw*0.25, flh*0.042);
list.slots[8].set_rgb(R,G,B);
list.slots[8].charsize = font_list_size;
list.slots[8].align = my_align;

list.slots[9].set_pos(flx*0.75, fly*0.44, flw*0.25, flh*0.042);
list.slots[9].set_rgb(R,G,B);
list.slots[9].charsize = font_list_size;
list.slots[9].align = my_align;


class ShufflePow extends Shuffle
{
function select(slot)
{
slot.visible = true;
}

function deselect(slot)
{
slot.visible = false;
}
}

local my_pointer = my_config["set_marker_rgb"] + ".png";

local pow = ShufflePow(10, "image", "pointers/" + my_pointer);

pow.slots[0].set_pos(flx*0.7498, fly*0.18, flw*0.25, flh*0.026);
pow.slots[1].set_pos(flx*0.7498, fly*0.21, flw*0.25, flh*0.026);
pow.slots[2].set_pos(flx*0.7498, fly*0.24, flw*0.25, flh*0.026);
pow.slots[3].set_pos(flx*0.7498, fly*0.27, flw*0.25, flh*0.026);
pow.slots[4].set_pos(flx*0.7498, fly*0.30, flw*0.25, flh*0.026);
pow.slots[5].set_pos(flx*0.7498, fly*0.33, flw*0.25, flh*0.026);
pow.slots[6].set_pos(flx*0.7498, fly*0.36, flw*0.25, flh*0.026);
pow.slots[7].set_pos(flx*0.7498, fly*0.39, flw*0.25, flh*0.026);
pow.slots[8].set_pos(flx*0.7498, fly*0.42, flw*0.25, flh*0.026);
pow.slots[9].set_pos(flx*0.7498, fly*0.45, flw*0.25, flh*0.026);


// Sound
function fade_transitions(ttype, var, ttime) {
switch (ttype) {
case Transition.ToNewSelection:
case Transition.ToNewList:
local Wheelclick = fe.add_sound("pointers/clic.mp3")
Wheelclick.playing=true
break;
}
return false;
}

fe.add_transition_callback("fade_transitions");
}


To animate a normal ListBox, i use objects, as in this example, which makes it disappear on the right after 5 seconds:

Code: [Select]
// Listbox
if (my_config["wheel_type"] == "listbox")
{
::OBJECTS <- {lbx = fe.add_listbox(flx*0.75, fly*0.2, flw*0.25, flh*0.8)}
OBJECTS.lbx.rows = 27;
OBJECTS.lbx.charsize = font_list_size;
OBJECTS.lbx.set_selbg_rgb(Rs,Gs,Bs);
OBJECTS.lbx.set_rgb(R,G,B);
OBJECTS.lbx.set_sel_rgb(R,G,B);
OBJECTS.lbx.sel_style = Style.Bold;

// List Text Align
if (my_config["set_align"] == "centre") OBJECTS.lbx.align = Align.Centre;
if (my_config["set_align"] == "left") OBJECTS.lbx.align = Align.Left;
if (my_config["set_align"] == "right") OBJECTS.lbx.align = Align.Right;

local my_delay = 5000;

local move_lbx1 = { when = Transition.ToNewSelection, property = "x", start = OBJECTS.lbx.x + OBJECTS.lbx.width, end = OBJECTS.lbx.x, time = 1 }
local move_lbx2 = { when = When.ToNewSelection, property = "x", start = OBJECTS.lbx.x, end = OBJECTS.lbx.x + OBJECTS.lbx.width, time = 595, delay=my_delay }
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx1));
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx2));
}

Well, i would like the Shuffle List to do the same, but i do not know how.

keilmillerjr, please tell me if it can be done or not, thank you.
« Last Edit: August 29, 2018, 05:11:15 AM by iOtero »

iOtero

  • Sr. Member
  • ****
  • Posts: 171
    • View Profile
Re: Animate a Suffle List
« Reply #1 on: July 04, 2018, 02:23:24 AM »
keilmillerjr seems to be on holidays or missing in action...  ::)

bundangdon

  • Sr. Member
  • ****
  • Posts: 152
    • View Profile
Re: Animate a Suffle List
« Reply #2 on: July 04, 2018, 05:10:02 AM »
keilmillerjr seems to be on holidays or missing in action...  ::)

Not missing in action. I noticed he was on attractmode's discord site earlier today  :D

qqplayer

  • Sr. Member
  • ****
  • Posts: 245
    • View Profile
Re: Animate a Suffle List
« Reply #3 on: July 04, 2018, 05:43:31 AM »
Change for text and avoid "width''  ;D

Code: [Select]
class ShufflePow extends Shuffle
 {

   function select(slot)
 {
slot.visible = true;
}

function deselect(slot)
 {
slot.visible = false;
}

}


::OBJECTS1 <- {
pow = ShufflePow(5, "artwork", "flyer2")
}

OBJECTS1.pow.slots[0].set_pos(flx*0.018, flh*0.495, flw*0.19, flh*0.45);

//Slot 0 Animation
fe.add_transition_callback( "first_transitions" );
function first_transitions( ttype, var, ttime ) {
 switch ( ttype )
 {
 
  case Transition.StartLayout:
  case Transition.ToNewList:
  case Transition.ToNewSelection:
   
  local pow0_alpha_onload = {
    property = "alpha",
    start = 55,
    end = 255,
    time = 200,
    tween = Tween.Expo,
    } 
   
  animation.add( PropertyAnimation ( OBJECTS1.pow.slots[0], pow0_alpha_onload ) );
   
    local pow0_width_onload = {
    property = "width",
    start = flw*0.005,
    end = flw*0.244,
    time = 400,
    tween = Tween.Expo,
    }
   
  animation.add( PropertyAnimation ( OBJECTS1.pow.slots[0], pow0_width_onload ) );

  break;
 }
 return false;
 }


OBJECTS1.pow.slots[1].set_pos(flx*0.148, flh*0.06, flw*0.9, flh*0.45);
local pow1_alpha = {
    when = Transition.ToNewSelection, property = "alpha", start = 55, end = 255, time = 200, tween = Tween.Expo,
 }
 animation.add( PropertyAnimation( OBJECTS1.pow.slots[1], pow1_alpha ) );
 
local pow1_width = {
    when = Transition.ToNewSelection, property = "width", start = flw*0.005, end = flw*0.244, time = 500, tween = Tween.Expo,
 }
 animation.add( PropertyAnimation( OBJECTS1.pow.slots[1], pow1_width ) );
 
 

OBJECTS1.pow.slots[2].set_pos(flx*0.348, flh*0.06, flw*0.19, flh*0.45);
local pow2_alpha = {
    when = Transition.ToNewSelection, property = "alpha", start = 55, end = 255, time = 200, tween = Tween.Expo,
 }
 animation.add( PropertyAnimation( OBJECTS1.pow.slots[2], pow2_alpha ) );
 
local pow2_width = {
    when = Transition.ToNewSelection, property = "width", start = flw*0.005, end = flw*0.244, time = 500, tween = Tween.Expo,
 }
 animation.add( PropertyAnimation( OBJECTS1.pow.slots[2], pow2_width ) );
 
 

OBJECTS1.pow.slots[3].set_pos(flx*0.548, flh*0.06, flw*0.19, flh*0.45);
local pow3_alpha = {
    when = Transition.ToNewSelection, property = "alpha", start = 55, end = 255, time = 200, tween = Tween.Expo,
 }
 animation.add( PropertyAnimation( OBJECTS1.pow.slots[3], pow3_alpha ) );
 
local pow3_width = {
    when = Transition.ToNewSelection, property = "width", start = flw*0.005, end = flw*0.244, time = 500, tween = Tween.Expo,
 }
 animation.add( PropertyAnimation( OBJECTS1.pow.slots[3], pow3_width ) );
 
 

OBJECTS1.pow.slots[4].set_pos(flx*0.748, flh*0.06, flw*0.19, flh*0.45);
local pow4_alpha = {
    when = Transition.ToNewSelection, property = "alpha", start = 55, end = 255, time = 200, tween = Tween.Expo,
 }
 animation.add( PropertyAnimation( OBJECTS1.pow.slots[4], pow4_alpha ) );
 
local pow4_width = {
    when = Transition.ToNewSelection, property = "width", start = flw*0.005, end = flw*0.244, time = 500, tween = Tween.Expo,
 }
 animation.add( PropertyAnimation( OBJECTS1.pow.slots[4], pow4_width ) );
« Last Edit: July 04, 2018, 05:46:54 AM by qqplayer »

keilmillerjr

  • Hero Member
  • *****
  • Posts: 552
    • View Profile
Re: Animate a Suffle List
« Reply #4 on: July 04, 2018, 07:33:51 AM »
Sorry. My attendance is flakey past few months. Holiday means I have some time. Was busy past two nights writin a new plugin and something else, almost ready for release. ;)

I am not very familiar with animation module. I write simple animations from scratch and call it good. I wrote shuffle to be simple, without complexity. That doesn’t mean that simple animations can’t be added. I have thought of adding positioning like conveyor if some one experienced with conveyor wanted to team up with me.

Anyways, I will check out your examples tonight. You can extend select and deselect functions and use them possibly to trigger animations. If you have a layout you are working on, send it to me.

iOtero

  • Sr. Member
  • ****
  • Posts: 171
    • View Profile
Re: Animate a Suffle List
« Reply #5 on: July 05, 2018, 09:17:16 AM »
Sorry. My attendance is flakey past few months. Holiday means I have some time. Was busy past two nights writin a new plugin and something else, almost ready for release. ;)

I am not very familiar with animation module. I write simple animations from scratch and call it good. I wrote shuffle to be simple, without complexity. That doesn’t mean that simple animations can’t be added. I have thought of adding positioning like conveyor if some one experienced with conveyor wanted to team up with me.

Anyways, I will check out your examples tonight. You can extend select and deselect functions and use them possibly to trigger animations. If you have a layout you are working on, send it to me.

Thanks...

My layout: http://forum.attractmode.org/index.php?topic=481.msg15538#msg15538

iOtero

  • Sr. Member
  • ****
  • Posts: 171
    • View Profile
Re: Animate a Suffle List
« Reply #6 on: July 17, 2018, 12:51:55 PM »
I already have the issue solved.

I already know how to move and fade a Suffle List.

I have implemented it in my LCD theme.

I'm just waiting to solve a small bug that i think AM has to upload the updated version of LCD with animated Shuffle List.

I've put it in the forum, to see if someone tells me how to fix it.

In any case, many thanks to qqplayer for your help. My final code is something different from yours, but he gave me the necessary clues to do what i wanted.

keilmillerjr

  • Hero Member
  • *****
  • Posts: 552
    • View Profile
Re: Animate a Suffle List
« Reply #7 on: July 17, 2018, 01:57:31 PM »
I already have the issue solved.

I already know how to move and fade a Suffle List.

I have implemented it in my LCD theme.

I'm just waiting to solve a small bug that i think AM has to upload the updated version of LCD with animated Shuffle List.

I've put it in the forum, to see if someone tells me how to fix it.

In any case, many thanks to qqplayer for your help. My final code is something different from yours, but he gave me the necessary clues to do what i wanted.

That’s awesome news! I feel bad I couldn’t be of help, but glad qqplayer was able to assist. I’m trying to get a new job where I can work reasonable hours. Can’t wait to see the final product!

iOtero

  • Sr. Member
  • ****
  • Posts: 171
    • View Profile
Re: Animate a Shuffle List
« Reply #8 on: July 18, 2018, 04:30:07 AM »
While i wait for the solution to the bug of the listbox fade, i'll show you how the shuffle list animation looks like:

https://www.youtube.com/watch?v=j0qFbRAI1r4
« Last Edit: July 18, 2018, 10:47:21 AM by zlagos »

keilmillerjr

  • Hero Member
  • *****
  • Posts: 552
    • View Profile
Re: Animate a Shuffle List
« Reply #9 on: July 18, 2018, 03:36:59 PM »
While i wait for the solution to the bug of the listbox fade, i'll show you how the shuffle list animation looks like:

https://www.youtube.com/watch?v=j0qFbRAI1r4

I totally understand what you wanted now. You could place all objects on a surface or seperately and use animate module or roll your own since a simple fade is easy enough with transition, ticks, and opacity. What is the bug you have? Video looks great!

iOtero

  • Sr. Member
  • ****
  • Posts: 171
    • View Profile
Re: Animate a Shuffle List
« Reply #10 on: July 20, 2018, 05:06:47 AM »
The problem is here:

http://forum.attractmode.org/index.php?topic=2331.0

It's about the fade out of the listbox, not the shuffle list.

iOtero

  • Sr. Member
  • ****
  • Posts: 171
    • View Profile
Re: Animate a Shuffle List
« Reply #11 on: July 24, 2018, 12:18:55 PM »
Problem solved, here is the little theme where i have implemented the animations:

http://forum.attractmode.org/index.php?topic=2271.0

Apparently AM has already fixed the bug. But i still have not gotten an AM version to do it, so i have used the help of a code that my friend qqplayer has given me to solve it.

In any case, I can only get a nightly version of windows, not the ones i need from Mac or LInux, so i'll leave it with the added code, which works on all systems.
« Last Edit: July 24, 2018, 12:25:59 PM by zlagos »

keilmillerjr

  • Hero Member
  • *****
  • Posts: 552
    • View Profile
Re: Animate a Shuffle List
« Reply #12 on: July 24, 2018, 03:57:22 PM »
Want me to compile a fresh copy for Mac tonight? I’ve always been able to compile, and it worked. I resolved some issues. Packaging the libraries had me stumped. Looking at 2.4 notes, someone did some fixing on the make script.

iOtero

  • Sr. Member
  • ****
  • Posts: 171
    • View Profile
Re: Animate a Shuffle List
« Reply #13 on: July 25, 2018, 03:33:03 AM »
Want me to compile a fresh copy for Mac tonight? I’ve always been able to compile, and it worked. I resolved some issues. Packaging the libraries had me stumped. Looking at 2.4 notes, someone did some fixing on the make script.

Thanks, but what i need is for Mountain Lion. For High Sierra i have managed to compile.
About Attrac-Mode 2.4 at Mountain Lion, nothing can be done.
Version 2.4 searches for libraries that Mountain Lion does not have and that can only be installed through homebrew.
And in Mountain Lion now there is no way to install homebrew.
So you have to settle for version 2.2.
« Last Edit: July 26, 2018, 02:37:46 PM by zlagos »