mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
Former-commit-id: 1647fa32ef6894bd7db44f741f07c2f4dcdf9054 Former-commit-id: 0e5810dcfbe1fd59b13e7cabe9f1e93c5542da2d
104 lines
2.9 KiB
Java
104 lines
2.9 KiB
Java
package org.newdawn.slick.gui;
|
|
|
|
import org.lwjgl.input.Cursor;
|
|
import org.newdawn.slick.Font;
|
|
import org.newdawn.slick.Input;
|
|
import org.newdawn.slick.SlickException;
|
|
import org.newdawn.slick.opengl.ImageData;
|
|
|
|
/**
|
|
* The context in which GUI components are created and rendered
|
|
*
|
|
* @author kevin
|
|
*/
|
|
public interface GUIContext {
|
|
|
|
/**
|
|
* Get the input system
|
|
*
|
|
* @return The input system available to this game container
|
|
*/
|
|
public Input getInput();
|
|
|
|
/**
|
|
* Get the accurate system time
|
|
*
|
|
* @return The system time in milliseconds
|
|
*/
|
|
public long getTime();
|
|
|
|
/**
|
|
* Get the width of the standard screen resolution
|
|
*
|
|
* @return The screen width
|
|
*/
|
|
public abstract int getScreenWidth();
|
|
|
|
/**
|
|
* Get the height of the standard screen resolution
|
|
*
|
|
* @return The screen height
|
|
*/
|
|
public abstract int getScreenHeight();
|
|
|
|
/**
|
|
* Get the width of the game canvas
|
|
*
|
|
* @return The width of the game canvas
|
|
*/
|
|
public int getWidth();
|
|
|
|
/**
|
|
* Get the height of the game canvas
|
|
*
|
|
* @return The height of the game canvas
|
|
*/
|
|
public int getHeight();
|
|
|
|
/**
|
|
* Get the default system font
|
|
*
|
|
* @return The default system font
|
|
*/
|
|
public Font getDefaultFont();
|
|
|
|
/**
|
|
* Set the mouse cursor to be displayed - this is a hardware cursor and hence
|
|
* shouldn't have any impact on FPS.
|
|
*
|
|
* @param ref The location of the image to be loaded for the cursor
|
|
* @param hotSpotX The x coordinate of the hotspot within the cursor image
|
|
* @param hotSpotY The y coordinate of the hotspot within the cursor image
|
|
* @throws SlickException Indicates a failure to load the cursor image or create the hardware cursor
|
|
*/
|
|
public abstract void setMouseCursor(String ref, int hotSpotX, int hotSpotY) throws SlickException;
|
|
|
|
/**
|
|
* Set the mouse cursor to be displayed - this is a hardware cursor and hence
|
|
* shouldn't have any impact on FPS.
|
|
*
|
|
* @param data The image data from which the cursor can be construted
|
|
* @param hotSpotX The x coordinate of the hotspot within the cursor image
|
|
* @param hotSpotY The y coordinate of the hotspot within the cursor image
|
|
* @throws SlickException Indicates a failure to load the cursor image or create the hardware cursor
|
|
*/
|
|
public abstract void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException;
|
|
|
|
/**
|
|
* Set the mouse cursor to be displayed - this is a hardware cursor and hence
|
|
* shouldn't have any impact on FPS.
|
|
*
|
|
* @param cursor The cursor to use
|
|
* @param hotSpotX The x coordinate of the hotspot within the cursor image
|
|
* @param hotSpotY The y coordinate of the hotspot within the cursor image
|
|
* @throws SlickException Indicates a failure to load the cursor image or create the hardware cursor
|
|
*/
|
|
public abstract void setMouseCursor(Cursor cursor, int hotSpotX, int hotSpotY) throws SlickException;
|
|
|
|
/**
|
|
* Set the default mouse cursor - i.e. the original cursor before any native
|
|
* cursor was set
|
|
*/
|
|
public abstract void setDefaultMouseCursor();
|
|
}
|