Author Topic: ps2 layout  (Read 3074 times)

cherwilco

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
ps2 layout
« on: October 21, 2014, 05:39:12 AM »
Just a little Ps2 layout with srolling marquee artwork on the left and video snap and box art that switches with your game  :D  (zip is attached)

preview video here:
https://www.youtube.com/watch?v=aY5KXdPbOfM&feature=youtu.be

needed artworks not included in zip:
flyer  http://www.mediafire.com/download/6z1fjacmb99syay/Wheel.zip   (1,081 marquees)
marquee   http://www.mediafire.com/download/4d71c9414kn0b1k/Boxart.zip   (1,238 ps2 boxarts)
snap   (the ones I have are over 7 gig for all, will only upload if someone is really interested)


code for layout.nut file:
Code: [Select]
//
// Attract-Mode Front-End - "mediaV" sample layout
//
fe.layout.width=800;
fe.layout.height=600;

fe.layout.font="coolvetica";

fe.add_image( "Background.jpg", 0, 0, 800, 600 );
fe.add_artwork( "snap", 470, 135, 295, 225 );
fe.add_image( "frame.png", 465, 130, 310, 235 );
fe.add_image("select.png", 18, 475, 220,9 );
fe.add_image("ps2box.png", 578, 377, 128, 212 );

// fill an entire surface with our snap at a resolution of 124x204
//
local surface = fe.add_surface( 124, 204 );
local snap = surface.add_artwork( "flyer", 0, 0, 124, 204 );
snap.preserve_aspect_ratio = false;

// position and pinch the surface
//
surface.set_pos( 588, 380, 115, 206 );
surface.pinch_y = 11;


local title = fe.add_text( "[Title]", 10, 660, 320, 20 );
title.set_rgb( 255, 255, 255 );
title.align = Align.Left;

local man = fe.add_text( " ([Category]) [Manufacturer] [Year] ", 10, 690, 320, 20 );
man.set_rgb( 255, 255, 255 );
man.align = Align.Left;

local name = fe.add_text( " [ListTitle] ", 02, 02, 320, 20 );
name.set_rgb( 255, 255, 255 );
name.align = Align.Left;

local entry = fe.add_text( "[ListEntry]/[ListSize]", 350, 610, 320, 18 );
entry.set_rgb( 255, 255, 255 );
entry.align = Align.Right;


// Create 10 artworks.
local title_p2 = fe.add_artwork( "marquee", 20, 00, 190, 75);
local title_p3 = fe.add_artwork( "marquee", 20, 80, 190, 75 );
local title_n1 = fe.add_artwork( "marquee", 20, 160, 190, 75 );
local title_n2 = fe.add_artwork( "marquee", 20, 240, 190, 75 );
local title_n3 = fe.add_artwork( "marquee", 20, 320, 190, 75 );
local title_n0 = fe.add_artwork( "marquee", 20, 400, 190, 75 );
local title_n5 = fe.add_artwork( "marquee", 20, 480, 190, 75 );
local title_n6 = fe.add_artwork( "marquee", 20, 560, 190, 75 );
local title_n7 = fe.add_artwork( "marquee", 20, 640, 190, 75 );
local title_n8 = fe.add_artwork( "marquee", 20, 720, 190, 75 );

// Set index_offset for these 5 artworks.
title_p2.index_offset = -5;
title_p3.index_offset = -4;
title_n1.index_offset = -3;
title_n2.index_offset = -2;
title_n3.index_offset = -1;
title_n0.index_offset = 0;
title_n5.index_offset = 1;
title_n6.index_offset = 2;
title_n7.index_offset = 3;
title_n8.index_offset = 4;
// Add transition callback function.
fe.add_transition_callback( "orbit_transition" );
// Fill in orbit_transition function, as below:
local SPIN_MS=160; // Duration of transition effect (in msec)
function orbit_transition( ttype, var, ttime ) {
switch ( ttype )
{
case Transition.ToNewSelection:
if ( ttime < SPIN_MS ) {
local direction = -1;
if (var < 0) direction = 1;
local increment = (ttime * direction * 80) / SPIN_MS;
title_p2.y = 00 + increment;
title_p3.y = 80 + increment;
title_n1.y = 160 + increment;
title_n2.y = 240 + increment;
title_n3.y = 320 + increment;
title_n0.y = 400 + increment;
title_n5.y = 480 + increment;
title_n6.y = 560 + increment;
title_n7.y = 640 + increment;
title_n8.y = 720 + increment;

return true;
}

else {
title_p2.y = 00;
title_p3.y = 80;
title_n1.y = 160;
title_n2.y = 240;
title_n3.y = 320;
title_n0.y = 400;
title_n5.y = 480;
title_n6.y = 560;
title_n7.y = 640;
title_n8.y = 720;
return false;
}
}
return false;
}

// Gives us a nice high random number for the RGB levels
function brightrand() {
 return 255-(rand()/255);
}

local red = brightrand();
local green = brightrand();
local blue = brightrand();

// Transitions
fe.add_transition_callback( "fancy_transitions" );

function fancy_transitions( ttype, var, ttime ) {
 switch ( ttype )
 {
 case Transition.StartLayout:
 case Transition.ToNewList:
 case Transition.ToNewSelection:
 case Transition.EndLayout:
  //gametitleshadow.msg = trimmed_title( var );
  //gametitle.msg = trimmed_title( var );
  //man.msg = trimmed_man ( var );
  red = brightrand();
  green = brightrand();
  blue = brightrand();
  //year.set_rgb (red,green,blue);
  //copy.set_rgb (red,green,blue);
  //man.set_rgb (red,green,blue);
  //romlist.set_rgb (red,green,blue);
  //screen.set_rgb (red,green,blue);
  //frame3.set_rgb (red,green,blue);
  //cat.set_rgb (red,green,blue);
  //title.set_rgb (red,green,blue);
  break;

 case Transition.FromGame:
  if ( ttime < 255 )
  {
   foreach (o in fe.obj)
    o.alpha = ttime;
   //message.alpha = 0;     
   return true;
  }
  else
  {
   foreach (o in fe.obj)
    o.alpha = 255;
   //message.alpha = 0;
  }
  break;
   
 case Transition.EndLayout:
  if ( ttime < 255 )
  {
   foreach (o in fe.obj)
    o.alpha = 255 - ttime;
   //message.alpha = 0;
   return true;
  }
  else
  {
   foreach (o in fe.obj)
    o.alpha = 255;
   //message.alpha = 0;
  }
  break;
     
 case Transition.ToGame:
  if ( ttime < 255 )
  {
   foreach (o in fe.obj)
    o.alpha = 255 - ttime;
   message.alpha = ttime;
   return true;
  }   
  break;
 }
 return false;
}
« Last Edit: October 21, 2014, 04:30:04 PM by cherwilco »

manzarek

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: ps2 layout
« Reply #1 on: November 29, 2018, 07:44:38 AM »
thanks beautiful theme