Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: jedione on September 01, 2019, 07:20:54 AM
-
well what i have here is some code on switching the signal for buttons,
up,down,left,right.
under left i have added a fade animation,
so when u start layout u can go, up,down,right and doesent show animation, great..
when i go left, it shows the animation, like it should , great
but... now after showing animation with, left, up,down& right also trigger the animation, whitch i dont want..
anyone know how to insert some code to make animation reset or stop their,
hope this makes sence...
fe.layout.width = 1280;
fe.layout.height = 1024;
fe.load_module( "animate" );
function on_signal( sig )
{
switch ( sig )
{
case "up":
fe.signal( "next_game" );
return true;
case "down":
fe.signal( "prev_game" );
return true;
case "left":
fe.signal( "next_game" );
local abc = fe.add_image( "firstletter/[Buttons]", 70, 930, 1100, 50);
local fade_conf = {
when = Transition.ToNewSelection,
property = "alpha",
start = 255,
end = 0,
time = 2000,
loop = false,
}
animation.add( PropertyAnimation( abc, fade_conf ) );
return true;
case "right":
fe.signal( "prev_game" );
return true;
}
return false;
}
fe.add_signal_handler(this, "on_signal");
-
looks like everyone is taking the month off... :(
-
The problem here its you are adding this:
when = Transition.ToNewSelection,
I suppose you are using this code in your grid sega genesis mini.
Up,down,left and right is like a new selected game.
So, just avoid this part.
Look into my savestate plugin.
Im using fe.get_input_state, but what I want to do is almost the same.
local is_statesnap = fe.get_input_state ("J+Joy0 PovXneg")
if (is_statesnap) {
local alpha_bgstate = {
property = "alpha", start = 0 end = 255, time = 500 easing = Easing.In,
}
animation.add( PropertyAnimation( bgstate, alpha_bgstate ) );
Last problem its the animation will be triggered again when you press left...
But not when you press the other signals...
-
ill look in to that....sounds promising..
hmm save state, plugin.
yes i see that the "when = Transition.ToNewSelection" is the problem, what else should i expect from that..doing its job
if i find a break through ill post it up thanks... by the way i did also try your, code with animation
same thing ...lended code
fe.layout.width = 1280;
fe.layout.height = 1024;
fe.load_module( "animate" );
local image_left = fe.add_image( "firstletter/[Buttons]", 70, 930, 1100, 50);
local image_right = fe.add_image( "firstletter/[Buttons]", 70, 930, 1100, 50);
image_left.visible = false;
image_right.visible = false;
fe.add_ticks_callback( "tick_left" );
fe.add_ticks_callback( "tick_right" );
function tick_left( ttime )
{
if (fe.get_input_state("Left")==true)
{
image_left.visible = true;
}
else if (fe.get_input_state("Left")== false)
{
image_left.visible = false;
}
return true;
return false;
}
works good.... but as soon as you "depress" the button, done...no way to set delay
as animation delay is before, and not after...
shucks.. :(
-
could work.... ;D
-
maybe adding your video delay to it might make it work..?
back to work... weekend please come soon...