Author Topic: shuffle module Q: regards animation  (Read 395 times)

jedione

  • Hero Member
  • *****
  • Posts: 674
  • punktoe
    • View Profile
shuffle module Q: regards animation
« on: February 16, 2019, 02:41:47 PM »
hey guys,   i have too theems that i am ready to release,  but ....the shuffle module was updated
and i would like to use it...   i have them working with the original shuffle.nut,    but not the new one

so original sample code working....
Code: [Select]
class ShufflePow extends Shuffle
 {

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

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

}


local pow = ShufflePow(9, "artwork", "flyer");


pow.slots[0].set_pos(flx*-0.051, y, w, h);
local pic_cfg = {
when =Transition.ToNewSelection,
property = "scale",
start = 1.0,
end = size,
time = 0500,
//tween = Tween.Linear,
}
animation.add( PropertyAnimation( pow.slots[0], pic_cfg ) );
pow.slots[0].mipmap = true;
each slot has a # so i can give it its own animation!


now with the new code,,,for new module
Code: [Select]
## Overwrite the select function
#######################################
function select(slot) {
slot.visible = true;
slot.set_rgb (200,160,0);
}

## Overwrite the select function
#######################################
function deselect(slot) {
slot.visible = false;
}
}

## extended image list
#######################################
local pow = [];
pow.push(fe.add_image("art/icon.png", x1, fly*0.118, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.173, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.228, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.283, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.338, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.393, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.448, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.503, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.558, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.613, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.668, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.723, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.778, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.833, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.888, w1, h1));

## Create an instance of the extended class
#########################################

local list = ShuffleList(list, "text");
local pow = ShufflePow(pow, "image");

their is no way to add an animation to a selected position?   if that makes sence..
their all the same with just diff concordances...

help....thanks



help a friend....

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 888
    • View Profile
Re: shuffle module Q: regards animation
« Reply #1 on: February 16, 2019, 03:05:44 PM »
Your writing over the variable pow. Pow as an array and then a class. Fix that and then have your animation reference the objects stored in the array you created.

If you need further help, I can do an example later tonight when on the computer.

jedione

  • Hero Member
  • *****
  • Posts: 674
  • punktoe
    • View Profile
Re: shuffle module Q: regards animation
« Reply #2 on: February 16, 2019, 05:28:46 PM »
yes i will need that help...and as always  thank you

i know you put some good effort into making the release of this module,,and i just want to
be part of it..  to use the future code...instead of the old code.   thanks bro. :D
help a friend....

jedione

  • Hero Member
  • *****
  • Posts: 674
  • punktoe
    • View Profile
Re: shuffle module Q: regards animation
« Reply #3 on: February 16, 2019, 05:37:03 PM »
tell me if im wrong but wouldn't that mean,,  with the old code it is already set as "objects"
because i get it to work fine...with it ?

witch would mean it is "simpler"   speaking from a laymen s terms ...maybe



help a friend....

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 888
    • View Profile
Re: shuffle module Q: regards animation
« Reply #4 on: February 16, 2019, 07:11:30 PM »
Some missing information. I tried to fill in the blanks. Make notice of my comments. I also know nothing about animations, so hopefully that part works. Give it a shot, but you might have to tweak it. Going to bed. Let me know how you make out. Will check in the am.

Code: [Select]
// ---------- List

class ShuffleList extends Shuffle
function select(slot) {
    slot.set_rgb (200,160,0);
  }

function deselect(slot) {
    slot.set_rgb (200,160,0); // set to another color?
}
}

local list = []
  list.push(); // add objects

local shuffleList = ShuffleList(list, "text");

// ---------- Pow

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

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

local pow = [];
pow.push(fe.add_image("art/icon.png", x1, fly*0.118, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.173, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.228, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.283, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.338, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.393, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.448, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.503, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.558, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.613, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.668, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.723, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.778, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.833, w1, h1));
pow.push(fe.add_image("art/icon.png", x1, fly*0.888, w1, h1));

  local powAnimation = {
  when = Transition.ToNewSelection,
  property = "scale",
  start = 1.0,
  end = size,
  time = 0500,
  }

  for (local i=0; i<pow.len(); i++) {
    pow[i].mipmap = true;
    animation.add(PropertyAnimation(pow[i], powAnimation));
  }

local shufflePow = ShufflePow(pow, "image");


jedione

  • Hero Member
  • *****
  • Posts: 674
  • punktoe
    • View Profile
Re: shuffle module Q: regards animation
« Reply #5 on: February 16, 2019, 07:42:20 PM »
im thinking i... couold send you a fully working copy,,,of the original....or did already..

using the original shuffle.nut  working with the animation...this would probably set it all strait for us..im thinking

would that be ok..keil..
help a friend....

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 888
    • View Profile
Re: shuffle module Q: regards animation
« Reply #6 on: February 16, 2019, 08:38:07 PM »
Feel free to send me an updated copy and I work off that.

qqplayer

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
Re: shuffle module Q: regards animation
« Reply #7 on: February 17, 2019, 03:40:05 AM »
I made this , can send you the code if you want.
Dont know if works with lastests shuffle version.

https://www.youtube.com/watch?v=5h8fs_w_Ytg