Hello,
I tried a bubble layout but I don't know how to force the marquee and snap to be upon the bubbles.
How can I do ?
Thanks !
JMD
//
// Attract-Mode Front-End - "Bubble" layout
//
class Bubble
{
Bubblespng = ["1.png","2.png"];
id=0;
img=null;
pos_x =0;
pos_y =0;
color =0;
speed = 5;
function init ( n )
{
id = n;
pos_x = (rand()*660/RAND_MAX)-16;
pos_y = 500 + (rand()*35/RAND_MAX);
color = (rand()*2/RAND_MAX);
speed = (rand()*3/RAND_MAX)+1;
img = fe.add_image( Bubblespng[color], pos_x, pos_y );
}
function move()
{
pos_y -= speed*0.3;
if( pos_y <=-20 ) {
pos_y = 500 + (rand()*35/RAND_MAX);
pos_x = (rand()*640/RAND_MAX);
speed = (rand()*5/RAND_MAX)+1;
}
img.x = pos_x;
img.y = pos_y;
}
}
// set front end resolution
fe.layout.width=640;
fe.layout.height=480;
// add the game list box
::artwork_snap <- fe.add_artwork( "snap", 348, 120, 256, 262 );
::artwork_marquee <-fe.add_artwork( "marquee", 348, 16, 256 , 80 );
local l = fe.add_listbox( 16, 16, 278, 460 );
l.charsize = 20;
l.set_selbg_rgb( 255, 255, 255 );
l.set_rgb( 200, 200, 70 );
l.set_sel_rgb( 0, 0, 0 );
l.sel_style = Style.Bold;
l = fe.add_text( "[ListEntry]/[ListSize]", 320, 442, 290, 17 );
l.set_rgb( 200, 200, 70 );
l.align = Align.Right;
l = fe.add_text( "[Title]", 348, 408, 320, 17 );
l.set_rgb( 200, 200, 70 );
l.align = Align.Left;
l = fe.add_text( "[Year] [Manufacturer]", 348, 425, 320, 17 );
l.set_rgb( 200, 200, 70 );
l.align = Align.Left;
l = fe.add_text( "[Category]", 348, 442, 320, 17 );
l.set_rgb( 200, 200, 70 );
l.align = Align.Left;
// add a "each frame" callback
fe.add_ticks_callback( "tick" );
::Bubbles <- {};
for ( local i=0; i<30; i++ ){
// create new object
::Bubbles[i] <- Bubble();
// init it
::Bubbles[i].init(i);
}
function tick( ttime )
{
for ( local i=0; i<30; i++ ){
::Bubbles[i].move();
}
}