?? webiscreen.java
字號(hào):
/*
* WebiScreen.java
*
* Created on 2006年5月5日, 上午11:59
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package DogPet;
import java.util.Timer;
import java.util.TimerTask;
import javax.microedition.lcdui.*;
// Game_control
class WebiScreen extends Canvas
{
private static final String welcome = "Welcome to WebiNeti";
Image image[];
private Image image_bg;
private Game_control game_control;
private Timer timer;
private int flashDuration;
int swapped;
boolean timers;
int now_times;
private int sel;
class Task19 extends TimerTask
{
public final void run()
{
if(timers)
{
now_times = now_times + 1;
swapped = swapped + 1;
if(swapped > image.length - 1)
swapped = 0;
repaint();
}
}
Task19()
{
}
}
public WebiScreen(Game_control gc)
{
image = new Image[4];
image_bg = null;
timer = new Timer();
flashDuration = 200;
swapped = 0;
timers = true;
now_times = 0;
sel = 1;
game_control = gc;
try
{
image_bg = Image.createImage("/dog.png");
}
catch(Exception ex) { }
for(int i = 0; i < image.length; i++);
timer.scheduleAtFixedRate(new Task19(), 0L, flashDuration);
}
public void paint(Graphics g)
{
g_cls(g, 0xffffff);
g.setColor(0xff0000);
g.setFont(Font.getFont(0, 200, 0));
g.drawString("WebiNeti Splash", 50, 50, 20);
if(now_times > 100)
{
image = null;
killed();
game_control.gamesplash();
}
}
protected void keyPressed(int keyCode)
{
if(game_control != null)
{
killed();
image = null;
game_control.gamesplash();
}
}
public void killed()
{
timer.cancel();
timer = null;
}
public void g_cls(Graphics g, int setcolor)
{
g.setColor(setcolor);
g.fillRect(0, 0, getWidth(), getHeight());
g.drawImage(image_bg, 0, 0, 20);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -