Author Topic: how do you animate artwork?  (Read 6545 times)

sickle

  • Full Member
  • ***
  • Posts: 65
    • View Profile
how do you animate artwork?
« on: April 25, 2020, 04:10:44 PM »
I've been using the animate module to animate all of the images, but when I apply the same script to artwork, it only displays the animation after I change the selected game. why is it not showing the animation when I trigger it, and how can I fix it?

my current code is:
Code: [Select]
function click (str) {
if (str == "custom2"){
local pic = fe.add_artwork( "flyer", 300, 200, 200, 200 );
local pic_cfg = {property = "x",start = 300,end = 600,time = 1000}
local pic_cfg2 = {property = "x",start = 600,end = 300,time = 1000,delay = 1000}
local pic_cfg3 = {property = "alpha",start = 255,end = 0,time = 500,delay = 3000}



animation.add( PropertyAnimation( pic, pic_cfg ) );
animation.add( PropertyAnimation( pic, pic_cfg2 ) );
animation.add( PropertyAnimation( pic, pic_cfg3 ) );

}
}
fe.add_signal_handler(this, "click")

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: how do you animate artwork?
« Reply #1 on: April 26, 2020, 06:50:48 AM »
dont think, can be fixed ,,with the" custom2"

notice if you switch the string to "prev_game" or somthing els it works..

plus the animation module is far from perfect.

sucks that 'wait dont work right ,   every time you push it keeps stacking the imiges..if you do it quikley
« Last Edit: April 26, 2020, 06:57:18 AM by jedione »
help a friend....

sickle

  • Full Member
  • ***
  • Posts: 65
    • View Profile
Re: how do you animate artwork?
« Reply #2 on: April 26, 2020, 09:57:02 AM »
ah, thanks for telling me.

I tried for a few hours yesterday with different methods, including making a class that included the images and the flyers and then animating the entire class, but I couldn't figure out how to correctly instantiate the class in a way that allowed it to be animated, though it worked just enough for me to see that the flyer still didn't appear correctly.

do you know of any other animation modules that I could use in place of the default animate?

sickle

  • Full Member
  • ***
  • Posts: 65
    • View Profile
Re: how do you animate artwork?
« Reply #3 on: April 26, 2020, 10:39:54 AM »
or, do you know how the onStart function works? does it mean at the start of the layout or the start of an animation? and if it is the latter, how would I implement it in a way that would allow me to trigger the flyer animation at the same time as the image animation?

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: how do you animate artwork?
« Reply #4 on: April 26, 2020, 03:39:59 PM »
i think this might be what u want,,, just basic animation,,,

note:  notice the alpha has no delay,  it fucks it up,  so settle for a long fade,  tryed this before..

just both marquee and flyer running,  set to next and previous game,  asumming you could set it som how to custum2
not shure what you are doing..

Code: [Select]


fe.layout.width = 1250;
fe.layout.height = 1025;


# load module
fe.load_module("animate");


    #marquee--------------------------------------------------
local pic = fe.add_artwork( "marquee", 300, 200, 200, 200 );
local pic_cfg = { when=Transition.ToNewSelection,
property = "x",
start = 300,
end = 600,
time = 1000
}

local pic_cfg1 = { when=Transition.ToNewSelection,
property = "x",
start = 600,
end = 300,
time = 1000,
delay = 1000
}

local pic_cfg2 = { when=Transition.ToNewSelection,
property = "alpha",
start = 255,
end = 0,
time = 4000,

}

animation.add( PropertyAnimation( pic, pic_cfg ) );
animation.add( PropertyAnimation( pic, pic_cfg1 ) );
animation.add( PropertyAnimation( pic, pic_cfg2 ) );


    #flyer---------------------------------------------------
local pic = fe.add_artwork( "flyer", 300, 500, 200, 200 );
local pic_cfg = { when=Transition.ToNewSelection,
property = "x",
start = 300,
end = 600,
time = 1000
}

local pic_cfg1 = { when=Transition.ToNewSelection,
property = "x",
start = 600,
end = 300,
time = 1000,
delay = 1000
}

local pic_cfg2 = { when=Transition.ToNewSelection,
property = "alpha",
start = 255,
end = 0,
time = 4000,

}

animation.add( PropertyAnimation( pic, pic_cfg ) );
animation.add( PropertyAnimation( pic, pic_cfg1 ) );
animation.add( PropertyAnimation( pic, pic_cfg2 ) );


help a friend....

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: how do you animate artwork?
« Reply #5 on: April 26, 2020, 03:44:00 PM »
as to onstart,,,  im pretty shure,   that is when theme loads,  first time,, one time. ;)
help a friend....

sickle

  • Full Member
  • ***
  • Posts: 65
    • View Profile
Re: how do you animate artwork?
« Reply #6 on: April 27, 2020, 05:29:47 AM »
I am making a turbografx 16 mini layout. I plan on making it as close as possible to the actual mini console. on the original console, when you select a game, it shows a quick animation the hucard (cartridge) being inserted into the console. you can see that here: https://www.youtube.com/watch?v=U6OsfZzd5-8&list=LL0YO3nJy9iqv8W6fOzvXDNg&index=2&t=0s.

I have most of that working, but the flyer that is on the hucard isn't displayed correctly (plus I'm working on it launching the game correctly, but that's a different post). as was stated before, if I change the input for example,  from custom2 to next_game; the flyer animates perfectly. I guess I could change the input to some other unused non-custom button, but I don't want the layout interacting strangely if somebody has things set up differently than me.

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: how do you animate artwork?
« Reply #7 on: April 27, 2020, 06:24:22 AM »
TG-16 mini,     bad ass bro...cant wait to see what you got...

if you need a tester.... ::)
help a friend....

sickle

  • Full Member
  • ***
  • Posts: 65
    • View Profile
Re: how do you animate artwork?
« Reply #8 on: April 27, 2020, 07:33:20 AM »
TG-16 mini,     bad ass bro...cant wait to see what you got...

if you need a tester.... ::)


haha definitely! this is my first layout, and I only started learning squirrel two or three weeks ago, so it might take a while, but ill definitely hit you up when I feel like its good enough for testing

qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
Re: how do you animate artwork?
« Reply #9 on: April 27, 2020, 08:11:01 AM »
You can use this:
Code: [Select]
Transition.ToGame ,property = "y"

Code: [Select]
/////////////////////
//Layer1
/////////////////////
local layer1_fadein = fe.add_image("../../modules/fade_in/media/[Emulator]/_Default/Layer 1.png", flx*0, fly*0, flw, flh );
layer1_fadein.alpha=0;

 local move_layer1_fadein = {
    when = Transition.ToGame ,property = "y", start = fly*-10, end = fly*0.85, time = 100,
 }


animation.add( PropertyAnimation ( layer1_fadein, move_layer1_fadein ) );

sickle

  • Full Member
  • ***
  • Posts: 65
    • View Profile
Re: how do you animate artwork?
« Reply #10 on: April 27, 2020, 10:30:54 AM »
ok, so i have an idea.
instead of using
Code: [Select]
fe.add_artwork {"flyer", ...} i could use
Code: [Select]
fe.add_image {".../scraper/turboEngine/flyer/[Title].jpg, ...} and then i wouldn't have to deal with any more complicated BS that i don't understand 8).

are there any problems with this method?


edit: nevermind, just tried this and it didn't fix anything
« Last Edit: April 27, 2020, 10:34:43 AM by sickle »

manzarek

  • Sr. Member
  • ****
  • Posts: 156
    • View Profile
    • YouTube
Re: how do you animate artwork?
« Reply #11 on: April 27, 2020, 02:54:16 PM »
wau beautiful theme, why don't you share it, you would make me happy.
Mame Fighting

sickle

  • Full Member
  • ***
  • Posts: 65
    • View Profile
Re: how do you animate artwork?
« Reply #12 on: April 27, 2020, 03:26:56 PM »
wau beautiful theme, why don't you share it, you would make me happy.

heh heh, that video I shared was of an actual console, not my theme. I'm trying to emulate it. but ill be sure to share the theme when its finished