Author Topic: fe.signal Q:  (Read 166 times)

jedione

  • Hero Member
  • *****
  • Posts: 736
  • punktoe
    • View Profile
fe.signal Q:
« 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...

Code: [Select]
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");
help a friend....

jedione

  • Hero Member
  • *****
  • Posts: 736
  • punktoe
    • View Profile
Re: fe.signal Q:
« Reply #1 on: September 08, 2019, 04:21:01 PM »
looks like everyone is taking the month off... :(
help a friend....

qqplayer

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
Re: fe.signal Q:
« Reply #2 on: September 09, 2019, 02:40:07 PM »
The problem here its you are adding this:

Code: [Select]
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.

Code: [Select]
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...
« Last Edit: September 09, 2019, 02:46:00 PM by qqplayer »

jedione

  • Hero Member
  • *****
  • Posts: 736
  • punktoe
    • View Profile
Re: fe.signal Q:
« Reply #3 on: September 09, 2019, 06:20:51 PM »
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

Code: [Select]
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.. :(
« Last Edit: September 09, 2019, 06:33:07 PM by jedione »
help a friend....

jedione

  • Hero Member
  • *****
  • Posts: 736
  • punktoe
    • View Profile
Re: fe.signal Q:
« Reply #4 on: September 09, 2019, 06:28:35 PM »
could work.... ;D
help a friend....

jedione

  • Hero Member
  • *****
  • Posts: 736
  • punktoe
    • View Profile
Re: fe.signal Q:
« Reply #5 on: September 09, 2019, 06:34:59 PM »
maybe adding your video delay to it might make it work..?

back to work...  weekend   please come soon...
help a friend....