Class SlotMachineDisplay

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, Renderable, Comparable<Renderable>

public class SlotMachineDisplay extends UIComponent
A 3-reel slot machine UI that lives in the top bar.

Responsibilities:

  • Render a top bar frame with an inner reels area (responsive layout).
  • Handle user click to trigger a spin.
  • Animate continuous scrolling and smooth stop on target indices.
  • Bridge to SlotEngine to compute outcomes and apply effects.
  • Constructor Details

    • SlotMachineDisplay

      public SlotMachineDisplay(SlotMachineArea area)
      Creates a display with a bound SlotMachineArea.
    • SlotMachineDisplay

      public SlotMachineDisplay()
      Creates a display with a default SlotEngine (no area bound).
  • Method Details

    • create

      public void create()
      Initializes UI hierarchy, loads resources, computes sizes, and applies layout.
      Overrides:
      create in class UIComponent
    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Draw pass also detects stage resize and reapplies layout if needed.
      Specified by:
      draw in class RenderComponent
      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 interface Renderable
      Overrides:
      getZIndex in class UIComponent
      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 interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent