All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mathiewz.slick.gui.GUIContext Maven / Gradle / Ivy

Go to download

The main purpose of this libraryis to modernize and maintain the slick2D library.

The newest version!
package com.github.mathiewz.slick.gui;

import org.lwjgl.input.Cursor;

import com.github.mathiewz.slick.Font;
import com.github.mathiewz.slick.Input;
import com.github.mathiewz.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
     */
    public abstract void setMouseCursor(String ref, int hotSpotX, int hotSpotY);
    
    /**
     * 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
     */
    public abstract void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY);
    
    /**
     * 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
     */
    public abstract void setMouseCursor(Cursor cursor, int hotSpotX, int hotSpotY);
    
    /**
     * Set the default mouse cursor - i.e. the original cursor before any native
     * cursor was set
     */
    public abstract void setDefaultMouseCursor();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy