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

📄 usegamemouse.java

📁 Java 3D Game SDK.老外做的.
💻 JAVA
字号:
/* * UseGameMouse.java */package org.java3dgamesdk.samples.II;import org.java3dgamesdk.core.*;import org.java3dgamesdk.core.util.*;/** * This sample application demonstrates how to use the game mouse and to have * an invisible cursor.  * This class has also the GameFrame as super class. * * @author  Norbert Nopper */public class UseGameMouse extends GameFrame {        public static void main(String[] argv) {        // create the object                UseGameMouse useGameMouse = new UseGameMouse();                // create the object and pass the game frame to it ...        RenderSelection renderSelection = new RenderSelection(useGameMouse);        // ... rest is done by the dialog        renderSelection.show();            }    /**     * The game mouse is enabled here and also the cursor is changed as well.     */    protected void initGame() {        // enable the game mouse        gameMouse = true;        // make an invisible cursor        canvas3d.setCursor(GameMouse.CURSOR_TRANSPARENT);    }        /**     * For this sample we do not need the method right now.     *     *@param currentTime the current game time in miliseconds, starting with 0     */    protected void updateGame(long currentTime) {        if(gameKeys[27])            exit();        if(mouseWheel != 0)            System.out.println("Wheel moved: " + mouseWheel);        if(mouseButton[0])            System.out.println("Mouse Button 0 pressed.");        if(mouseButton[1])            System.out.println("Mouse Button 1 pressed.");        if(mouseButton[2])            System.out.println("Mouse Button 2 pressed.");        if(deltaX != 0 || deltaY != 0)            System.out.println("Mouse moved: x " + deltaX + " y " + deltaY);    }        /**     * Whenever a scene has to be rendered, the surface has to be cleaned first.     */    protected void renderGame() {        gc3D.clear();            }        /**     * Set up the old cursor.     */    protected void exitGame() {        // go back to the default cursor        canvas3d.setCursor(GameMouse.CURSOR_DEFAULT);    }        }

⌨️ 快捷键说明

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