Class MainMenuDisplay
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.ui.UIComponent
com.csse3200.game.components.mainmenu.MainMenuDisplay
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
A UI component for displaying the Main menu.
-
Field Summary
FieldsFields inherited from class com.csse3200.game.ui.UIComponent
skin, stage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Called when the component is created.void
dispose()
Called when the component is disposed.void
draw
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draw the renderable.float
Z index controls rendering order within a layer.void
void
void
update()
Called once per frame of the game, and should be used for most component logic.void
void
void
Update the size and position of the leaderboard table based on screen size and fullscreen mode.void
Update the position of login register table.void
Dynamically update the layout of menu buttons based on screen size and mode (fullscreen/windowed).void
void
Methods inherited from class com.csse3200.game.ui.UIComponent
getLayer, setStage
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, render
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.csse3200.game.rendering.Renderable
render
-
Field Details
-
MUSIC
-
-
Constructor Details
-
MainMenuDisplay
public MainMenuDisplay()
-
-
Method Details
-
create
public void create()Called when the component is created. Initializes the main menu UI.- Overrides:
create
in classUIComponent
-
updateMenuButtonLayout
public void updateMenuButtonLayout()Dynamically update the layout of menu buttons based on screen size and mode (fullscreen/windowed). -
setMenuUntouchable
public void setMenuUntouchable() -
setMenuTouchable
public void setMenuTouchable() -
updateTopLeftToggle
public void updateTopLeftToggle() -
updateLoginRegisterTable
public void updateLoginRegisterTable()Update the position of login register table. -
updateLeaderboardTable
public void updateLeaderboardTable()Update the size and position of the leaderboard table based on screen size and fullscreen mode. -
updateToggleWindowButtonTexture
public void updateToggleWindowButtonTexture() -
update
public void update()Description copied from class:Component
Called once per frame of the game, and should be used for most component logic. Not called if component is disabled. -
updateBirdFly
public void updateBirdFly() -
updateDogRun
public void updateDogRun() -
getChatbotUI
-
draw
public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Description copied from class:RenderComponent
Draw the renderable. Should be called only by the renderer, not manually.- Specified by:
draw
in classRenderComponent
- Parameters:
batch
- Batch to render to.
-
getZIndex
public float getZIndex()Description copied from interface:Renderable
Z index controls rendering order within a layer. Higher Z index is drawn on top.- Specified by:
getZIndex
in interfaceRenderable
- Overrides:
getZIndex
in classUIComponent
- Returns:
- Z index
-
dispose
public void dispose()Description copied from class:Component
Called when the component is disposed. Dispose of any internal resources here.- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classRenderComponent
-