SDArcade V2.1

Questions and tweaks for Attract-Mode on ARpiCADE.

Moderator: dee2eR

User avatar
FrizzleFried
Legendary Contributor
Legendary Contributor
Posts: 205
Joined: Sat Nov 25, 2017 5:35 pm
Location: Idaho
Contact:

Re: SDArcade V2.1

Post by FrizzleFried » Thu Dec 06, 2018 2:36 pm

FWIW ... you can create as many/few "displays" as you want and populate them with whatever games you wish.... and use whatever layout you want. What I did was create about a dozen totally different displays/layouts. You can then assign a button (or two) to move "forward/backward" through the different displays.

I have a display for CAPCOM games that I use my Diamond Plate layout for. I have a display for Konami games that uses my Konami layout... I use this layout for my "trackball/spinner" games on my horizontal cabinet and as my main "favorites" display on my vertical cabinet.

Attract-mode is pretty flexible.
Visit my arcade blog ... www.idahogaragecade.com (Updated: 03/14/18)

Matt68061
Contributing Member
Contributing Member
Posts: 32
Joined: Fri Aug 25, 2017 8:39 pm

Re: SDArcade V2.1

Post by Matt68061 » Fri Dec 07, 2018 5:43 am

Working fine for me. Nice work as always.

guntherm
Contributing Member
Contributing Member
Posts: 45
Joined: Sun Nov 11, 2018 8:58 am

Re: SDArcade V2.1

Post by guntherm » Sat Dec 08, 2018 2:43 pm

Sir,

What is it your using to modify your themes?

I want to be able to change Font colors.
Also change and put the List and ListCount and Times played on the bottom instead of msg of select games with joystick. This cabinet is in my home not a bar etc.. I wish it to be option of top or bottom

You theme is the one I keep coming back to. I try as many as I can.. but always comes back to yours.

User avatar
FrizzleFried
Legendary Contributor
Legendary Contributor
Posts: 205
Joined: Sat Nov 25, 2017 5:35 pm
Location: Idaho
Contact:

Re: SDArcade V2.1

Post by FrizzleFried » Sat Dec 08, 2018 4:17 pm

I can not take credit for this theme...

The original theme was from the ArcadeSD device... then JediOne over at attractmode.com converted it. Dee2er here modified it to work with the Pi... then behrmr made a couple tweaks ... since then I've put in quite a bit of work on it as well.

I'm actually working on what will likely be my final release of this... v3...

I plan on including 8 to 10 backgrounds, 8 to 10 static frames... I've dumped the bezel option (did anyone actually ever use this option?), but I kept the scanlines option (again, does anyone ever use this option?)...

I will see what it would take to have an upper/lower option for game x of x and played x times before I release...

To modify these things on your own, use NOTEPAD++ ... (it's free). Load the 'layout.nut' file up from within the layout folder...

Inside that file you will find code. Colors are easily changed...

Example:

Code: Select all

	local label_play = fe.add_text(" PLAYED [PlayedCount] TIMES ", flx*0.000, fly*0.030, flw*1.000, flh*0.050 );
		label_play.align = Align.Right;
		label_play.font = "ARCADE";
		label_play.charsize = 9;
		label_play.alpha = 210;
Here is an example of what it looks like to add text to the top right... this code simply adds the PLAYED x TIMES code to the top right... first up are the coordinates as to where to place the information.... how that is done is with the "flx*0.000, fly*0.030, flw*1.000, flh*0.050" code above. What you see is: HORIZONTAL position of top left pixel of text box location (flx*.0.00 says left most pixel), VERTICAL POSITION of top left pixel of text box location (fly*0.030 says 3% of screen height down from top), HORIZONTAL WIDTH OF TEXT BOX (flw*1.000 says to make the text box the entire width of the screen), then VERTICAL HEIGHT OF TEXT BOX (flh*0.050 says to make the text box 5% of the screen height).

Now, why would I make the text box the entire width of the screen? It's easy to position things that way when you are aligning left and right. A perfect example is the GAME x of x and Played X times text boxes. BOTH boxes are setup on the same horizontal plane, both are set for 100% width... one is set for align left the other is set for align right. If you don't add an align command, the system will assume "center".

Next is color... the above only uses white... and different stages of white using the ALPHA command. ALPHA 255 is WHITE. ALPHA 210 is just a little less white...

If you want to change the actual color you just add this command:

STRINGNAME.set_rgb( 255, 255, 255 );

Where stringname is you want to put whatever string-name you're working on. In the case of the above code, it would be:

label_play.set_rgb( 255, 255, 255 );

The numbers are RGB (red, green, blue) code. If you want white... 255, 255, 255. If you want black 0, 0, 0. If you want blue 0, 255, 0. If you want red 255, 0, 0. Obviously you can adjust those numbers for any color you want...

Other code above is pretty simple to figure out. label_play.play.font is obviously the font to use... and play.charsize is the size of the characters. Play with those as well.

Another thing to keep in mind is that the code is read from top to bottom. What that means is that you can layer/stack text...art...whatever... but keep in mind the orientation of the stack. If you add code to insert a 100 pixel x 20 pixel image at the top corner... then you add text over that image... awesome... but if the code that makes the text appear is above the code for the box... the text will appear then the box will appear OVER the text. In that case you want to code the box first then the text.

Using this info you can hack around in the code an learn how to modify things. That is how I did it myself. I don't know how to code. Not at all. I just know how to hack around and see how things work and learn from it.

:D
Visit my arcade blog ... www.idahogaragecade.com (Updated: 03/14/18)

User avatar
FrizzleFried
Legendary Contributor
Legendary Contributor
Posts: 205
Joined: Sat Nov 25, 2017 5:35 pm
Location: Idaho
Contact:

Re: SDArcade V2.1

Post by FrizzleFried » Sat Dec 08, 2018 4:33 pm

This very layout was my first venture in programming in squirrel..

I want to say the original layout was around 300 lines. I just checked and this bad boy is nearly at 1250 lines...

:D

That said, there are probably much more efficient ways ...

:)
Visit my arcade blog ... www.idahogaragecade.com (Updated: 03/14/18)

Matt68061
Contributing Member
Contributing Member
Posts: 32
Joined: Fri Aug 25, 2017 8:39 pm

Re: SDArcade V2.1

Post by Matt68061 » Sat Dec 08, 2018 9:14 pm

Frizz...

Where did you go to educate yourself in squirrel? Any online suggestions?

I'm really interested in doing this myself. My programming skills end in Basic around 1986 :lol: ! Even though I recall dabbling in Cobal in college but most of those years are a little fuzzy.

I have to ask... did you add the static frames to get away from the hypnotizing multi color
frame you get after exiting a game.

Curious if anyone ever found a solution on that issue.

Also, since you asked, I never use the bezel option or the scanline option.

User avatar
FrizzleFried
Legendary Contributor
Legendary Contributor
Posts: 205
Joined: Sat Nov 25, 2017 5:35 pm
Location: Idaho
Contact:

Re: SDArcade V2.1

Post by FrizzleFried » Sun Dec 09, 2018 12:48 am

My only experience with squirrel are these layouts.

My only programming experience is rudimentary basic BITD... LOGO (wee!)... and a little bit of SQL (again, mostly hacking my forum software)...

That's it.

Jump in... start poking around... it's not really hard at all...

:)

Yeah, I have 2 systems that go in to that speed color mode after exit and one that doesn't. No rhyme or reason as to why it does it... plus the colors get a little old... so, I figured, why not...
Visit my arcade blog ... www.idahogaragecade.com (Updated: 03/14/18)

guntherm
Contributing Member
Contributing Member
Posts: 45
Joined: Sun Nov 11, 2018 8:58 am

Re: SDArcade V2.1

Post by guntherm » Sun Dec 09, 2018 12:41 pm

I starting poking around.. I have some programming background.

i moved the Times played and List down to bottom and changed color.. Easy enough..

However when deciding to really try to do things. I added a new option. The whole theme gets screwed up. lol Not sure why..

My code:
</ label="Times Played Location", help="Times Played Top/Bottom", options="Top,Bottom", order=14 /> played_location="Bottom";


when i go into the menu and try to look at the theme options. I just get a screen to rename the theme. So I keep screwing it up!! lol

User avatar
FrizzleFried
Legendary Contributor
Legendary Contributor
Posts: 205
Joined: Sat Nov 25, 2017 5:35 pm
Location: Idaho
Contact:

Re: SDArcade V2.1

Post by FrizzleFried » Sun Dec 09, 2018 4:36 pm

Did you put it within the { and } for class UserConfig? The code you posted should work... well, it shouldn't break anything. You do have to associate an IF statement later in the code with "played_location"... but just that code itself, if posted within the class UserConfig brackets... SHOULD display the option at least...

As a matter of fact, I just COPY/PASTED your code in to one of my layouts and it worked fine (it displayed the setting)...

If that is all you are adding, you're breaking the code by where you place it.

If you are doing multiple tweaks, I suggest cutting that back to one tweak at a time ... then test... until you get the knack of things.
Visit my arcade blog ... www.idahogaragecade.com (Updated: 03/14/18)

guntherm
Contributing Member
Contributing Member
Posts: 45
Joined: Sun Nov 11, 2018 8:58 am

Re: SDArcade V2.1

Post by guntherm » Mon Dec 10, 2018 10:49 am

FrizzleFried wrote:
Sun Dec 09, 2018 4:36 pm
Did you put it within the { and } for class UserConfig? The code you posted should work... well, it shouldn't break anything. You do have to associate an IF statement later in the code with "played_location"... but just that code itself, if posted within the class UserConfig brackets... SHOULD display the option at least...

As a matter of fact, I just COPY/PASTED your code in to one of my layouts and it worked fine (it displayed the setting)...

If that is all you are adding, you're breaking the code by where you place it.

If you are doing multiple tweaks, I suggest cutting that back to one tweak at a time ... then test... until you get the knack of things.
Yes did all that. However I found a few issues. I was editing the layout.nut file via wi-fi. And it appears that my text editor/me added extra code and it basically corrupted it. Lesson learned be very careful editing the themes live via wi-fi.

After all that, I got the movement down and working, then all a sudden upon a new reboot, the screen just flashes red, green, blue, black.. Is there anything I can do without going all the way back to a fresh imaged system? it was working perfect, moving the stuff from top to bottom via the setting.

I even edited the attract.cm so it starts up with a different theme.

Post Reply