Skip to content

Inventory UI

Venompool888 edited this page Sep 16, 2026 · 2 revisions

First see: UI

Introduction

Inventory UI utilises libgdx's Scene2D class to render the relevant UI elements such as image buttons.

Key Components

  • InventoryDisplay.Java- Constructs the visual grid of boxes and text on the screen using libGDX Scene2D UI widgets to create the players inventory.
  • InventoryActions.Java- Receives the nextPage UI event and asks InventoryDisplay to change pages. It does not yet implement inventory mutations.
  • InventoryComponent.Java- Stores the players true inventory

Config

All UI skins were used by being added to InventoryUI.atlas, InventoryUI.json, and InventoryUI.png files found in source/core/assets/flat-earth/skin. This is because InventoryUI.json gets loaded as a Skin object which allows libGDX Scene2D UI widgets to use it as a skin/texture.

Usage

Actions

The change page arrow has a listener attached which when pressed triggers an event for InventoryActions to call for the change page method found in InventoryDisplay.

Team 5 integration status — 17 September 2026

In checked remote items 9eb2186, this book is page/grid scaffolding and does not yet render the real consumable quantities or implement consumable use/drop actions. Team 5's separate top-right HUD does display the real stock. Full-book UI remains Team 4's responsibility.

Use the existing InventoryComponent: getConsumableCount, hasConsumable, getGold and consumableInventoryChanged. Do not create duplicate storage or assume a goldChanged event. Future use actions should request ConsumableEffectComponent.tryUse/useConsumable and must not debit inventory separately. See Team 5 contracts. This is an interface handoff, not a claim that the book integration is completed.

Table of Contents

Home

Test Plan

Team 2

Features

Components
Player
Items and Inventory
Enemies
Interactable NPCs
Cutscenes and Dialogue
Music
Bosses
Rooms
Weapons
Abilities & Spells
Game Screens and Areas
Dungeons

Game Engine

Getting Started

Entities and Components

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Terrain

Concurrency & Threading

Settings

Troubleshooting

MacOS Setup Guide

Clone this wiki locally