?? usegamemouse.java
字號(hào):
/* * 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); } }
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -