Class Context
java.lang.Object
com.spinyowl.legui.system.context.Context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets context data.Gets focused gui.org.joml.Vector2iGets framebuffer size.longGets glfw window.Returns current mouse target component.floatGets pixel ratio.org.joml.Vector2fGets window position.org.joml.Vector2iGets window size.booleanIs debug enabled boolean.booleanReturns window iconified state.voidsetDebugEnabled(boolean debugEnabled) Sets debug enabled.voidsetFocusedGui(Component focusedGui) Sets focused gui.static voidsetFocusedGui(Component toGainFocus, Context context, Frame frame) voidsetFramebufferSize(org.joml.Vector2i framebufferSize) Sets framebuffer size.voidsetIconified(boolean iconified) Used to update state of window (in case of window iconified).voidsetMouseTargetGui(Component mouseTargetGui) Used to update current mouse target component.voidsetPixelRatio(float pixelRatio) Sets pixel ratio.voidsetWindowPosition(org.joml.Vector2f windowPosition) Sets window position.voidsetWindowSize(org.joml.Vector2i windowSize) Sets window size.voidupdate(int targetWidth, int targetHeight, int framebufferWidth, int framebufferHeight, int targetPosX, int targetPosY, boolean iconified) Update.voidUpdate glfw window.
-
Constructor Details
-
Context
public Context(long glfwWindow) Instantiates a new Context.- Parameters:
glfwWindow- the glfw window
-
-
Method Details
-
setFocusedGui
-
isDebugEnabled
public boolean isDebugEnabled()Is debug enabled boolean.- Returns:
- the boolean
-
setDebugEnabled
public void setDebugEnabled(boolean debugEnabled) Sets debug enabled.- Parameters:
debugEnabled- the debug enabled
-
getContextData
Gets context data.- Returns:
- the context data
-
updateGlfwWindow
public void updateGlfwWindow()Update glfw window. -
update
public void update(int targetWidth, int targetHeight, int framebufferWidth, int framebufferHeight, int targetPosX, int targetPosY, boolean iconified) Update.- Parameters:
targetWidth- the target widthtargetHeight- the target heightframebufferWidth- the framebuffer widthframebufferHeight- the framebuffer heighttargetPosX- the target pos xtargetPosY- the target pos yiconified- the iconified
-
getPixelRatio
public float getPixelRatio()Gets pixel ratio.- Returns:
- the pixel ratio
-
setPixelRatio
public void setPixelRatio(float pixelRatio) Sets pixel ratio.- Parameters:
pixelRatio- the pixel ratio
-
getGlfwWindow
public long getGlfwWindow()Gets glfw window.- Returns:
- the glfw window
-
getWindowPosition
public org.joml.Vector2f getWindowPosition()Gets window position.- Returns:
- the window position
-
setWindowPosition
public void setWindowPosition(org.joml.Vector2f windowPosition) Sets window position.- Parameters:
windowPosition- the window position
-
getWindowSize
public org.joml.Vector2i getWindowSize()Gets window size.- Returns:
- the window size
-
setWindowSize
public void setWindowSize(org.joml.Vector2i windowSize) Sets window size.- Parameters:
windowSize- the window size
-
getFramebufferSize
public org.joml.Vector2i getFramebufferSize()Gets framebuffer size.- Returns:
- the framebuffer size
-
setFramebufferSize
public void setFramebufferSize(org.joml.Vector2i framebufferSize) Sets framebuffer size.- Parameters:
framebufferSize- the framebuffer size
-
getFocusedGui
Gets focused gui.- Returns:
- the focused gui
-
setFocusedGui
Sets focused gui.- Parameters:
focusedGui- the focused gui
-
getMouseTargetGui
Returns current mouse target component.- Returns:
- current mouse target component.
-
setMouseTargetGui
Used to update current mouse target component.- Parameters:
mouseTargetGui- new mouse target component.
-
isIconified
public boolean isIconified()Returns window iconified state.- Returns:
- window iconified state.
-
setIconified
public void setIconified(boolean iconified) Used to update state of window (in case of window iconified).- Parameters:
iconified- window state.
-