Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - calle81

Pages: [1] 2 3 4
1
Mickelson has added support for nesting in the source. I haven't tried it myself

https://github.com/mickelson/attract/commit/b71b0e48c478a115a9648968701b6191f831e23e

2
Scripting / Game info text [Overview] causes pi to struggle
« on: September 12, 2017, 03:12:11 PM »
Hi,

Adding game info text like below causes performance issues on a pi when scrolling through a wheel. I was hoping that adding a transition state would solve the problem but it seems transitions and text don't work together. If you have any ideas pleas let me know.

local gtext = fe.add_text("[Overview]", flx*0.73, fly*0.25, flw*0.25, flh*0.45 );
gtext.set_rgb( 255, 255, 255 );
gtext.align = Align.Left;
gtext.charsize = 20;
gtext.rotation = 0;
gtext.word_wrap = true;
gtext.font = "MyriadPro-Bold.otf"
gtext.trigger = Transition.EndNavigation;

3
Themes / Need help with snap delay function
« on: September 11, 2017, 06:01:59 AM »
Hi, I need help finishing this snap delay function. Thanks for offering to help Kent79 :) I attached the nut file. It wont make much sense loaded in AM without Hurstys tiles and a bunch of other stuff. The code is at the bottom of the file. End goal is to have 1 or sec delay before the snap starts playing.

/////////////////////
//Snap playback with delay
////////////////////   
local snap_active = false;
local delay = 0;
local max_delay = 0;
snap.playing = snap_active;

max_delay=abs(("0"+my_config["dtime"]).tointeger())
max_delay=(max_delay>999 ? 100 : max_delay);

::fe.add_ticks_callback( this, "tick_fn" );

function tick_fn( ttime )
   {
      delay++;
      if ( delay > max_delay )
      {     
         if (snap_active == false){
         local snap = fe.add_artwork ( "snap", flx*0.183, fly*0.0376, flw*0.635, flh*0.56 );
//         snap.trigger = Transition.EndNavigation;
         snap.preserve_aspect_ratio = true;      
         snap_active = true;
         snap.playing = snap_active;
         }

      }
   }


4
Themes / Theme the filters menu
« on: September 10, 2017, 09:28:57 AM »
Hi,

I've seen themed filter menus in some theme. Are there any nice nut files to look at to learn how this can be accomplished?

5
Scripting / Re: Pause AM During Intro Movie?
« on: September 08, 2017, 12:31:11 PM »
The animation module doesn't seem to help either. The delay value does not halt the snap from playing. The snap starts playing and then after 1 sec the animation kicks in making it look really weird.


local snap = fe.add_artwork( "snap" , 0, 0, flw, flh);
snap.preserve_aspect_ratio = true;
snap.trigger = Transition.EndNavigation;
local snapfade = {

   when = Transition.ToNewSelection
   property = "alpha",
   start = 0,
   end = 255,
        time = 7000,
   pulse = false
   delay = 1000
}
animation.add( PropertyAnimation ( snap, snapfade ) );   

6
Scripting / Re: Pause AM During Intro Movie?
« on: September 07, 2017, 02:10:15 PM »
Dumbed it down to troubleshoot but is does not seem to add any ticks:

local delay = 0;
local max_delay= 100;

::fe.add_ticks_callback( this, "tick_fn" );
function tick_fn( ttime )
{
delay++;
if ( delay > max_delay )
{

local test_art = fe.add_image("background/carbon.png", 0, 0, flw, flh );
test_art.alpha=255;
}
}

7
Scripting / Re: Pause AM During Intro Movie?
« on: September 05, 2017, 06:55:04 AM »
The problem is that even if I change it to just display an image the code seems to loop and does not show the image or proceed to display the wheel etc which is beneath the loop. Can you see if there is something missing in the code that does not allow it to proceed?

/Carl

8
Scripting / Re: Pause AM During Intro Movie?
« on: August 30, 2017, 01:51:56 PM »
hi calle81,

well the main idea is to have 2 flags and 1 timer

the function tick_fn( ttime ){} Does not have much loss there, just keep ticking a executing everyting inside the block

the first flag (max_delay) will help you to control the time in which you want to run the code

the second flag (music_active) will help to keep at bay the code inside the timer (Avoid repeating indefinitely, will execute only once or each time the layout.nut is loaded)

Ok, I understand the concept but still not clear on where to put the lines to make it play the snap. I'm slowly learning this scripting stuff so excuse my noob questions. This what i entered in my theme but it breaks it and does not get further to display the wheel etc which is beneath this code:

local snap_active = false;
local delay = 0;
local max_delay = 0;
snap.playing = snap_active;

max_delay=abs(("0"+my_config["dtime"]).tointeger())
max_delay=(max_delay>999 ? 100 : max_delay);

::fe.add_ticks_callback( this, "tick_fn" );

function tick_fn( ttime )
   {
      delay++;
      if ( delay > max_delay )
      { 
         if (snap_active == false){
            snap_active = true;
            snap.playing = snap_active;
      local snap = FadeArt ( "snap", flx*0.183, fly*0.0376, flw*0.635, flh*0.56 );
      snap.trigger = Transition.EndNavigation;
      snap.preserve_aspect_ratio = true;         
         }
      
      }
   }


9
Scripting / Re: Pause AM During Intro Movie?
« on: August 29, 2017, 02:15:57 PM »
You can do it like keilmillerjr says

something like this

class UserConfig {
      
   </ label="Delay Time (0-999)", help="The amount of time (in milliseconds?) that it takes to wait for start the music", order=1 />
   dtime="100";
   
}
local music_active = false;
local delay = 0;
local max_delay = 0;
menumusic.playing = music_active;

max_delay=abs(("0"+my_config["dtime"]).tointeger())
max_delay=(max_delay>999 ? 100 : max_delay);

::fe.add_ticks_callback( this, "tick_fn" );

function tick_fn( ttime )
   {
      delay++;
      if ( delay > max_delay )
      {      
         if (music_active == false){
            music_active = true;
            menumusic.playing = music_active;                     
         }

      }
   }

The idea is you can configure how long you theme need to wait to start playing the music

bjose2345, can you help me understand how to use this code snippet? I want to add a delay for video play back. Right now I use FadeArt and Transition.EndNavigation for a smooth experience but the navigation on a weak device like an raspberry Pi I think would benefit if there was a delay before the snap starts playing.

local snap = FadeArt ( "snap", flx*0.183, fly*0.0376, flw*0.635, flh*0.56 );
snap.trigger = Transition.EndNavigation;
snap.preserve_aspect_ratio = true;

10
Scripting / Re: Preserve aspect ration in wheel using conveyor
« on: August 21, 2017, 06:06:45 AM »
Have you figured out how to preserve the aspect ratio of the pointer as well?

Sorry, I always remove the pointer so cant really say :)

11
Themes / Re: SILKY Theme v0.6.9 beta
« on: August 21, 2017, 06:03:56 AM »
s
I'm using Motion Blue, so all my snaps,marquee etc. for MAME and FBA are in the ARCADE folder.
 all the video are working, but the column on the right it's not showing anything ,i get just black.
what kind of file goes in the right column? .png? or it takes previews png from the video snaps that i have? :-\
thank you!

EDIT
so i found out that if i put an image, in the same folder of the videos (snaps), it shows up! it is supposed to be like this?

Ommek covered this on the previous page. You can add two directories for snaps semi colon separated. One for videos and one for pictures. That way you dont have to mix them.

12
Hi,

Is the theme used in the pictures downloadable from somewhere? Otherwise I'd appreciate if someone could zip it up. Looks great :)

13
Scripting / Re: Preserve aspect ration in wheel using conveyor
« on: August 16, 2017, 11:58:14 AM »
Never mind i figured it out:

conveyor.preserve_aspect_ratio = true;

Example:

// we do it this way so that the last wheelentry created is the Center one showing the current
// selection (putting it at the top of the draw order)
for ( local i=0; i<remaining; i++ )
wheel_entries.insert( num_arts/2, WheelEntry() );

conveyor <- Conveyor();
conveyor.set_slots( wheel_entries );
conveyor.transition_ms = 50;
try { conveyor.transition_ms = my_config["transition_ms"].tointeger(); } catch ( e ) { }
}
conveyor.preserve_aspect_ratio = true;

14
Scripting / Preserve aspect ration in wheel using conveyor
« on: August 15, 2017, 12:09:50 PM »
Hi,

How can I mod this layout to preserver the aspect ratio of the wheel images? Its' very hard to get correct aspect using flw*x, flh*x

if ( my_config["enable_list_type"] == "Horizontal Low" )
{
fe.load_module( "conveyor" );
local wheel_x = [ -flx*0.45, -flx*0.3, -flx*0.2, -flx*0.04, flx*0.12 flx*0.28, flx*0.44, flx*0.6, flx*0.76 flx*0.92, flx*1.08, flx*1.24 ];
local wheel_y = [ fly*0.76, fly*0.76, fly*0.76, fly*0.76, fly*0.76, fly*0.76, fly*0.73, fly*0.76, fly*0.76, fly*0.76, fly*0.76, fly*0.76, ];
local wheel_w = [ flw*0.12, flw*0.12, flw*0.12, flw*0.12, flw*0.12, flw*0.12, flw*0.12, flw*0.12, flw*0.12, flw*0.12, flw*0.12, flw*0.12, ];
local wheel_a = [  255,  255,  255,  255,  255,  255, 255,  255,  255,  255,  255,  255, ];
local wheel_h = [  flh*0.2,  flh*0.2,  flh*0.2,  flh*0.2,  flh*0.2,  flh*0.2, flh*0.2,  flh*0.2,  flh*0.2,  flh*0.2,  flh*0.2,  flh*0.2, ];
local wheel_r = [  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ];
local num_arts = 12;

class WheelEntry extends ConveyorSlot
{
   constructor()
   {
      base.constructor( ::fe.add_artwork( my_config["orbit_art"] ) );
   }

   function on_progress( progress, var )
   {
     local p = progress / 0.1;
      local slot = p.tointeger();
      p -= slot;
      
      slot++;

      if ( slot < 0 ) slot=0;
      if ( slot >=10 ) slot=10;

      m_obj.x = wheel_x[slot] + p * ( wheel_x[slot+1] - wheel_x[slot] );
      m_obj.y = wheel_y[slot] + p * ( wheel_y[slot+1] - wheel_y[slot] );
      m_obj.width = wheel_w[slot] + p * ( wheel_w[slot+1] - wheel_w[slot] );
      m_obj.height = wheel_h[slot] + p * ( wheel_h[slot+1] - wheel_h[slot] );
      m_obj.rotation = wheel_r[slot] + p * ( wheel_r[slot+1] - wheel_r[slot] );
      m_obj.alpha = wheel_a[slot] + p * ( wheel_a[slot+1] - wheel_a[slot] );
   }
};

local wheel_entries = [];
for ( local i=0; i<num_arts/2; i++ )
   wheel_entries.push( WheelEntry() );

local remaining = num_arts - wheel_entries.len();

// we do it this way so that the last wheelentry created is the Center one showing the current
// selection (putting it at the top of the draw order)
for ( local i=0; i<remaining; i++ )
   wheel_entries.insert( num_arts/2, WheelEntry() );

conveyor <- Conveyor();
conveyor.set_slots( wheel_entries );
conveyor.transition_ms = 50;
try { conveyor.transition_ms = my_config["transition_ms"].tointeger(); } catch ( e ) { }
}

15
Scripting / Re: Last played games
« on: August 15, 2017, 11:43:39 AM »
Yes, please share :)

Pages: [1] 2 3 4