Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: jedione 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....
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
## 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
-
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.
-
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
-
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
-
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.
// ---------- 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");
-
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..
-
Feel free to send me an updated copy and I work off that.
-
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