⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scroll3d.java

📁 这是一个用2D来模拟3D效果的卷轴动画 希望大家喜欢!
💻 JAVA
字号:
import java.io.IOException;

import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;

/**
 * Shows how to use two Layers of background moving at different speed,
 * to create a sense of 3D.
 *
 * This code is part of the Tips & Tricks section at 
 * www.SonyEricsson.com/developer
 *
 * Written by J鰊s Weimarck, 2004
 */
public class Scroll3D extends MIDlet implements CommandListener {
  private Display display;  
  private ScrollCanvas scrollCanvas;
  private Command exitCommand;
  
  public void startApp() {
      try {
        scrollCanvas = new ScrollCanvas();
        exitCommand = new Command("Exit", Command.EXIT, 0);
        scrollCanvas.addCommand(exitCommand);
        scrollCanvas.setCommandListener(this);
        
        display = Display.getDisplay(this);
        display.setCurrent(scrollCanvas);        
        
        scrollCanvas.start(); 
        
      }catch (IOException ioe) {
        System.out.println(ioe.getMessage());
      }

     
  }
  
   public void commandAction(Command c, Displayable d) {
    if (c.getCommandType() == Command.EXIT) {
      destroyApp(true);
      notifyDestroyed();
    }
   }
  
  public void destroyApp(boolean unconditional) {
    scrollCanvas.stop();
  }
  
    
  
  public void pauseApp() {}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -