亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? menucanvas.java

?? 介紹J2ME 3D編程的源代碼,我運行過了,
?? JAVA
字號:
/***************************************************************************** Description: This is the canvas displaying the 3d menu. Created By: Oscar Vivall 2006-01-09 @file        MenuCanvas.java COPYRIGHT All rights reserved Sony Ericsson Mobile Communications AB 2004. The software is the copyrighted work of Sony Ericsson Mobile Communications AB. The use of the software is subject to the terms of the end-user license  agreement which accompanies or is included with the software. The software is  provided "as is" and Sony Ericsson specifically disclaim any warranty or  condition whatsoever regarding merchantability or fitness for a specific  purpose, title or non-infringement. No warranty of any kind is made in  relation to the condition, suitability, availability, accuracy, reliability,  merchantability and/or non-infringement of the software provided herein. *****************************************************************************/import javax.microedition.midlet.*;import javax.microedition.lcdui.*;import javax.microedition.lcdui.game.*;import javax.microedition.m3g.*;import javax.microedition.m3g.Camera;public class MenuCanvas extends GameCanvas implements Runnable{    private StarHScroller scroller; // scroll stars on the screen.    private Alert alert; // display info text on the screen    private Graphics3D g3d;    private World world;    private Mesh mesh;    private Camera camera;    // The appearances is used for each menu texture.     private Appearance appearance1;    private Appearance appearance2;    private Appearance appearance3;    private Appearance appearance4;    private final int WIDTH, HEIGHT; // the canvas size    // the menue options    private String []menu = new String[] {"Play game", "High scores...", "About...", "Help...", "Options...", "Quit"};    private final int MENU_SIZE = menu.length;    private Texture2D []texMenu = new Texture2D[MENU_SIZE];    private int index = 0; // menu index    private int face = 0; // cube face 0-3    // the current angle of the menu.    private int menu_angle = 0;    private int menu_rot = 0; // -1 or 1    private MIDlet midlet;        public MenuCanvas(MIDlet m){        super(false);                midlet = m;                setFullScreenMode(true);                WIDTH = getWidth();        HEIGHT = getHeight();        g3d = Graphics3D.getInstance();        world = new World();        camera = new Camera();        camera.setPerspective(60.0f, (float)WIDTH/(float)HEIGHT, 0.1f, 50.0f);        world.addChild(camera);        world.setActiveCamera(camera);        mesh = MC.createItem(); // create the menu mesh        mesh.translate(0.0f, -3.0f, -11.0f); // menu position        world.addChild(mesh);        appearance1 = mesh.getAppearance(0); // front        appearance2 = mesh.getAppearance(1); // back        appearance3 = mesh.getAppearance(4); // top        appearance4 = mesh.getAppearance(5); // bottom                // generate the menu textures to use.        createTextures();        scroller = new StarHScroller(WIDTH, HEIGHT);                new Thread(this).start();    }    /*     * Create one texture for each option in the nenu.     */    private void createTextures(){        Image image;        try{            for(int i=0; i<menu.length; i++){                image = createMenuImage(menu[i]); // create an image from text                texMenu[i] = new Texture2D(new Image2D(Image2D.RGB, image));                texMenu[i].setFiltering(Texture2D.FILTER_LINEAR, Texture2D.FILTER_LINEAR);                texMenu[i].setWrapping(Texture2D.WRAP_CLAMP, Texture2D.WRAP_CLAMP);            }        }catch(Exception e){            e.printStackTrace();        }                appearance1.setTexture(0, texMenu[0]);        appearance3.setTexture(0, texMenu[1]);        appearance4.setTexture(0, texMenu[5]);            }        /*     * Create an image from the text sent to the method     */    private Image createMenuImage(String imgStr){        int bgColor = 0xFFFFFF;        int fgColor = 0x00;        String menu;        Font f = Font.getDefaultFont();        Image image = null;                try{            Image bgImage = Image.createImage("/menubg.png");                        image = Image.createImage(128, 32);            Graphics g = image.getGraphics();            g.setFont(f);            g.setColor(bgColor);            g.fillRect(0, 0, image.getWidth(), image.getHeight());            g.drawImage(bgImage, 0, 0, 0);            g.setColor(fgColor);            menu = imgStr;                        g.drawString(menu, image.getWidth()/2 - f.stringWidth(menu)/2, 7, Graphics.TOP | Graphics.LEFT);        }catch(Exception e){            e.printStackTrace();        }        return image;    }        /*    * when the menu is rotating the textures on the cube is changing.    */    private void changeTextures(){        int front, top, bottom;        front = top = bottom = 0;        Appearance f,t,b;        f = appearance1;        t = appearance3;        b = appearance4;                // keep track of which appearance is actually facing the screen.        switch(face){            case 0:                f = appearance1;                t = appearance3;                b = appearance4;                break;            case 1:                f = appearance3;                t = appearance2;                b = appearance1;                break;            case 2:                f = appearance2;                t = appearance4;                b = appearance3;                break;            case 3:                f = appearance4;                t = appearance1;                b = appearance2;                break;        }        front = index;        top = index<MENU_SIZE-1?index+1:0;        bottom = index > 0? index-1:MENU_SIZE-1;                // set the texture for an appearance        f.setTexture(0, texMenu[front]);        t.setTexture(0, texMenu[top]);        b.setTexture(0, texMenu[bottom]);    }    /*     * The rendering method.     */    public void draw3D(Graphics g){        try{            g3d.bindTarget(g);            g3d.render(world);        }catch(Exception e){            e.printStackTrace();        }finally{            g3d.releaseTarget();        }    }        /*     * Used when the fire button is pressed     */    private void menuSelect(){        switch(index){            case 0:                // display the text on the screen.                alert.setText("Start Game");                alert.start();                break;            case 1:                alert.setText("High scores");                alert.start();                break;            case 2:                alert.setText("About");                alert.start();                break;            case 3:                alert.setText("Help");                alert.start();                break;            case 4:                alert.setText("Options");                alert.start();                break;            case 5: // Exit                midlet.notifyDestroyed();                break;        }    }    public void keyPressed(int key){        System.out.println(key);        switch(key){            case -1: // UP                if(menu_rot==0){                    index = index > 0?index-1:MENU_SIZE-1;                    face = face > 0 ? face-1:3;                    menu_rot = -3;                }                break;            case -2: // DOWN                if(menu_rot==0){                    index = index < MENU_SIZE-1 ? index+1:0;                    face = face <3 ? face+1:0;                    menu_rot = 3;                }                break;            case -5: // FIRE                menuSelect();                break;        }        System.out.println("index:" + index);    }    public void keyRepeated(int key){        keyPressed(key);    }    public void run(){        Graphics graphics = this.getGraphics();        alert = new Alert();        int exitCounter = 0;        float exitSpeed = 1.0f;        while(true){            // rotate the menu.            if(menu_rot != 0){                menu_angle += menu_rot;                mesh.postRotate(menu_rot, 1.0f, 0.0f, 0.0f);                if(menu_angle%90==0){                    menu_rot=0;                    changeTextures();                }            }            draw3D(graphics);                        // draw the alert text            if(alert.isStarted()){                alert.draw(graphics);            }            scroller.draw(graphics);            flushGraphics();            try{                Thread.sleep(10);            }catch(Exception e){}        }            }    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品视频麻豆| 777xxx欧美| 亚洲欧美激情在线| 99久久精品国产观看| 一区二区三区四区亚洲| 欧美天堂亚洲电影院在线播放| 一区二区在线观看视频| 欧美日韩一区视频| 日韩精品一区第一页| 精品久久国产字幕高潮| 国产精品18久久久久久久网站| 国产调教视频一区| 波多野结衣亚洲| 亚洲国产日韩av| 日韩天堂在线观看| 国产不卡高清在线观看视频| 一区精品在线播放| 欧美日韩国产a| 国产一区在线观看视频| 亚洲女与黑人做爰| 日韩一区二区三区在线观看| 国产精品一级二级三级| 亚洲宅男天堂在线观看无病毒| 欧美日韩精品一区二区在线播放 | 91在线播放网址| 一区二区三区在线观看网站| 欧美一级xxx| 国产成a人无v码亚洲福利| 一二三四区精品视频| 26uuu欧美| 欧美亚洲精品一区| 高清久久久久久| 天天影视涩香欲综合网| 国产欧美一区二区在线观看| 欧美日韩国产首页| 成人性色生活片| 日本欧美韩国一区三区| 亚洲欧美综合另类在线卡通| 欧美一级电影网站| 色香蕉成人二区免费| 国内精品久久久久影院色| 一区二区不卡在线播放| 国产欧美一区二区精品性色超碰| 欧美色男人天堂| 成人美女视频在线观看18| 蜜桃av一区二区| 亚洲靠逼com| 中文字幕电影一区| 欧美成人一区二区三区| 欧美专区在线观看一区| 国产精品亚洲专一区二区三区| 午夜精品久久久久久久久久久 | 欧美大胆人体bbbb| 在线精品视频免费播放| 成人国产精品免费网站| 激情综合色丁香一区二区| 亚洲一区二区三区中文字幕在线| 亚洲国产精品激情在线观看| 精品少妇一区二区三区| 欧美丝袜第三区| 91免费国产在线| 成人午夜激情视频| 国产一区二区网址| 久久97超碰色| 日本怡春院一区二区| 亚洲成人一区在线| 一个色综合网站| 亚洲免费视频中文字幕| 国产精品久久久久久久久晋中| 精品国产不卡一区二区三区| 欧美精品一二三区| 欧美三级中文字幕在线观看| 日本久久电影网| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 国产69精品久久99不卡| 国产剧情av麻豆香蕉精品| 国产精品亚洲专一区二区三区 | 极品少妇xxxx偷拍精品少妇| 欧美aⅴ一区二区三区视频| 香蕉加勒比综合久久| 午夜久久福利影院| 天天色天天操综合| 奇米精品一区二区三区在线观看| 全国精品久久少妇| 久久99国产精品久久99 | 爽爽淫人综合网网站| 亚洲国产日日夜夜| 樱桃视频在线观看一区| 亚洲私人黄色宅男| 国产精品久久免费看| 久久无码av三级| 精品国产乱码久久久久久1区2区| 欧美一级二级三级蜜桃| 日韩午夜在线观看视频| 日韩亚洲欧美高清| 欧美一区二区三区小说| 欧美一区二区久久久| 日韩一区二区三区三四区视频在线观看| 欧美一区二区私人影院日本| 欧美高清视频不卡网| 在线不卡免费欧美| 日韩欧美一二区| 精品久久人人做人人爱| 欧美精品一区男女天堂| 国产女人18毛片水真多成人如厕 | 不卡的av在线| 99久久精品国产一区二区三区| 92国产精品观看| 欧美在线视频不卡| 精品视频免费看| 久久蜜桃av一区二区天堂| 日本一区二区电影| 亚洲欧美一区二区三区极速播放 | 久久婷婷成人综合色| 国产日韩欧美精品电影三级在线| 国产精品久久午夜夜伦鲁鲁| 一区2区3区在线看| 麻豆精品久久久| 99精品视频免费在线观看| 欧美三区在线观看| 欧美成人一区二区三区在线观看 | 欧美日本韩国一区二区三区视频 | 午夜视频在线观看一区二区| 日韩电影在线观看一区| 国产一二精品视频| 91丝袜美女网| 777精品伊人久久久久大香线蕉| 久久久亚洲精华液精华液精华液| 国产欧美日韩在线视频| 日本不卡123| 91视频精品在这里| 91精品国产综合久久久蜜臀粉嫩 | 99精品视频在线观看免费| 欧美一区二区三区白人| 国产精品狼人久久影院观看方式| 亚洲一区在线视频观看| 国内精品久久久久影院薰衣草 | 亚洲国产aⅴ天堂久久| 国产主播一区二区三区| 99久久精品国产导航| 久久综合色鬼综合色| 午夜久久久影院| 成人精品视频网站| 欧美一区二区三区在线观看视频| 国产精品久久久久影院老司| 日韩电影在线免费观看| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 久久福利视频一区二区| 99国产欧美另类久久久精品| 欧美精品一区二区久久久| 一区二区三区毛片| 国产激情一区二区三区| 欧美剧情片在线观看| 国产精品乱码久久久久久| 久久国产三级精品| 欧美日韩一区二区在线视频| 国产无人区一区二区三区| 亚洲一区视频在线| 不卡影院免费观看| 日韩视频不卡中文| 亚洲国产日产av| 91丨porny丨国产| 欧美国产综合色视频| 午夜久久久久久久久| 91麻豆高清视频| 中文子幕无线码一区tr| 久久成人羞羞网站| 欧美三级蜜桃2在线观看| 日本一区二区久久| 懂色av噜噜一区二区三区av| 精品久久人人做人人爽| 男女男精品视频网| 欧美日本一区二区在线观看| 亚洲一二三专区| 欧美视频自拍偷拍| 亚洲一区二区三区影院| 在线免费不卡电影| 亚洲制服丝袜一区| 成人avav在线| 一区二区在线观看免费视频播放| 不卡视频一二三四| 国产精品久久久久永久免费观看| 国产精品系列在线播放| 国产性色一区二区| 国产高清久久久久| 欧美激情综合网| 99v久久综合狠狠综合久久| 国产精品日韩精品欧美在线| 国产成人在线视频网址| 中文av一区特黄| 久久爱www久久做| 国产精品灌醉下药二区| 91啪亚洲精品| 亚洲一区二区高清| 6080国产精品一区二区| 另类小说欧美激情| 精品婷婷伊人一区三区三| 日本不卡1234视频| 久久先锋影音av| 不卡一二三区首页|