Libraries.Game.JavaCanvasDisplay Documentation

Inherits from: Libraries.Game.GameDisplay, Libraries.Language.Object, Libraries.Game.DesktopDisplay

Summary

Actions Summary Table

ActionsDescription
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns a CompareResult.
Destroy()This action closes the window.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
FocusWindow()This action asks the operating system to give the main application window the focus.
GetAvailableResolutions()This action will return an array containing all of the screen resolutions available for this machine.
GetConfiguration()This action returns the DesktopConfiguration being used by the GameDisplay.
GetDesktopResolution()This action returns a ScreenResolution object that describes the currently set resolution of the computer's desktop (not the resolution being used by the game).
GetDisplayX()This action returns the screen x coordinate of the DesktopDisplay.
GetDisplayY()This action returns the screen y coordinate of the DesktopDisplay.
GetHashCode()This action gets the hash code for an object.
GetHeight()This action returns the height of the DesktopDisplay.
GetPixelScaleFactor()This action returns the ratio between screen coordinates and pixels.
GetResize()This action returns whether the DesktopDisplay is resizable or not.
GetScreenResolution()This action will return the current screen resolution being used by the game engine.
GetSecondsBetweenFrames()This action tests how many seconds have passed since the last time that the time was updated.
GetWidth()This action returns the width of the DesktopDisplay.
IsActive()This action returns whether or not the DesktopDisplay is the currently active application on the system.
IsCloseRequested()This action determines if the user has tried to close the window by clicking the window's red close button.
IsWindowFocused()This action determines whether or not the main application window has the focus on desktop platforms.
RequestRendering()This action tells the DesktopDisplay to render to the screen.
SetConfiguration(Libraries.Game.ApplicationConfiguration conf)This action sets the DesktopConfiguration being used by the game, which includes data for the screen.
SetDisplayMode(integer width, integer height, boolean fullscreen)This action sets the width and height of the DesktopDisplay, and optionally makes the game full screen.
SetLastTime()This action records the time when the action is called, and stores it.
SetResize(boolean resize)This action sets whether the DesktopDisplay should be resizable or not.
SetScreenResolution(Libraries.Game.ScreenResolution resolution)This action will set the game screen to use the given screen resolution.
SetVSync(boolean vsync)This action sets vSync on or off for the DesktopDisplay.
SetupDisplay()This action initializes the JavaCanvasDisplay.
Update()This action updates the game screen without polling the input.
UpdateBuffer()This action forces the Game to draw its contents to the DesktopDisplay's internal buffer without drawing them to the screen.
UpdateTime()This action updates the game's timekeeping information.
WasResized()This action returns whether or not the DesktopDisplay has been resized.

Actions Documentation

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns a CompareResult. The compare result is either larger if this hash code is larger than the object passed as a parameter, smaller, or equal.

Example Code

use Libraries.Language.Support.CompareResult
        Object o
        Object t
        CompareResult result = o:Compare(t)

Parameters

Return

Libraries.Language.Support.CompareResult: The Compare result, Smaller, Equal, or Larger.

Destroy()

This action closes the window.

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(t)

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

FocusWindow()

This action asks the operating system to give the main application window the focus. This only works on desktop platforms - on other platforms, this call is ignored.

GetAvailableResolutions()

This action will return an array containing all of the screen resolutions available for this machine.

Return

Libraries.Containers.Array:

GetConfiguration()

This action returns the DesktopConfiguration being used by the GameDisplay.

Return

Libraries.Game.ApplicationConfiguration:

GetDesktopResolution()

This action returns a ScreenResolution object that describes the currently set resolution of the computer's desktop (not the resolution being used by the game).

Return

Libraries.Game.ScreenResolution:

GetDisplayX()

This action returns the screen x coordinate of the DesktopDisplay.

Return

integer:

GetDisplayY()

This action returns the screen y coordinate of the DesktopDisplay.

Return

integer:

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

GetHeight()

This action returns the height of the DesktopDisplay.

Return

integer:

GetPixelScaleFactor()

This action returns the ratio between screen coordinates and pixels.

Return

number:

GetResize()

This action returns whether the DesktopDisplay is resizable or not.

Return

boolean:

GetScreenResolution()

This action will return the current screen resolution being used by the game engine.

Return

Libraries.Game.ScreenResolution:

GetSecondsBetweenFrames()

This action tests how many seconds have passed since the last time that the time was updated.

Return

number:

GetWidth()

This action returns the width of the DesktopDisplay.

Return

integer:

IsActive()

This action returns whether or not the DesktopDisplay is the currently active application on the system.

Return

boolean:

IsCloseRequested()

This action determines if the user has tried to close the window by clicking the window's red close button.

Return

boolean:

IsWindowFocused()

This action determines whether or not the main application window has the focus on desktop platforms. On non-desktop platforms, this always returns false.

Return

boolean:

RequestRendering()

This action tells the DesktopDisplay to render to the screen.

SetConfiguration(Libraries.Game.ApplicationConfiguration conf)

This action sets the DesktopConfiguration being used by the game, which includes data for the screen.

Parameters

SetDisplayMode(integer width, integer height, boolean fullscreen)

This action sets the width and height of the DesktopDisplay, and optionally makes the game full screen.

Parameters

Return

boolean:

SetLastTime()

This action records the time when the action is called, and stores it.

SetResize(boolean resize)

This action sets whether the DesktopDisplay should be resizable or not.

Parameters

SetScreenResolution(Libraries.Game.ScreenResolution resolution)

This action will set the game screen to use the given screen resolution. The resolution should be acquired from one of the actions that provides the usable screen resolutions for this machine, such as GetDesktopResolution or GetAvailableResolutions.

Parameters

SetVSync(boolean vsync)

This action sets vSync on or off for the DesktopDisplay.

Parameters

SetupDisplay()

This action initializes the JavaCanvasDisplay.

Update()

This action updates the game screen without polling the input.

UpdateBuffer()

This action forces the Game to draw its contents to the DesktopDisplay's internal buffer without drawing them to the screen.

UpdateTime()

This action updates the game's timekeeping information.

WasResized()

This action returns whether or not the DesktopDisplay has been resized.

Return

boolean: