Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epoxy
GitHub Repository: epoxy/proj11
Path: blob/master/SLICK_HOME/src/org/newdawn/slick/gui/GUIContext.java
1457 views
1
package org.newdawn.slick.gui;
2
3
import org.lwjgl.input.Cursor;
4
import org.newdawn.slick.Font;
5
import org.newdawn.slick.Input;
6
import org.newdawn.slick.SlickException;
7
import org.newdawn.slick.opengl.ImageData;
8
9
/**
10
* The context in which GUI components are created and rendered
11
*
12
* @author kevin
13
*/
14
public interface GUIContext {
15
16
/**
17
* Get the input system
18
*
19
* @return The input system available to this game container
20
*/
21
public Input getInput();
22
23
/**
24
* Get the accurate system time
25
*
26
* @return The system time in milliseconds
27
*/
28
public long getTime();
29
30
/**
31
* Get the width of the standard screen resolution
32
*
33
* @return The screen width
34
*/
35
public abstract int getScreenWidth();
36
37
/**
38
* Get the height of the standard screen resolution
39
*
40
* @return The screen height
41
*/
42
public abstract int getScreenHeight();
43
44
/**
45
* Get the width of the game canvas
46
*
47
* @return The width of the game canvas
48
*/
49
public int getWidth();
50
51
/**
52
* Get the height of the game canvas
53
*
54
* @return The height of the game canvas
55
*/
56
public int getHeight();
57
58
/**
59
* Get the default system font
60
*
61
* @return The default system font
62
*/
63
public Font getDefaultFont();
64
65
/**
66
* Set the mouse cursor to be displayed - this is a hardware cursor and hence
67
* shouldn't have any impact on FPS.
68
*
69
* @param ref The location of the image to be loaded for the cursor
70
* @param hotSpotX The x coordinate of the hotspot within the cursor image
71
* @param hotSpotY The y coordinate of the hotspot within the cursor image
72
* @throws SlickException Indicates a failure to load the cursor image or create the hardware cursor
73
*/
74
public abstract void setMouseCursor(String ref, int hotSpotX, int hotSpotY) throws SlickException;
75
76
/**
77
* Set the mouse cursor to be displayed - this is a hardware cursor and hence
78
* shouldn't have any impact on FPS.
79
*
80
* @param data The image data from which the cursor can be construted
81
* @param hotSpotX The x coordinate of the hotspot within the cursor image
82
* @param hotSpotY The y coordinate of the hotspot within the cursor image
83
* @throws SlickException Indicates a failure to load the cursor image or create the hardware cursor
84
*/
85
public abstract void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException;
86
87
/**
88
* Set the mouse cursor to be displayed - this is a hardware cursor and hence
89
* shouldn't have any impact on FPS.
90
*
91
* @param cursor The cursor to use
92
* @param hotSpotX The x coordinate of the hotspot within the cursor image
93
* @param hotSpotY The y coordinate of the hotspot within the cursor image
94
* @throws SlickException Indicates a failure to load the cursor image or create the hardware cursor
95
*/
96
public abstract void setMouseCursor(Cursor cursor, int hotSpotX, int hotSpotY) throws SlickException;
97
98
/**
99
* Set the default mouse cursor - i.e. the original cursor before any native
100
* cursor was set
101
*/
102
public abstract void setDefaultMouseCursor();
103
}
104
105