Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
Add splash image
Browse files Browse the repository at this point in the history
  • Loading branch information
shinovon committed Jun 28, 2023
1 parent c56d0e5 commit ce39f36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Binary file added res/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion src/ui/screens/SplashScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,28 @@

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

import App;

public class SplashScreen extends Canvas {

private Image splash;

public SplashScreen() {
setFullScreenMode(true);
try {
splash = Image.createImage("/splash.png");
} catch (Exception e) {
}
}

public void paint(Graphics g) {
g.setColor(-1);
g.fillRect(0, 0, getWidth(), getHeight());
// TODO: иконку
if (splash == null)
return;
g.drawImage(splash, getWidth() >> 1, getHeight() >> 1, Graphics.VCENTER | Graphics.HCENTER);
}

public void keyPressed(int key) {
Expand Down

0 comments on commit ce39f36

Please sign in to comment.