Recent Posts

Pages: [1] 2 3 ... 10
1
Scripting / Re: Possible to get a stroke/outline around text?
« Last post by wrybread on Today at 10:52:43 PM »
I don't think add_clone() and clone() are the same functions. From the Squirrel reference manual I'm reading (https://developer.electricimp.com/squirrel/squirrelcrib), clone() specifically says it can clone an object.

Code: [Select]
Duplicating Objects

Squirrel provides a keyword, clone, to duplicate entities — objects, tables or arrays — which are usually accessed by reference rather than value. Any such entities nested within the clone’d object will not by copied, but accessed by reference. However, they themselves may be clone’d separately — and, indeed, any objects, tables arrays nested within them — and added to the clone.

In the Attract Mode Programming Reference, though, it documents add_clone() as:

Code: [Select]
fe.add_clone( img )

Clone an image, artwork or surface object and add the clone to the back of Attract-Mode's draw list. The texture pixel data of the original and clone is shared as a result.

Parameters:

img - the image, artwork or surface object to clone. This needs to be an instance of the class fe.Image.
Return Value:

An instance of the class fe.Image which can be used to interact with the added clone.

Dunno. No biggie of course, but it would sure be a lot cleaner when adding strokes if we could simply clone one of the 4 text objects, instead of writing it out 4 times.
2
General / Choppy video
« Last post by johnny5126 on Today at 03:08:23 PM »
When the front end is run, certain games and not all the time videos are choppy almost looks as if its being played at 5 fps.  If I highlight other games some will play normally, and if I go back to the previous choppy videos, they run fine.  Anyone know if this is a known issue or bug?  This is with AM 2.3, Windows 10.
3
keilmillerjr, hermine.potter, YellowBirdAZ, All,

I figured it out why on some installs/cab builds using the <directory\attract.exe> -c <directory> command does not always work. It is pretty simple. If there is a space in the directory name, the command fails. In one of my builds, the directory was 'c:\Attract Mode', with a space between 'Attract' and 'Mode'. In another build, it was just 'c:\AttractMode', with no space.

Flipped the builds back and forth removing the space in the directory name and then updating the shell command. Like clock work, it would fail with the space in the directory name, then work without the space in the directory name.

Give it a shot and see if you an replicate it.
4
General / How to Wake/Sleep via Task Scheduler in Windows 10 (Solved)
« Last post by chijb55 on Today at 02:05:14 PM »
Maybe this wasn't as hard for you as it was for me.  But after reading (countless) entries on Wake/Sleep via Task Scheduler in Windows 10, I've finally got it figured out.

My goal was to have my Arcade Cabinet - running Attract Mode - Sleep at night.  But be awake when I come downstairs in the morning to greet me <grin>.  I also combined this with a (cool and cheap) powerstrip from Home Depot with a timer, so as to turn the monitor and marquee power off at the same time.

Following is the magic Task Scheduler commands that make it work under Windows 10. 

Note:  You have to download PSTOOLS, but it's free.  Find it here:  https://docs.microsoft.com/en-us/sysinternals/downloads/pstools

NOTE:  Using Windows rundll32.exe isntead of pstools is nothing but trouble...

I scheduled 3 different events:  (1) Kill attract.exe process at 10pm (2) Sleep the PC at 1005pm (3) Wake the PC at 600am by starting a new copy of attract.exe.

Note that I leave 5 minutes between (1) Kill attract.exe and (2) Sleep the PC.  One minute was sometimes (rarely) not enough, and it caused issues.  This method works fine.

In Task Scheduler, create 3 "Basic Tasks" one at a time.  Setup On/Off times, then go to each inividual "Actions" tab and enter the following commands as indicated.  Note for the first two, nothing is entered in the optional "Start" section - this is only used for the 3rd (Wake) item.

------------------------

(1) Kill AttractMode
Setup On/Off Times, then go to the "Actions Tab"   
        Program:  taskkill.exe
   Arguments: /im attract.exe
   Start:

(2) Sleep PC
Setup On/Off Times, then go to the "Actions Tab"
   Program:  c:/pstools/psshutdown.exe
   Arguments: -d -t 0 -accepteula
   Start:

(3) WakeAttractMode
Setup On/Off Times, then go to the "Actions Tab"
   Program:   attract.exe
   Arguments:
   Start:      c:\attractmode

Every night at 10pm, AttractMode (nicely) shuts down.  5 minutes later, the PC quietly goes to sleep.  At 6am the next morning, AttractMode starts.  Make sure in WakeAttractMode that you put your OWN directory of where you have AttractMode installed (mine is c:\attractmode.)  This is the only one of the 3 that needs a "Start" option entered.

Good luck.

5
Themes / Re: HyperPie2 Theme [Preview]
« Last post by calle81 on Today at 12:35:59 PM »
Now also optimized for 5:4 screens  :) :

Main and sub menu navigation:
https://youtu.be/Dp5BXw1JBy8

Game selection:
https://youtu.be/d4smpu1YvE8
6
Scripting / Re: Possible to get a stroke/outline around text?
« Last post by zpaolo11x on Today at 01:27:26 AM »
@zpaolo11x: thank you! Masking 5 versions of the list, 4 of them offset by one pixel in each direction, works beautifully.

One small issue I'm having is that, according to the Squirrel docs, I should be able to just make one version of the stroke list and clone it 3 times:

Well from this knowledge base https://github.com/mickelson/attract/blob/master/Layouts.md#add_clone it seems that add_clone can be used only for images, artworks and surfaces.

I watched the video and the effect is super neat, I'llhave to implement it in my theme too :D
7
that is cool,,,,,love it
8
Well, with a bit of duct tape, my arcade cabinet now play videos:

https://www.youtube.com/watch?v=mstfDKev-XA

I made an "emulator" (a python script) that chooses a random video from the selected folder. So click the "South Park" entry on the arcade cabinet and it plays a random South Park. Works great, and my joystick controls volume (up/down), seek (left/right) and the buttons skip to next/prev. Can also play playlists of videos or specific videos. Now I'll have even more trouble concentrating when I should be working...

If anyone has interest I'll clean it up and post it.
9
Scripting / Re: Possible to get a stroke/outline around text?
« Last post by wrybread on Yesterday at 05:03:30 PM »
I just posted a video of the stroke effect:

https://www.youtube.com/watch?v=mstfDKev-XA

(Which also shows my cabinet's newfound ability to play videos, especially random episodes of South Park and Jackass. Whoohoo!)

10
Scripting / Re: Possible to get a stroke/outline around text?
« Last post by wrybread on Yesterday at 04:48:33 PM »
@zpaolo11x: thank you! Masking 5 versions of the list, 4 of them offset by one pixel in each direction, works beautifully.

One small issue I'm having is that, according to the Squirrel docs, I should be able to just make one version of the stroke list and clone it 3 times:

https://developer.electricimp.com/squirrel/squirrelcrib (search for "clone")

However, when I do that, I get a segmentation fault every time. For example, here's my version without clone, which works well but is a bit verbose and hard to modify:

Code: [Select]
// first version for the stroke
local lb1 = fe.add_listbox( 0, configs["rom_list_margin_top"].tointeger(), fe.layout.width, configs["rom_list_height"].tointeger() );
lb1.charsize = configs["list_char_size"].tointeger();
lb1.set_rgb(0,0,0) // don't put stroke on non selected items
lb1.set_sel_rgb(0,0,0); // stroke color
lb1.sel_style = Style.Bold;
lb1.selbg_alpha=0;
lb1.rows = configs["list_rows"].tointeger();

// second version for the stroke
local lb2 = fe.add_listbox( 0, configs["rom_list_margin_top"].tointeger(), fe.layout.width, configs["rom_list_height"].tointeger() );
lb2.charsize = configs["list_char_size"].tointeger();
lb2.set_rgb(0,0,0) // don't put stroke on non selected items
lb2.set_sel_rgb(0,0,0); // stroke color
lb2.sel_style = Style.Bold;
lb2.selbg_alpha=0;
lb2.rows = configs["list_rows"].tointeger();

// third version for the stroke
local lb3 = fe.add_listbox( 0, configs["rom_list_margin_top"].tointeger(), fe.layout.width, configs["rom_list_height"].tointeger() );
lb3.charsize = configs["list_char_size"].tointeger();
lb3.set_rgb(0,0,0) // don't put stroke on non selected items
lb3.set_sel_rgb(0,0,0); // stroke color
lb3.sel_style = Style.Bold;
lb3.selbg_alpha=0;
lb3.rows = configs["list_rows"].tointeger();

// forth version for the stroke
local lb4 = fe.add_listbox( 0, configs["rom_list_margin_top"].tointeger(), fe.layout.width, configs["rom_list_height"].tointeger() );
lb4.charsize = configs["list_char_size"].tointeger();
lb4.set_rgb(0,0,0) // don't put stroke on non selected items
lb4.set_sel_rgb(0,0,0); // stroke color
lb4.sel_style = Style.Bold;
lb4.selbg_alpha=0;
lb4.rows = configs["list_rows"].tointeger();


// the main list (no stroke)
local lb = fe.add_listbox( 0, configs["rom_list_margin_top"].tointeger(), fe.layout.width, configs["rom_list_height"].tointeger() );
lb.charsize = configs["list_char_size"].tointeger();
lb.set_sel_rgb( 200, 200, 64 );
lb.sel_style = Style.Bold;
lb.selbg_alpha=0; // this gets rid of the bar that highlights the selected game
lb.rows = configs["list_rows"].tointeger(); // the number of rows



// offset the position of the stroke'd entries
lb1.set_pos( lb.x, lb.y-1 )
lb2.set_pos( lb.x, lb.y+1 )
lb3.set_pos( lb.x-1, lb.y-1 )
lb4.set_pos( lb.x+1, lb.y+1 )

And here's the version with clone:

Code: [Select]
// this is a version of the list that will be cloned 3 times (4 total versions) that we can offset
// one pixel in each direction to build a stroke.
local lb1 = fe.add_listbox( 0, configs["rom_list_margin_top"].tointeger(), fe.layout.width, configs["rom_list_height"].tointeger() );
lb1.charsize = configs["list_char_size"].tointeger();
lb1.set_rgb(0,0,0)            // stroke of non selected items
lb1.set_sel_rgb(0,0,0);   // stroke color of selected
lb1.sel_style = Style.Bold;
lb1.selbg_alpha=0;
lb1.rows = configs["list_rows"].tointeger();

local lb2 = clone(lb1);
local lb3 = clone(lb1);
local lb4 = clone(lb1);


// the main list (no stroke)
local lb = fe.add_listbox( 0, configs["rom_list_margin_top"].tointeger(), fe.layout.width, configs["rom_list_height"].tointeger() );
lb.charsize = configs["list_char_size"].tointeger();
lb.set_sel_rgb( 200, 200, 64 );
lb.sel_style = Style.Bold;
lb.selbg_alpha=0; // this gets rid of the bar that highlights the selected game
lb.rows = configs["list_rows"].tointeger(); // the number of rows


// offset the position of the stroked versions
lb1.set_pos( lb.x, lb.y-1 )
lb2.set_pos( lb.x, lb.y+1 )
lb3.set_pos( lb.x-1, lb.y-1 )
lb4.set_pos( lb.x+1, lb.y+1 )

As soon as I try to set any properties of the cloned objects (lb1.set_pos, etc.) I get the segmentation fault.

I zipped up my Layout (wrycade) and made a version of the layout both with and without using clone if anyone is in a testing mood.
Pages: [1] 2 3 ... 10