/* future theme */ width=Window.GetWidth(); height=Window.GetHeight(); ratio = width/height; img_logo = Image("logo.png"); img_ball = Image("ball.png"); if(ratio<1.4) { /* using 4:3 background */ img_background = Image("background43.png"); } else { img_background = Image("background.png"); } img_background = img_background.Scale(width,height); message="LliureX 16"; spr_msg = Sprite(Image.Text("LliureX 16")); spr_background=Sprite(img_background); spr_background.SetX(0.0); spr_background.SetY(0.0); spr_logo=Sprite(img_logo); spr_logo.SetX(width*0.5 - (img_logo.GetWidth() * 0.5 ) ); spr_logo.SetY(height*0.5 - (img_logo.GetHeight() * 0.5 ) ); spr_logo.SetZ(1); /* spr_bar=Sprite(img_bar); spr_bar.SetX((width*0.5 - (img_logo.GetWidth() * 0.5)) + 195 + 1); spr_bar.SetY((height *0.5 - (img_logo.GetHeight() * 0.5)) + 133 - 2); spr_bar.SetZ(2); */ spr_ball=Sprite(img_ball); ball_x=(width*0.5 - (img_logo.GetWidth() * 0.5)) + 195 - 14; ball_y=(height*0.5 - (img_logo.GetHeight() * 0.5)) + 133 - 14; ball_step=0; ball_dir=4; spr_ball.SetX(ball_x); spr_ball.SetY(ball_y); spr_ball.SetZ(3); fun message_callback(msg) { message=msg; } fun draw_message() { image = Image.Text(message,0,0,0,1); spr_msg.SetImage(image); spr_msg.SetZ(1); spr_msg.SetX(0.1 * width); spr_msg.SetY(0.95 * height); } fun refresh_callback() { draw_message(); ball_step=ball_step + ball_dir; if(ball_step>346) { ball_dir=-4; } if(ball_step<0) { ball_dir=4; } spr_ball.SetX(ball_x+ball_step); } Plymouth.SetMessageFunction(message_callback); Plymouth.SetRefreshFunction (refresh_callback); Plymouth.SetDisplayNormalFunction(refresh_callback); Plymouth.SetUpdateStatusFunction(message_callback);