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 - markc74

Pages: [1] 2
1
Scripting / Re: Can I do this using arrays and surfaces?
« on: January 29, 2021, 06:50:55 AM »
i would jump up on discord,,,good peeps...you are known im shure of it,

your skills are ...always needed

Ah thanks! Is there a particular board? I don't use Discord very often so not really used to the layout

2
Themes / Re: Vertical CRT layout 0.2
« on: January 26, 2021, 08:47:48 AM »
Just saw the other thread -

I certainly don't mind. I usually code something until it does what I need it to do, then get another idea and do that instead. Glad you were able to use and improve it!

3
Themes / Re: Verted -- Layout for Vertical Cabinets
« on: January 26, 2021, 08:44:10 AM »
That's some nice changes you made. I never ended up using it in my cab but did like the layout. I might come back to it as some point (using your code as it's nicer  ;D)

4
Scripting / Can I do this using arrays and surfaces?
« on: January 26, 2021, 04:09:11 AM »
Hope someone far cleverer than me can help!

I'm creating a new layout for use on my living room box (so widescreen and a little snazzier than my usual ones!)

I had an idea to create a cool filter select menu where you can press a button and move around a grid of available filters, grouped in rows - so my top row might be "all games','most played','favourites' and the next row might be arcade - 'mame','model 3','teknoparrot' etc

I can push the filters into an array fine:

Code: [Select]
local s_list = ["Top","Arcade"];
local f_list = [];
      f_list.append(["Top","All Games"]);
      f_list.append(["Top","Favourites"]);
      f_list.append(["Top","Most Played"]);
      f_list.append(["Arcade","Classics"]);
      f_list.append(["Arcade","Model 2"]);
etc

But what I would like to do, is generate surfaces on the fly based on the row that they appear in. I'd then like to reference those surfaces by their generated name so I can scroll them independently. So in the above example I would have a surface called "Top" and another surface called "Arcade"

So something like this:

Code: [Select]
foreach (s in s_list) {
      #Generate surface based on s value at posiition y
      foreach (f in f_list) {
            # Add items to above surface at position x
            # x=x+200
      }
      y=y+200
}

I could obviously hard code all the filters in, but this would be pretty long-winded and not very flexible.

Is there a way this can be done?

5
Scripting / Issue with animate2 module and delay
« on: December 12, 2019, 01:19:50 AM »
Hi guys - it's been a while since I've messed around with Attract Mode but got the bug again and am working on a new layout for a micro build I've nearly finished.

Anyway - What I'm *trying* to do is slowly scroll a menu bar off the top of the screen after 3 seconds. This is the line of code I am using:

PropertyAnimation(menu).key("y").from(0).to(-80).delay("3s").duration("5s").easing("ease-out-circle").play();

I don't actually want it to take 5 seconds to scroll out - I'm just using that to demonstrate the problem I am having. Basically the bar stays exactly where it should for 3 seconds, but then immediately moves near to the top of the screen and then slowly scrolls the rest away over 2 seconds. It's as if the animation is starting at the same time as the delay (but not visible) and then jumps to the 3 second point of the animation and completes it.

Any ideas? Am I being an idiot?

6
Themes / Re: Theme name
« on: November 15, 2018, 05:04:32 PM »
Yeah that was one of the first themes I ever made. The idea was to have a different row based on the machines I played at a location so there would never be more than 15-20 games per display. The plan was to capture the vibe of being back in the arcades but I agree - the screens were too small and I never used it. Mostly because I hated going left to right to pick a cab.

Still - it was a fun intro to attract mode though!

7
Hi all,

I've been working on this layout on and off for a little while as I had a couple of bugs that I couldn't seem to iron out. After a moment of clarity (read:sobriety) I think it should be working pretty well now. It's basically an expanded version of my Vertical theme here: http://forum.attractmode.org/index.php?topic=2120.0

It's very much aimed at CRT cabinets running at 640x480. I haven't tried it in 320x240 but it would probably work fine with some tweaking to font sizes and such.

I've included the layout and the attract mode config file because it very much relies on both the displays and filters being setup in a particular way but it should be easy enough to follow. Ask any questions if you want any more info.

Video: https://www.youtube.com/watch?v=nXN8tFDVSVk

(Note that I haven't finished my games lists yet so there's a few blanks/rom names showing as titles etc)

Features:
Switch between game list view/history/artwork with a button press (button 3)
Switch between system/genre/year/controls with a button press (button 2)
Switch between filters (based on above list) with a button press (button 1)

Uses the animate2 and history scripts from arcadebliss so credit to those guys for being awesome

Hope this is useful to someone!

M

8
Hi guys,

I did a layout a while ago called Invaders that I was using for my vertical cabinet. I uploaded it to the Themes board

I'm most of the way through a horizontal version but I'm hitting 2 bugs that I can't seem to fix and I'd be very grateful if anyone could help shed some light on what I might be missing!

I've attached a video showing what *is* happening but I'll explain first what *should* be happening!

The title on the top left bar is showing the current selected filter. I have a button on my panel which goes to the next filter when pressed.

Bug 1: When I reach the end of the filter list, I can't get the title to return to the first filter (ALL). Instead it stays on the last filter on the list (Sony Playstation). If I press the next filter button again, you can see ALL scroll off the list and it carries on as normal. I've attempted to check to see if the next filter name is null but i cant seem to get it to work... (14 seconds/27 seconds of video)

On the top right of the frontend it shows the display. As there are only 4 I can show them all with a scrolling 'tab' when you click the 'next display' button. This works great, and does go to the next display, BUT:

Bug 2: It doesn't reload the filters at the top left, meaning that they dont make sense for the display. i.e. systems should show "MAME", "Playstation" etc but if I switch to year, the filter list should show "1978", 1979" etc. (32 seconds of video)

https://youtu.be/hZihdxN8sqo

As soon as these bugs are fixed I'll upload it properly to the themes area. Any help most gratefully received!!

Many thanks,
Mark

Code: [Select]
//
// Attract-Mode Front-End - "Blip 2018 by MarkC74"
//

fe.layout.width=800;
fe.layout.height=480;

fe.load_module("animate2");
fe.layout.font = "captain";


// BACKGROUND
// ----------

local menu_bar = fe.add_image("background_menu.png",0,0,640,64);

// FILTERS MENU
// ------------

local filter_current = fe.add_text("",14,12,320,40);
filter_current.charsize = 32;
filter_current.align = Align.Left;
local filter_next = fe.add_text("",14,54,320,40);
filter_next.charsize = 32;
filter_next.align = Align.Left;


// VIDEO
// -----

local vid_area = fe.add_surface(640,368);
vid_area.y = 64
local no_vid = vid_area.add_image("black.png",0,0,640,480);
local vid = vid_area.add_artwork("video",0,0,640,480);

local shade = fe.add_image( "shade.png", 8, 64, 640, 368 );
shade.alpha = 200;

// GAMES LIST
// ----------

local lb = fe.add_listbox( 20, 80, 400, 336 );
lb.charsize = 18;
lb.set_sel_rgb( 255, 255, 255 );
lb.alpha = 50;
lb.selbg_alpha = 0;
lb.sel_alpha = 255;
lb.rows = 13;
lb.align = Align.Left;


// HISTORY TAB
// -----------

local history = fe.add_surface(640,368);
history.x = 640;
history.y = 64;
local history_background = history.add_image( "black.png", 0, 0, 640, 368 );
history_background.alpha= 150;
local history_text = history.add_text("[!get_hisinfo]", 32, 8, 600, 304);
history_text.charsize = 16;
history_text.align = Align.Left;
history_text.word_wrap = true;


// ARTWORK TAB
// -----------

local flyer_cab = fe.add_surface(640, 368);
flyer_cab.x = 640;
flyer_cab.y = 64;
local flyer_cab_background = flyer_cab.add_image( "artwork_background.png", 0, 0, 640, 368 );
local flyer_cab_flyer = flyer_cab.add_artwork ("flyer", 8, 0, 287, 368);
local flyer_cab_cab = flyer_cab.add_artwork ("cabinet", 297, 0, 333, 368);
flyer_cab_cab.preserve_aspect_ratio = true;





// FRAME
// -----

local frame = fe.add_image("frame.png",0,0,640,480);
local button_go = fe.add_image("button_go.png",552,404,68,57);
local right_side_mask = fe.add_image( "black.png", 640, 0, 880, 840 );





// TOP MENU
// --------

local top_menu_tab = fe.add_image("top_menu_tab.png",304,16,80,40);
local top_menu_system = fe.add_text("SYSTEM",304,24,80,20);
local top_menu_genre = fe.add_text("GENRE",384,24,80,20);
local top_menu_years = fe.add_text("YEAR",464,24,80,20);
local top_menu_controls = fe.add_text("CONTROLS",544,24,80,20);


// BOTTOM MENU
// -----------

local bottom_menu_text = fe.add_text("Game [ListEntry] of [ListSize]",20,440,320,20);
bottom_menu_text.charsize=16;
bottom_menu_text.align = Align.Left;

local label_game_details = fe.add_text("[Year] [Manufacturer]",304, 440, 240,20);
label_game_details.charsize=16;

local bottom_menu_tab = fe.add_image("bottom_menu_tab.png",276,371,128,64);
local bottom_menu_video = fe.add_text("GAMEPLAY",304,408,80,20);
local bottom_menu_info = fe.add_text("HISTORY",384,408,80,20);
local bottom_menu_cabinet = fe.add_text("ARTWORK",464,408,80,20);


// SCRIPTS
// -------

// VARIABLES
// ---------

local info_view = 0;
local slide_time = "500ms";
local animation_style = "ease-in-out-circle";


// ONLOAD
// ------

function start_up( ttype, var, transition_time )
{
if (ttype==Transition.StartLayout) {
if (var==FromTo.Frontend)
{
PropertyAnimation(button_go).key("alpha").from(0).to(220).duration("1s").yoyo(1).loops(-1).play();
filter_current.msg = fe.filters[fe.list.filter_index].name;
if (fe.list.name=="System") {top_menu_tab.x=304;}
if (fe.list.name=="Genre") {top_menu_tab.x=384;}
if (fe.list.name=="Year") {top_menu_tab.x=464;}
if (fe.list.name=="Controls") {top_menu_tab.x=544;}
}
}
if (ttype==Transition.ToNewList) {
//fe.set_display(fe.list.display_index);
};
   return false;
};
fe.add_transition_callback( "start_up" );


// ON TRANSITIONS
// --------------

function on_transition( signal_str )
{
if (signal_str=="next_filter")
{
filter_current.msg = fe.filters[fe.list.filter_index].name;
filter_next.msg = fe.filters[fe.list.filter_index+1].name;
//if (fe.filters[fe.list.filter_index+1].name.isnull()) {
// filter_next.msg = "xxxx"
//};
PropertyAnimation(filter_current).key("y").from(12).to(-28).duration(slide_time).easing(animation_style).play();
PropertyAnimation(filter_next).key("y").from(52).to(12).duration(slide_time).easing(animation_style).play();




};
if (signal_str=="next_display")
{
if (fe.list.name=="System") {
PropertyAnimation(top_menu_tab).key("x").to(384).duration(slide_time).easing(animation_style).play();
} else if (fe.list.name=="Genre") {
PropertyAnimation(top_menu_tab).key("x").to(464).duration(slide_time).easing(animation_style).play();
} else if (fe.list.name=="Year") {
PropertyAnimation(top_menu_tab).key("x").to(544).duration(slide_time).easing(animation_style).play();
} else {
PropertyAnimation(top_menu_tab).key("x").to(304).duration(slide_time).easing(animation_style).play();
};
};
if ((signal_str=="up"||signal_str=="down"||signal_str=="next_display")&&(info_view!=0))
{
info_view = 2;
fe.signal( "custom1" );
}
if ((signal_str=="custom1"))
{
if (info_view==0) {

PropertyAnimation(lb).key("x").from(20).to(-250).duration(slide_time).easing(animation_style).play();
PropertyAnimation(history).key("x").from(640).to(0).duration(slide_time).easing(animation_style).play();
PropertyAnimation(bottom_menu_tab).key("x").to(356).duration(slide_time).easing(animation_style).play();
info_view = 1;
};
else if (info_view==1) {
PropertyAnimation(flyer_cab).key("x").from(640).to(0).duration(slide_time).easing(animation_style).play();
PropertyAnimation(bottom_menu_tab).key("x").to(436).duration(slide_time).easing(animation_style).play();
info_view = 2;
};
else {
PropertyAnimation(lb).key("x").from(-250).to(20).duration(slide_time).easing(animation_style).play();
PropertyAnimation(history).key("x").from(0).to(640).duration(slide_time).easing(animation_style).play();
PropertyAnimation(flyer_cab).key("x").from(0).to(640).duration(slide_time).easing(animation_style).play();
PropertyAnimation(bottom_menu_tab).key("x").to(276).duration(slide_time).easing(animation_style).play();
info_view = 0;
};
};
return false;
};
fe.add_signal_handler( "on_transition" );





// SHOW HISTORY TEXT

class UserConfig {
</ label="History.dat", help="History.dat location. Be sure to enable and config History.dat from the plugins menu.", order=1 />
dat_path="C:\\games\\mame\\history.dat";
};

local my_config = fe.get_config();

function get_hisinfo()
{
local sys = split( fe.game_info( Info.System ), ";" );
local rom = fe.game_info( Info.Name );
local text = "";
local currom = "";

local alt = fe.game_info( Info.AltRomname );
local cloneof = fe.game_info( Info.CloneOf );
local lookup = get_history_offset( sys, rom, alt, cloneof );

if ( lookup >= 0 )
{
text = get_history_entry( lookup, my_config );
local index = text.find("- TECHNICAL -");
if (index >= 0)
{
local tempa = text.slice(0, index);
text = strip(tempa);
}
} else {
if ( lookup == -2 )
text = "Index file not found.  Try generating an index from the history.dat plug-in configuration menu.";
else
text = "No Information available for:  " + rom;

return text;
};



// DEBUG
// -----




9
Scripting / Re: Is it possible to format text on a surface?
« on: May 21, 2018, 08:56:06 AM »
Aaaaaah - now it clicks. ;D

Sorry I missed that the first time. Thank you very much for the explanation!

Best wishes,
Mark

10
Scripting / Re: Is it possible to format text on a surface?
« on: May 21, 2018, 08:03:12 AM »
Thanks zpaolo11x,

That's soo close! How do I then add that object to a surface?

11
Scripting / Re: Is it possible to format text on a surface?
« on: May 21, 2018, 06:28:25 AM »
Yes that's the right way. Did you notice that fonts on a surface have a slight border around them, when the surface is transparent?

Yes I did but I kinda like it looks. But now I cant seem to align the text in the surface though! Any ideas?

I've got this:

dd_artwork_options.add_text("Show Artwork",0, 0, 252, 66).charsize=40;

Which works great, albeit centres the text in the surface so tried this (and most variants I can think of!)

dd_artwork_options.add_text("Show Artwork",0, 0, 252, 66).charsize=40.align=Align.Left;
dd_artwork_options.add_text("Show Artwork",0, 0, 252, 66).charsize=40.align=Left;

But they don't work... Bah...

Am I missing something stupid? I've searched the site and couldn't see anything...

Many thanks for any help on this!

12
Scripting / Re: Is it possible to format text on a surface?
« on: May 20, 2018, 03:48:34 PM »
After spending a good hour trying to work it out, 2 mins after posting I worked it out. Don't know if this is useful to anybody but here's how I did it!

local    foo = fe.add_surface(500,540);   
      foo.add_text("xxxxx",100,15,400,30).charsize=130;
      foo.add_text("222",100,200,400,30);
      foo.add_text("333",100,300,400,30);
      foo.add_text("444",100,520,400,30);

I really feel like an idiot!  :o

13
Scripting / Is it possible to format text on a surface?
« on: May 20, 2018, 03:37:36 PM »
I'm trying to create a group of objects that animate in and out of the screen in the same way, so I thought adding them to a surface would be the answer but I cant see a way to set font sizes within a surface. The only option I can find is to add text which defaults to a tiny font.

Is it possible?



14
Themes / Re: Vertical CRT layout 0.2
« on: February 16, 2018, 02:54:08 PM »
Oops. Overwrote my last post when I meant to edit it... anyway - the crux was:

- ace to see it on a CRT - I like what you've done with it
- I officially give it to the forum to own
- I'll probably create a horizontal version at some point for my other cab but I'll see if anyone else fixes the bugs first  ;D

15
Themes / Re: Vertical CRT layout 0.2
« on: February 16, 2018, 02:39:53 PM »
I think Arcade Bliss had it it working (or somewhere did anyway). Only thing you needed to be careful of is that I created a surface for the history so you might need to take that into account. TBH I got everything I needed to know from the top bit but it did slightly bug me that I couldn't see the rest.

If you do get a solution then post it up as I would definitely be interested

Pages: [1] 2