「iアプリ」の編集履歴(バックアップ)一覧はこちら
「iアプリ」(2008/07/22 (火) 16:55:26) の最新版変更点
追加された行は緑色になります。
削除された行は赤色になります。
*A
import com.nttdocomo.ui.IApplication;
import com.nttdocomo.ui.Display;
public class A extends IApplication(){
punlic void start(){
B b = new B();
Display.setCurrent(b);
b.exe();
}
}
*B
import com.nttdocomo.ui.*;
public class B extends Canvas{
private final static int
S_TITLE = 0,
S_PLAY = 1;
static int keyEvent = -999;
static int scene = S_TITLE;
static int init = S_TITLE;
static int index = 0;
void exe(){
Graphics g = getGraphics();
try{
while(true){
if(init >= 0){
if(init == S_TITLE){
setSoftLabel(SOFT_KEY_1,"");
setSoftLabel(SOFT_KEY_2,"");
}else
if(init == S_PLAY){
setSoftLabel(SOFT_KEY_1,"");
setSoftLabel(SOFT_KEY_2,"");
}
keyEvent = -999;
init = -9;
}
if(scene == S_TITLE){
//処理
//画面描画
//キー操作
}else
if(scene == S_PLAY){
//処理
//画面描画
//キー操作
}
Thread.sleep(1);
}
}catch(Exception e){}
}
public void processEvent(int type,int param){
if(type == Display.KEY_PRESSED_EVENT){keyEvent = param;}
if(type == Display.KEY_RELEASED_EVENT){keyEvent = -999;}
}
public void paint(Graphics g){}
*A
import com.nttdocomo.ui.IApplication;
import com.nttdocomo.ui.Display;
public class A extends IApplication(){
punlic void start(){
B b = new B();
Display.setCurrent(b);
b.exe();
}
}
*B
import com.nttdocomo.ui.*;
public class B extends Canvas{
private final static int
S_TITLE = 0,
S_PLAY = 1;
static int keyEvent = -999;
static int scene = S_TITLE;
static int init = S_TITLE;
static int index = 0;
void exe(){
Graphics g = getGraphics();
try{
while(true){
if(init >= 0){
if(init == S_TITLE){
setSoftLabel(SOFT_KEY_1,"");
setSoftLabel(SOFT_KEY_2,"");
}else
if(init == S_PLAY){
setSoftLabel(SOFT_KEY_1,"");
setSoftLabel(SOFT_KEY_2,"");
}
keyEvent = -999;
init = -9;
}
if(scene == S_TITLE){
//処理
//画面描画
//キー操作
}else
if(scene == S_PLAY){
//処理
//画面描画
//キー操作
}
Thread.sleep(1);
}
}catch(Exception e){}
}
public void processEvent(int type,int param){
if(type == Display.KEY_PRESSED_EVENT){keyEvent = param;}
if(type == Display.KEY_RELEASED_EVENT){keyEvent = -999;}
}
public void paint(Graphics g){}
}