GameTools gameScreen

From Wikiid
Revision as of 21:42, 23 October 2007 by SteveBaker (Talk | contribs) (New page: Most applications can get by with calling ''initScreen()'' with the title of the game as a parameter, then ''updateScreen()'' once per frame to swap the double-buffers. ''getMouse()'' ret...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Most applications can get by with calling initScreen() with the title of the game as a parameter, then updateScreen() once per frame to swap the double-buffers. getMouse() returns a pointer to a gameMouse structure that contains the current mouse data and getScreen() returns the current screen settings (which you can modify) as a gameScreen pointer:

 void   initScreen ( const char *title ) ;
 void updateScreen () ;
 gameScreen *getScreen () ;
 gameMouse   *getMouse () ;


The gameMouse structure is returned from getMouse() and contains the current position of the cursor, the amount by which it moved this frame and the state of the buttons (use buttons & (1<<PW_LEFT_BUTTON) to query the left mouse button, PW_MIDDLE_BUTTON and PW_RIGHT_BUTTON being the other two):

 struct gameMouse
   int  x ;  // Current mouse position
   int  y ;
   int dx ;  // Amount moved this frame
   int dy ;
   unsigned int buttons ;          // Which buttons are currently pressed down
   unsigned int lastButtons ;      // Which buttons were previously pressed down
   unsigned int justDownButtons ;  // Which buttons were just pressed
   unsigned int justUpButtons ;    // Which buttons were just released
 } ;


The gameScreen class is created for you inside initScreen(). You can use it to read the most recent keystroke (getKeyStroke()) or to test whether a particular key is being held down right now (isKeyDown()) - and also to set and get the screen dimensions:

 class gameScreen
   bool isKeyDown       ( int k ) ;
   int  getKeyStroke    () ;
   void setScreenSize   ( int w, int h ) ;
   int  getScreenWidth  () ;
   int  getScreenHeight () ;
 } ;

Wikiid Pages relating to gameTools (edit)
gameTools - Main page
gameTools - Support Tools :
plb_to_ac3d, mklevel, mktile, mktree, tiled, autogen_java, mk3dgallery
gameTools - File Formats :
title_screen.rgb, ultimate.xml, material.xml, decoration.xml, physics.xml
tiled.xml, tiled_autotiles.xml, Level files, Tile naming scheme, PLB files
gameTools - Source Code :
Game functions: gameCamera, gameClock, gameChecksum/gameHashTable, gameHTTP,
gameIsect, gameJoystick, gameParticleManager, gameScreen/gameMouse,
gameSky, gameStarter, gameStrokeFont, gameUtils
Material database: MatList/MatEntry
Tile map handling: TileObject/MapFlag/MapEntry/Map
Java Interfacing: JavaLink
Image file loading: liImage/liImageFactory
3D Model file loading: loadPLB, PLB exporter
Physics: Sabot, Bullet, gameTools - Use with Blender, PLB exporter
Object management: Object

Wikiid Pages relating to Lemur of Lima (edit)
Lemur of Lima - Main page
Lemur of Lima - Controls
Lemur of Lima - Levels :
List of Levels, Level design, Screen shots, Models
Lemur of Lima - Java Plugins :
Java plugin API, Event handling, Flags, GameInterface API , Alphabetical Index
Lemur of Lima - Source Code Documentation :
Initialisation, Main Loop, gameTools