Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Attract-Mode Frontend version 1.6 released  (Read 83542 times)

0 Members and 1 Guest are viewing this topic.

bleargh

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 359
  • Last login:Yesterday at 12:10:17 pm
  • ribbit...
Re: Attract-Mode Frontend version 1.2 released
« Reply #80 on: April 10, 2014, 11:52:57 am »
I've been trying here using "fe.add_artwork()", but can't get it to play any of the videos I've got here (which I know play fine w/ffmpeg as I use that to convert them to other things).

https://github.com/mickelson/attract/blob/master/Layouts.md

fe.add_artwork()

fe.add_artwork( label )
fe.add_artwork( label, x, y )   
fe.add_artwork( label, x, y, w, h )

You need to add a label for what kind of artwork you want to add. It's probably "snap". Check your config files.

That's what I'd been doing... using it as fe.add_artwork(label,x,y,w,h).

I created a "movies" artwork setup in my Emulator Config, and have been trying to pull ".mpg" files from there to show as background videos.

I was wondering, though, if its limited to just a select number of extensions; when I look in "fe_settings.cpp" I see that there's a hard-coded list of file extensions that get used for pulling artwork (png, jpg, jpeg, gif, bmp, and tga).  Could that be limiting me to just those extensions, and would prevent me from having it pull up a ".../movies/romname.mpg" video?

nitrogen_widget

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1782
  • Last login:May 23, 2025, 02:30:58 pm
  • I want to build my own arcade controls!
Re: Attract-Mode Frontend version 1.2 released
« Reply #81 on: April 10, 2014, 01:56:52 pm »
Silly newb question.
After I get Attract-mode compiled & running or any app I compile for my tiny distro, I can remove the dev packages of the dependencies correct?
I'm fairly certain the answer is yes but I just wanted to make sure.

My plan is to roll my own image, install on target PC then remove the extra stuff then re-roll as a live image I can install on CF to ide adaptor & I want to save as much space as possible.

cools

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 645
  • Last login:May 17, 2025, 02:24:48 pm
  • Arcade Otaku Sysadmin
    • Arcade Otaku
Re: Attract-Mode Frontend version 1.2 released
« Reply #82 on: April 10, 2014, 02:02:18 pm »
Bleargh: try .mp4 as an extension. That definitely works.

Nitrogen_widget: yup.

The smooth video is great. Works well in the collage screensaver too, which makes me wonder how long before someone comes up with an advancement style tiled layout (use the wheel images and video snaps, and have a configurable number of columns/rows!)

raygun

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 47
  • Last login:January 07, 2016, 12:24:03 am
  • I want to build my own arcade controls!
Re: Attract-Mode Frontend version 1.2 released
« Reply #83 on: April 10, 2014, 10:35:01 pm »
I've been trying here using "fe.add_artwork()", but can't get it to play any of the videos I've got here (which I know play fine w/ffmpeg as I use that to convert them to other things).

https://github.com/mickelson/attract/blob/master/Layouts.md

fe.add_artwork()

fe.add_artwork( label )
fe.add_artwork( label, x, y )   
fe.add_artwork( label, x, y, w, h )

You need to add a label for what kind of artwork you want to add. It's probably "snap". Check your config files.

That's what I'd been doing... using it as fe.add_artwork(label,x,y,w,h).

I created a "movies" artwork setup in my Emulator Config, and have been trying to pull ".mpg" files from there to show as background videos.

I was wondering, though, if its limited to just a select number of extensions; when I look in "fe_settings.cpp" I see that there's a hard-coded list of file extensions that get used for pulling artwork (png, jpg, jpeg, gif, bmp, and tga).  Could that be limiting me to just those extensions, and would prevent me from having it pull up a ".../movies/romname.mpg" video?

Hi Bleargh, video extensions aren't hardcoded by attractmode, its set up to handle any extension recognized by FFmpeg.  Image extensions are hardcoded as you found since they aren't sent through ffmpeg.

I suspect you are running up against a rather arbitrary limit that I intend to get rid of in the next version. Right now you can only have one movie artwork configured per emulator.  The path to your videos has to go in the "Movie Path" entry in the emulator configuration.  You also have to fill in the "Movie Artwork" entry with the name of the artwork you want to play the videos in.  So if you put in "snap" for example, the frontend will play your videos where the snap artwork is meant to go.

in the future i want it to work as expected, if there are videos in a specified artwork path then play the video, if not then look for images


bleargh

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 359
  • Last login:Yesterday at 12:10:17 pm
  • ribbit...
Re: Attract-Mode Frontend version 1.2 released
« Reply #84 on: April 11, 2014, 02:16:15 am »
Ah-ha!  That's gotta be the piece I've been missing here.  I'll give it a run through over the weekend and see if I can get it working.  I hadn't set it up as the Movie Path, so thats gotta be what I'm missing.

cools

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 645
  • Last login:May 17, 2025, 02:24:48 pm
  • Arcade Otaku Sysadmin
    • Arcade Otaku
Re: Attract-Mode Frontend version 1.2 released
« Reply #85 on: April 11, 2014, 05:40:39 am »

in the future i want it to work as expected, if there are videos in a specified artwork path then play the video, if not then look for images

 :afro:

dcninja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 176
  • Last login:March 01, 2025, 09:59:52 am
Re: Attract-Mode Frontend version 1.2 released
« Reply #86 on: April 13, 2014, 10:17:18 am »
how do i change the layout on attract mode?

I want to give this another go.

I read about a toggle layout command but I flat out do not see this anywhere. thanks!

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: Attract-Mode Frontend version 1.2 released
« Reply #87 on: April 13, 2014, 10:29:53 am »
how do i change the layout on attract mode?

I want to give this another go.

I read about a toggle layout command but I flat out do not see this anywhere. thanks!

  • Press tab to enter Configure menu
  • Navigate to Lists
  • Navigate to "list name"
  • Navigate to Layout

dcninja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 176
  • Last login:March 01, 2025, 09:59:52 am
Re: Attract-Mode Frontend version 1.2 released
« Reply #88 on: April 13, 2014, 10:55:40 am »
thanks!
emu randomly works now.
i did remove the select key tho... LOL i'm just going to reinstall it. thanks!

dcninja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 176
  • Last login:March 01, 2025, 09:59:52 am
Re: Attract-Mode Frontend version 1.2 released
« Reply #89 on: April 13, 2014, 11:06:29 am »
omg - next issue - i feel soooo inept. lol

I was trying to rebind the select key to my arcade buttons and somehow bound it to NOTHING.
I copied attract mode back on again and the controls did not reset to default.

How can i edit the controls in notepad or something? where is the file located? thanks!

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: Attract-Mode Frontend version 1.2 released
« Reply #90 on: April 13, 2014, 11:08:13 am »
omg - next issue - i feel soooo inept. lol

I was trying to rebind the select key to my arcade buttons and somehow bound it to NOTHING.
I copied attract mode back on again and the controls did not reset to default.

How can i edit the controls in notepad or something? where is the file located? thanks!

Open attract.cfg in your favorite text editor and change the settings under input_map.

dcninja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 176
  • Last login:March 01, 2025, 09:59:52 am
Re: Attract-Mode Frontend version 1.2 released
« Reply #91 on: April 13, 2014, 11:08:40 am »
you're a lifesaver! thanks!

dcninja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 176
  • Last login:March 01, 2025, 09:59:52 am
Re: Attract-Mode Frontend version 1.2 released
« Reply #92 on: April 13, 2014, 11:45:41 am »
2 more stupid questions...

1. I HAD videos playing fine. Now they don't and I'm not sure what I changed. I notice that their are two video paths. One for videos and one for video artwork or something? how do I configure the vids? I know they play because I just had them working before I mucked around in the config some more. My snaps and marquees pick up fine. I think the path is correct to my videos, but there's two video options in the config... not sure what goes where with that? Am I making sense? It's downstairs and I don't have it in front of me right now.

2. I got the favorites working but is there a secondary favs list that you can go to, or is it just press a button and have it cycle through your favs while keeping it on the main list?

I really appreciate everyone's help with this front end, It's an amazing front end and I've just been having issue after issue and they probably are so stupid and small to you guys. lol

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: Attract-Mode Frontend version 1.2 released
« Reply #93 on: April 13, 2014, 11:54:28 am »
1. I HAD videos playing fine. Now they don't and I'm not sure what I changed. I notice that their are two video paths. One for videos and one for video artwork or something? how do I configure the vids? I know they play because I just had them working before I mucked around in the config some more. My snaps and marquees pick up fine. I think the path is correct to my videos, but there's two video options in the config... not sure what goes where with that? Am I making sense? It's downstairs and I don't have it in front of me right now.

The menu has explanations of what each this does. However, maybe me rephrasing will clarify it for you.

Movie Path: Path to your videos.
Movie Artwork: Description used in a theme to represent the videos. If it is the same description as something else, the videos will hold precedence. Default option is "snap". This means that videos will show up in the "snap" area of the theme, and if no video is present, it will fall back to the snap picture.

2. I got the favorites working but is there a secondary favs list that you can go to, or is it just press a button and have it cycle through your favs while keeping it on the main list?

I'm not sure I understand. You can configure a button to add or remove a rom from the favorites list. The list is just like a filter. You should have two default filters, "all" and "favourites". Not sure why you would want two favorites lists.

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: Attract-Mode Frontend version 1.2 released
« Reply #94 on: April 13, 2014, 11:55:40 am »
Here's a second update on how I'm making out with creating my theme. It's getting closer to completion for 1920x1080 resolution!


dcninja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 176
  • Last login:March 01, 2025, 09:59:52 am
Re: Attract-Mode Frontend version 1.2 released
« Reply #95 on: April 13, 2014, 12:33:11 pm »
so once you add a favorite, there is a different favs list from the main list?


keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: Attract-Mode Frontend version 1.2 released
« Reply #96 on: April 13, 2014, 12:43:38 pm »
so once you add a favorite, there is a different favs list from the main list?

Yes. These lists are called filters in AttractMode, since they are not actually separate lists. Be sure you have keys set in the config for previous and next filters.

dcninja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 176
  • Last login:March 01, 2025, 09:59:52 am
Re: Attract-Mode Frontend version 1.2 released
« Reply #97 on: April 13, 2014, 12:50:23 pm »
so if my movies are located in C:\mame\video\

what should I have listed in the two video path options?

I had it working and it won't now. They are in AVI format.

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: Attract-Mode Frontend version 1.2 released
« Reply #98 on: April 13, 2014, 08:23:09 pm »
so if my movies are located in C:\mame\video\

what should I have listed in the two video path options?

I had it working and it won't now. They are in AVI format.

Movie Path: C:\mame\video\
Movie Artwork: snap

Side note:

I really wish the squirrel language used hashes like ruby. My theme is getting ridiculous with declaring local variables, and then later setting them. It would be nice to have them grouped into single variables such as options = { 'theme' => 'red' }. Maybe I'm just used to ruby. But my file is growing in size and complexity. I also found that I can not compare results such as if ( options == ( 'red' || 'green' ) ), but if ( ( options == 'red') || (options == 'green' ) ) works.

raygun

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 47
  • Last login:January 07, 2016, 12:24:03 am
  • I want to build my own arcade controls!
Re: Attract-Mode Frontend version 1.2 released
« Reply #99 on: April 14, 2014, 12:53:02 am »
Here's a second update on how I'm making out with creating my theme. It's getting closer to completion for 1920x1080 resolution!

Very nice!  Can't wait to see the finished product.

Side note:

I really wish the squirrel language used hashes like ruby. My theme is getting ridiculous with declaring local variables, and then later setting them. It would be nice to have them grouped into single variables such as options = { 'theme' => 'red' }. Maybe I'm just used to ruby. But my file is growing in size and complexity. I also found that I can not compare results such as if ( options == ( 'red' || 'green' ) ), but if ( ( options == 'red') || (options == 'green' ) ) works.

It does do hashes (associative arrays), they're called tables in squirrel.  see: http://www.squirrel-lang.org/doc/squirrel3.html#d0e1216

cools

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 645
  • Last login:May 17, 2025, 02:24:48 pm
  • Arcade Otaku Sysadmin
    • Arcade Otaku
Re: Attract-Mode Frontend version 1.2 released
« Reply #100 on: April 14, 2014, 10:19:01 am »
Here's a second update on how I'm making out with creating my theme. It's getting closer to completion for 1920x1080 resolution!

Mind sharing the script so I can see if there's any tricks I can borrow?

Also I really like those button/stick images - any chance I can get a copy of them - I've been meaning to do an instructions panel for mine as well.

dcninja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 176
  • Last login:March 01, 2025, 09:59:52 am
Re: Attract-Mode Frontend version 1.2 released
« Reply #101 on: April 26, 2014, 06:59:49 pm »
just want to chime in that this front end is perfect now. best thing since mamewah... i've made other cabs using that way way back in early 2000's and this one takes the cake. simple, looks clean, has everything I need.
I'm going to be backing up my system soon to a second hard drive in case but I have a favs list and I was wondering where that file is so I don't have to manually add all 600 games back. Is it stored where the other lists of emu's are or is it in something goofy like the documents folder in windows? thanks!

raygun

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 47
  • Last login:January 07, 2016, 12:24:03 am
  • I want to build my own arcade controls!
Re: Attract-Mode Frontend version 1.2 released
« Reply #102 on: April 27, 2014, 11:59:41 am »
just want to chime in that this front end is perfect now. best thing since mamewah... i've made other cabs using that way way back in early 2000's and this one takes the cake. simple, looks clean, has everything I need.
I'm going to be backing up my system soon to a second hard drive in case but I have a favs list and I was wondering where that file is so I don't have to manually add all 600 games back. Is it stored where the other lists of emu's are or is it in something goofy like the documents folder in windows? thanks!

Hey that's great that its working for you now.  All the configuration files are kept in the same place (nothing in the documents folder or the registry or anything).  The favs lists are stored in the "romlists" subdirectory, they are the files with the ".tag" extension...

liquid8

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 156
  • Last login:June 11, 2017, 04:02:02 am
  • I working on it.. it'll be a while.
Re: Attract-Mode Frontend version 1.2 released
« Reply #103 on: April 27, 2014, 12:52:28 pm »
Just been playing around with this, and I completely agree this has great potential.

I've always stuck with Mamewah for configuration and flexibility but there's a number of things I wish it had:

A more flexible theming engine (check)
Plugins (check)
Configuration menu builtin (check)
Image and video transparency/masking (check)
Lists using Filters and Rules (check)
Speedy on low end system (check)

Some other frontends have these, but I've never gotten to a point where I could switch. I think this frontend could cater to anyone running Mamewah, Mala or AtomicFE.

What sold me was the list filtering and rules specifically - instead of generating different lists with outside utilities or clunky text editing, you simply add filters with rules to the master list and can easily switch between them. The fact that it has a scripting engine for plugins and themes means I can customize and enhance it down the road.

What will keep people from switching now is the lack of layouts and plugins, maybe a few unique configurations - but once some people get ahold of the layout scripting and plugins the sky is the limit.

I will have a bunch of feedback soon. Briefly looking at the scripting engine, is there a list of the transition states that are available to it? (ToNewSelection, StartLayout, EndLayout, ToGame, FromGame, etc..) - NM - figured that out, but is it possible to load/write files with Squirrel? I see the Math and String libraries are available, what about input/output?

 :cheers:
« Last Edit: April 28, 2014, 06:46:40 pm by liquid8 »

raygun

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 47
  • Last login:January 07, 2016, 12:24:03 am
  • I want to build my own arcade controls!
Re: Attract-Mode Frontend version 1.2 released
« Reply #104 on: April 29, 2014, 11:57:41 pm »
I will have a bunch of feedback soon. Briefly looking at the scripting engine, is there a list of the transition states that are available to it? (ToNewSelection, StartLayout, EndLayout, ToGame, FromGame, etc..) - NM - figured that out, but is it possible to load/write files with Squirrel? I see the Math and String libraries are available, what about input/output?

 :cheers:

Hi liquid8,

The standard input/output library provided by Squirrel is not loaded currently.  I found it too low level and unfriendly to include at this point.  so no direct file io currently, other than loading other scripts.

Instead the focus has been on supporting communication between the scripts and the plugin commands, so you can do all your file io in a separate program and feed the info back and forth to the script since  layout and plugin  scripts can read the stdout output from the programs they execute...

dcninja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 176
  • Last login:March 01, 2025, 09:59:52 am
Re: Attract-Mode Frontend version 1.2 released
« Reply #105 on: May 01, 2014, 11:58:15 pm »
ty raygun for the amazing front end. I currently use that simple black and white list. it's clean, clear, and easy to understand for everyone. I've got a favs list of 600 games marked off for quick play, and the full list if i want to discover something new. and of course a random game button. going to make a little index card cheat sheet for randoms that come to play it. haha works fantastic.

liquid8

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 156
  • Last login:June 11, 2017, 04:02:02 am
  • I working on it.. it'll be a while.
Re: Attract-Mode Frontend version 1.2 released
« Reply #106 on: May 03, 2014, 02:32:44 pm »
The standard input/output library provided by Squirrel is not loaded currently.  I found it too low level and unfriendly to include at this point.  so no direct file io currently, other than loading other scripts.

Instead the focus has been on supporting communication between the scripts and the plugin commands, so you can do all your file io in a separate program and feed the info back and forth to the script since  layout and plugin  scripts can read the stdout output from the programs they execute...

Understandable, but it would be nice to be able to handle xml or standard files for plugins without having to write a separate utility.

Another question:

What is your expectation when using add_image from a plugin (not a layout)?

I was writing a plugin that would display an image on keypress, but the add_image function only loads images from the current layout folder. This might be nice if you want different images for different layouts, but I might expect my plugin to store the images independent of the layout folder - perhaps a custom directory or a directory for the plugin itself. One solution might be to give a plugin its own folder just like a layout, if you don't want plugins to be able to load files from just anywhere.

FYI, I reported a bug and a request on github, I'm not sure if they were removed for some reason as they aren't showing up now?

Bug:
When switching out (alt-tab) in windows, when you try to switch back it doesn't redraw the screen until you press a button. This happens to me on both Windows XP and Windows 8.

Feature Request:
Windowed mode (as opposed to fullscreen), and ideally a choice between windowed, fullscreen windowed, and exclusive fullscreen.

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: Attract-Mode Frontend version 1.2 released
« Reply #107 on: May 06, 2014, 01:00:45 pm »
I took a break from creating my layout for a while. I finally have some time coming up to continue working on it.

Is it possible to use fe.add_image() and fe.do_nut() with subdirectories? It would be very helpful as my layout allows for many options and resolutions.

raygun

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 47
  • Last login:January 07, 2016, 12:24:03 am
  • I want to build my own arcade controls!
Re: Attract-Mode Frontend version 1.2 released
« Reply #108 on: May 08, 2014, 12:56:19 am »

Understandable, but it would be nice to be able to handle xml or standard files for plugins without having to write a separate utility.

Another question:

What is your expectation when using add_image from a plugin (not a layout)?

I was writing a plugin that would display an image on keypress, but the add_image function only loads images from the current layout folder. This might be nice if you want different images for different layouts, but I might expect my plugin to store the images independent of the layout folder - perhaps a custom directory or a directory for the plugin itself. One solution might be to give a plugin its own folder just like a layout, if you don't want plugins to be able to load files from just anywhere.


Ha it's so cool to see the different ideas for scripting this.  To be honest I hadn't really thought about loading images from a plugin but it makes complete sense.   As you note the current version assumes all image paths are relative to the current layout folder.  That will change in the next version with absolute paths being supported as well.  I think adding support for each plugin having its own folder just like a layout would be a good idea, with the add_image command loading from there if a relative path is given when it is called from a plugin.  I'll look into that and will think about how to best support reading files...


FYI, I reported a bug and a request on github, I'm not sure if they were removed for some reason as they aren't showing up now?

Bug:
When switching out (alt-tab) in windows, when you try to switch back it doesn't redraw the screen until you press a button. This happens to me on both Windows XP and Windows 8.

Feature Request:
Windowed mode (as opposed to fullscreen), and ideally a choice between windowed, fullscreen windowed, and exclusive fullscreen.

Got them, they're showing up for me ok over at github.  I've been playing around with windowed mode a bit already, it should be ready to check in soon.


Is it possible to use fe.add_image() and fe.do_nut() with subdirectories? It would be very helpful as my layout allows for many options and resolutions.

I think so, you should be able to make a subdirectory in your layout and then do something like fe.do_nut( "subdirectory/file.nut" ) or fe.add_image("subdirectory/hello.jpg")...

liquid8

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 156
  • Last login:June 11, 2017, 04:02:02 am
  • I working on it.. it'll be a while.
Re: Attract-Mode Frontend version 1.2 released
« Reply #109 on: May 09, 2014, 03:03:53 pm »
I realized I had filtering on at github which is why I didn't see my issue reports.. thanks for fixing them! I need to get it setup to compile from github so I can check that out.

I've been putting a bunch of time into playing with this. Cools code helped me a ton, so thank you  :cheers: Squirrel has some nice little benefits.

As I checked out Cools code, I noticed a library of sorts would be extremely helpful. So I started working on one (a .nut file) which will not only make things a bit simpler in dealing with layout objects, but also adds animation handling! :P

It looks something like this for a layout:

Code: [Select]
fe.do_nut("simplelayout.nut");
local layout = SimpleLayout();
local snap = layout.addArtwork("artSnap", "snap", 100, fe.layout.height / 2, 262, 200);
    snap.enableShadow(true);
    snap.addAnimation("translate", { when = Transition.FromOldSelection, path = [ [ fe.layout.width / 2, -200], [fe.layout.width / 2 , 300 ]], easing = "out", tween = "quad", reverse = true} );
    snap.addAnimation("property", { when = Transition.FromOldSelection, property = "alpha", reverse = true } );
    snap.addAnimation("translate", { when = Transition.ToNewSelection, path = [ [ fe.layout.width / 2, -200], [fe.layout.width / 2 , 300 ]], easing = "out", tween = "quad"} );
    snap.addAnimation("property", { when = Transition.ToNewSelection, property = "alpha" } );

I have added property animator (like alpha, x, y, width, height, rotation, etc..) and a translate animator which is basically just an x, y at the same time but contains some other abilities. You can see when you do addAnimation, you can provide a config of sorts with various options. I'll probably make this a lot easier with some predefined configurations that non-coders would find easier.

In the library, I actually wrapped the objects in a new class because not only does it extend functionality of the original objects but each object can include multiple objects. Right now, I just have an extra object that duplicates the original for a shadow but this could be expanded later to have full fledged objects like a marquee wheel or something similar.

This could be something that you may want to include via code or just a .nut file that is available as an extra library. Once I have more I can let you or someone else play with it.

Another question: when I do this, I want my included .nut file to attach to the transition and tick functions.. but as it stands, it doesn't seem like I can point those functions to a function in the included .nut file. For now,  I just have a transition and tick function in my main layout.nut and it redirects them to the functions in the class of the included file.
« Last Edit: May 09, 2014, 03:21:23 pm by liquid8 »

cools

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 645
  • Last login:May 17, 2025, 02:24:48 pm
  • Arcade Otaku Sysadmin
    • Arcade Otaku
Re: Attract-Mode Frontend version 1.2 released
« Reply #110 on: May 10, 2014, 10:18:54 am »
Looks excellent, the one thing I was dreading doing with mine was animation. Making the routines external to the layout makes a whole load of sense. It's one of the reasons I stayed away from using any sort of alpha blending, it was beyond my motivation to maintain those during fades.

liquid8

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 156
  • Last login:June 11, 2017, 04:02:02 am
  • I working on it.. it'll be a while.
Re: Attract-Mode Frontend version 1.2 released
« Reply #111 on: May 10, 2014, 09:55:50 pm »
Thanks! I can't tell you how much fun I had with math until I found Penner's Easing functions :)

I did a TON of work to simplify things. There is now three include files: extended.nut, animate.nut, debug.nut

ExtendedObjects (extended.nut) is used instead of the standard fe.add_XXXXX.
Animate (animate.nut) requires the ExtendedObjects library, but if included you can add the animations as shown below
Debug (debug.nut)  is really cool. It also requires the ExtendedObjects library, but if included adds a debugger that puts text objects ontop of all your objects and gives some feedback while you are modifying the layout

Code: [Select]
//load required files
fe.do_nut("extended.nut");
fe.do_nut("animate.nut");
fe.do_nut("debug.nut");

//add objects
ExtendedObjects.add_image("bg", "bg.jpg", 0, 0, fe.layout.width, fe.layout.height);
ExtendedObjects.add_image("logo", "logo.png", 50, 50, 262, 72);
ExtendedObjects.add_artwork("snap", "snap", 150, 150, 360, 320);
ExtendedObjects.add_text("title", "[Title]", 0, 0, fe.layout.width, 100);

//add animations
ExtendedObjects.getObject("snap").addAnimation("translate");
ExtendedObjects.getObject("logo").addAnimation("translate", { duration = 1500, when = Transition.FromOldSelection, easing = "out", tween = "back", from = "offscreenbottom", to = "bottom" });
//add debugger
Debug.start();
Debug.disableDuringAnimations(false);
Debug.getObject("snap").setText("hi snap!");

I still want to simplify the animation configs, but it's really pretty cool :) I'll try to get a video together soon. I still have some kinks to work out, but it is coming along!

Any interest in help testing?

Here is a really good resource if any wants some learning for squirrel:
http://electricimp.com/docs/resources/squirrelcrib/


liquid8

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 156
  • Last login:June 11, 2017, 04:02:02 am
  • I working on it.. it'll be a while.
Re: Attract-Mode Frontend version 1.2 released
« Reply #112 on: May 11, 2014, 02:46:43 pm »
Here is a quick preview:



Note the animations are actually smooth, need to figure out why my capture is dropping frames.

Here's one with the debug library turned on:

« Last Edit: May 11, 2014, 04:44:43 pm by liquid8 »

raygun

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 47
  • Last login:January 07, 2016, 12:24:03 am
  • I want to build my own arcade controls!
Re: Attract-Mode Frontend version 1.2 released
« Reply #113 on: May 12, 2014, 01:43:57 am »
I still want to simplify the animation configs, but it's really pretty cool :) I'll try to get a video together soon. I still have some kinks to work out, but it is coming along!

Any interest in help testing?

Just watched the videos liquid8, looks great!  I'd be happy to help out with testing...

Another question: when I do this, I want my included .nut file to attach to the transition and tick functions.. but as it stands, it doesn't seem like I can point those functions to a function in the included .nut file. For now,  I just have a transition and tick function in my main layout.nut and it redirects them to the functions in the class of the included file.

I just tried it out and I was able to add a tick function from an included .nut file, so it can be done... one thing to watch out for is that the name of the tick function you add isn't the same as any other in your layout or the plugins you have enabled...

liquid8

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 156
  • Last login:June 11, 2017, 04:02:02 am
  • I working on it.. it'll be a while.
Re: Attract-Mode Frontend version 1.2 released
« Reply #114 on: May 14, 2014, 06:54:28 pm »
I actually figured it out, although I have no idea what it was at the time (maybe I was trying to point it to a function in a class or something)

So I added my initial version of this.. yep, broke out my github and got all official :) I was actually doing a bit of rewrite the last few days and it's much more customizable now.

You will be able to create additional objects or animations via an extended class in a .nut file. You hook into some of the ExtendedObjects abilities to do this, which makes handling animations or custom objects much easier. I've already played around with converting the orbit marquee wheel and starfield layouts into objects  :laugh2:

The instructions and src are at:

https://github.com/liquid8d/attract-extra/tree/master/layouts/extended

Keep in mind I'm still in development stages, but it should be fun to play with. Functions or conventions will probably change a bit earlier on until it's more user friendly.

Here's the example layout that is included in github:





cools

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 645
  • Last login:May 17, 2025, 02:24:48 pm
  • Arcade Otaku Sysadmin
    • Arcade Otaku
Re: Attract-Mode Frontend version 1.2 released
« Reply #115 on: May 15, 2014, 12:54:22 pm »
Pretty cool! Now I've got a vertical cab set up I'm not messing with configuration much, rather playing some games for a change. Have been quietly converting my layout to work in horizontal as well as vertical, all positioning in percentages instead of absolutes.

All the new bits will be a lot of fun to mess with in future.

liquid8

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 156
  • Last login:June 11, 2017, 04:02:02 am
  • I working on it.. it'll be a while.
Re: Attract-Mode Frontend version 1.2 released
« Reply #116 on: May 15, 2014, 03:56:41 pm »

With ExtendedObjects you can have positions to set objects to left, right, top, bottom, center, topleft, bottomright, etc and animations can run from positions like offleft to offright (offscreen left to right) or object start position to bottomright, etc..

Percentages would be a nice addition and/or maybe even some mid-points. If those existed, it might only be one-offs that need specific screen positioning.

One thing I'll have to keep in mind is how to handle positioning and animation duration for horizontal or vertical. I don't have a vertical setup so it's good to hear that :) Since the animations are currently done by distance over time - an animation from screen left to screen right would go faster? on a horizontal setup than a vertical.

Right now, this version is stuck with transition only animations that don't allow input until animation(s) complete so I'm focusing on fixing that by creating different animation types like forcedtransition, continuous, looping, repeating, etc.. that can run at anytime and not block input :)

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: Attract-Mode Frontend version 1.2 released
« Reply #117 on: May 15, 2014, 07:04:56 pm »
I have begun to work on my theme again. Revising it to be easier to work with.

I created a test layout. I was able to successfully use subdirectories. :cheers:

Using fe.do_nut(), I am able to execute another script. That script is able to modify the layout. However, variables are not carried over. Is there a way to import a nut file? Possibly have fe.do_nut() and fe.import_nut()? This will greatly allow me to organize my code. I'm very much used to DRY methods.

liquid8

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 156
  • Last login:June 11, 2017, 04:02:02 am
  • I working on it.. it'll be a while.
Re: Attract-Mode Frontend version 1.2 released
« Reply #118 on: May 15, 2014, 08:03:39 pm »
I have begun to work on my theme again. Revising it to be easier to work with.

I created a test layout. I was able to successfully use subdirectories. :cheers:

Using fe.do_nut(), I am able to execute another script. That script is able to modify the layout. However, variables are not carried over. Is there a way to import a nut file? Possibly have fe.do_nut() and fe.import_nut()? This will greatly allow me to organize my code. I'm very much used to DRY methods.

Squirrel can be a little confusing with that at first.. but check out this:
http://electricimp.com/docs/resources/squirrelcrib/#globaltable

Basically what that means is you create the variable with NO local declaration, and use the <- symbol. That adds a variable to the "root" table, and it can be accessed from your other .nut file:

Code: [Select]
my_global_variable <- true;

The better way if you are going to have a bunch of variables is to create your own table and put it in the root the same way:

Code: [Select]
my_global_config <-  {
   first_key = "Max Normal",
   second_key = 42,
   third_key = true
};

So layout.nut:
Code: [Select]
fe.do_nut("config.nut");
fe.add_text(my_global_config.first_key, 0, 0, 100, 20);

and config.nut:
Code: [Select]
my_global_config <-  {
   first_key = "Max Normal",
   second_key = 42,
   third_key = true
};


You could also use classes... I'd really recommend at least perusing this link: http://electricimp.com/docs/resources/squirrelcrib/ - I've worked in a lot of languages but a couple things Squirrel does through me for a loop.

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: Attract-Mode Frontend version 1.2 released
« Reply #119 on: May 15, 2014, 11:23:59 pm »
@liquid8 Thank you very much for that link. I fully understand now. Recreated about half of my theme so far using good practices. I can't wait to release a working layout on github. ;D