Author Topic: How Can I Accomplish This?  (Read 2664 times)

FrizzleFried

  • Sr. Member
  • ****
  • Posts: 243
    • View Profile
    • Idaho Garagecade
How Can I Accomplish This?
« on: May 06, 2018, 08:55:15 PM »
I have an image that is animated based the trigger to change game.  I need that image to remain blank (zero alpha) until the animation starts... how is that accomplished?

Visit my arcade blog ... www.idahogaragecade.com (updated 06-27-19)

qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
Re: How Can I Accomplish This?
« Reply #1 on: May 07, 2018, 03:48:56 AM »
I have an image that is animated based the trigger to change game.  I need that image to remain blank (zero alpha) until the animation starts... how is that accomplished?

This is for "snap" but si the same thing:

Code: [Select]
local snap = fe.add_artwork( "snap", 38, 30, 680, 424 );
snap.preserve_aspect_ratio = false;
snap.alpha = 0;

snap.alpha = 0

FrizzleFried

  • Sr. Member
  • ****
  • Posts: 243
    • View Profile
    • Idaho Garagecade
Re: How Can I Accomplish This?
« Reply #2 on: May 07, 2018, 06:48:59 AM »
Tried that... the element STAYS at zero alpha.  I need it to be zero alpha at the start then 255 alpha from the moment a key is touched...

Essentially I have two animations going... one that "zooms in" the just selected to artwork... and one that "zooms out" the prior selected artwork.  It works great if you go one direction... but as soon as you try the other direction the artwork that is "zooming out" is off by 2 because of the index_offset setting that I had to set to make sure the image zooming out was the "last" image dished up and not the "current" image being dished up by the system.   In order to combat this I created two local's ...one that would dish up the proper offset image going left... and another going right.  It works great too ONCE YOU MOVE LEFT/RIGHT ONCE.  Until then,  both the -1 and 1 offset images appear on screen UNTIL you click left then right then they properly get setup and things work great from there... I'm just trying to make those images BLANK until the user pushes left or right...

I hope I'm explaining correctly...
Visit my arcade blog ... www.idahogaragecade.com (updated 06-27-19)

FrizzleFried

  • Sr. Member
  • ****
  • Posts: 243
    • View Profile
    • Idaho Garagecade
Re: How Can I Accomplish This?
« Reply #3 on: May 07, 2018, 11:02:19 AM »
Here is the code in question...

Code: [Select]
local marquee2 = fe.add_artwork( "wheel", flx*0.150, 5, flw*0.700, flh*0.200 );
marquee2.index_offset = -1

local marquee2_scale_cfg = {
when = function( anim ) { if ( anim.transition.ttype == Transition.FromOldSelection && anim.transition.var == -1 ) return true; return false; },
property = "scale",
start = 1.0,
end = 0.01,
time = 0500,
tween = Tween.Linear,
}
local marquee2_move_cfg = {
when = function( anim ) { if ( anim.transition.ttype == Transition.FromOldSelection && anim.transition.var == -1 ) return true; return false; },
property = "y",
start = fly*0.010,
end = fly*0.140,
time = 0500 ,
}

local marquee3 = fe.add_artwork( "wheel", flx*0.150, 5, flw*0.700, flh*0.200 );
marquee3.index_offset = 1

local marquee3_scale_cfg = {
when = function( anim ) { if ( anim.transition.ttype == Transition.FromOldSelection && anim.transition.var == 1 ) return true; return false; },
property = "scale",
start = 1.0,
end = 0.01,
time = 0500,
tween = Tween.Linear,
}
local marquee3_move_cfg = {
when = function( anim ) { if ( anim.transition.ttype == Transition.FromOldSelection && anim.transition.var == 1 ) return true; return false; },
property = "y",
start = fly*0.010,
end = fly*0.140,
time = 0500 ,
}
local marquee = fe.add_artwork( "wheel", flx*0.150, fly*-0.2, flw*0.700, flh*0.200 );
local marquee_move_cfg = {
when =Transition.ToNewSelection,
property = "y",
start = fly*-0.2,
end = fly*0.010,
time = 500 ,
tween = Tween.Expo,

}
animation.add( PropertyAnimation( marquee, marquee_move_cfg ) );
animation.add( PropertyAnimation( marquee2, marquee2_scale_cfg ) );
animation.add( PropertyAnimation( marquee2, marquee2_move_cfg ) );
animation.add( PropertyAnimation( marquee3, marquee3_scale_cfg ) );
animation.add( PropertyAnimation( marquee3, marquee3_move_cfg ) );
Visit my arcade blog ... www.idahogaragecade.com (updated 06-27-19)