Package com.badlogic.gdx.backends.lwjgl3
Class Lwjgl3Window
- java.lang.Object
-
- com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window
-
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
public class Lwjgl3Window extends java.lang.Object implements com.badlogic.gdx.utils.Disposable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseWindow()Closes this window and pauses and disposes the associatedApplicationListener.voiddispose()booleanequals(java.lang.Object obj)voidflash()voidfocusWindow()Brings the window to front and sets input focus.com.badlogic.gdx.ApplicationListenergetListener()intgetPositionX()intgetPositionY()longgetWindowHandle()Lwjgl3WindowListenergetWindowListener()inthashCode()voidiconifyWindow()Minimizes (iconifies) the window.booleanisFocused()booleanisIconified()Whether the window is iconfieidvoidmaximizeWindow()Maximizes the window.voidpostRunnable(java.lang.Runnable runnable)Post aRunnableto this window's event queue.voidrestoreWindow()De-minimizes (de-iconifies) and de-maximizes the window.voidsetIcon(com.badlogic.gdx.graphics.Pixmap... image)Sets the icon that will be used in the window's title bar.voidsetPosition(int x, int y)Sets the position of the window in logical coordinates.voidsetSizeLimits(int minWidth, int minHeight, int maxWidth, int maxHeight)Sets minimum and maximum size limits for the window.voidsetTitle(java.lang.CharSequence title)voidsetVisible(boolean visible)Sets the visibility of the window.voidsetWindowListener(Lwjgl3WindowListener listener)
-
-
-
Method Detail
-
getListener
public com.badlogic.gdx.ApplicationListener getListener()
- Returns:
- the
ApplicationListenerassociated with this window
-
getWindowListener
public Lwjgl3WindowListener getWindowListener()
- Returns:
- the
Lwjgl3WindowListenerset on this window
-
setWindowListener
public void setWindowListener(Lwjgl3WindowListener listener)
-
postRunnable
public void postRunnable(java.lang.Runnable runnable)
Post aRunnableto this window's event queue. Use this if you access statics likeGdx.graphicsin your runnable instead ofApplication.postRunnable(Runnable).
-
setPosition
public void setPosition(int x, int y)Sets the position of the window in logical coordinates. All monitors span a virtual surface together. The coordinates are relative to the first monitor in the virtual surface.
-
getPositionX
public int getPositionX()
- Returns:
- the window position in logical coordinates. All monitors span a virtual surface together. The coordinates are relative to the first monitor in the virtual surface.
-
getPositionY
public int getPositionY()
- Returns:
- the window position in logical coordinates. All monitors span a virtual surface together. The coordinates are relative to the first monitor in the virtual surface.
-
setVisible
public void setVisible(boolean visible)
Sets the visibility of the window. Invisible windows will still call theirApplicationListener
-
closeWindow
public void closeWindow()
Closes this window and pauses and disposes the associatedApplicationListener.
-
iconifyWindow
public void iconifyWindow()
Minimizes (iconifies) the window. Iconified windows do not call theirApplicationListeneruntil the window is restored.
-
isIconified
public boolean isIconified()
Whether the window is iconfieid
-
restoreWindow
public void restoreWindow()
De-minimizes (de-iconifies) and de-maximizes the window.
-
maximizeWindow
public void maximizeWindow()
Maximizes the window.
-
focusWindow
public void focusWindow()
Brings the window to front and sets input focus. The window should already be visible and not iconified.
-
isFocused
public boolean isFocused()
-
setIcon
public void setIcon(com.badlogic.gdx.graphics.Pixmap... image)
Sets the icon that will be used in the window's title bar. Has no effect in macOS, which doesn't use window icons.- Parameters:
image- One or more images. The one closest to the system's desired size will be scaled. Good sizes include 16x16, 32x32 and 48x48. Pixmap formatRGBA8888is preferred so the images will not have to be copied and converted. The chosen image is copied, and the provided Pixmaps are not disposed.
-
setTitle
public void setTitle(java.lang.CharSequence title)
-
setSizeLimits
public void setSizeLimits(int minWidth, int minHeight, int maxWidth, int maxHeight)Sets minimum and maximum size limits for the window. If the window is full screen or not resizable, these limits are ignored. Use -1 to indicate an unrestricted dimension.
-
getWindowHandle
public long getWindowHandle()
-
dispose
public void dispose()
- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
flash
public void flash()
-
-