Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ItemData

[17:7] extends: FxObj

Wraps FXGL's ItemData, the per-item metadata FXGL stores alongside the actual stacks. Exposes the item's display name, description, view Node, total quantity (across all stacks), per-stack cap, and the observable list of stacks. Obtain via Inventory.getData(item) or Inventory.getAllData(). Not user-constructed; FXGL builds ItemData when Inventory.add runs.

Methods

  • ItemData ()

    Empty default constructor; populated by adopt.

  • adopt (object Ajo)

    Wraps an existing ItemData AussomJavaObject.

    • @p Ajo is an AussomJavaObject around an ItemData.
    • @r A new wrapper.
  • getUserItem ()

    Returns the item-key value this data describes.

  • getName ()

    Returns the display name.

  • setName (string Name)

    Sets the display name.

  • getDescription ()

    Returns the description.

  • setDescription (string Description)

    Sets the description.

  • getView ()

    Returns the item's view as an AussomJavaObject around the underlying JavaFX Node.

  • setView (object ViewObj)

    Sets the view Node.

    • @p ViewObj is a fx.Node wrapper.
  • getMaxStackQuantity ()

    Returns the per-stack quantity cap for this item. When the item's total quantity exceeds this value, the items distribute across multiple stacks.

    • @r An int.
  • setMaxStackQuantity (int MaxStackQuantity)

    Sets the per-stack quantity cap.

  • getQuantity ()

    Returns the total quantity across every stack of this item.

    • @r An int.
  • quantityProperty ()

    Returns the underlying IntegerProperty backing the total quantity so callers can bind to it for live UI updates.

    • @r An AussomJavaObject around an IntegerProperty.
  • nameProperty ()

    Returns the underlying StringProperty backing the display name.

    • @r An AussomJavaObject around a StringProperty.
  • descriptionProperty ()

    Returns the underlying StringProperty backing the description.

    • @r An AussomJavaObject around a StringProperty.
  • viewProperty ()

    Returns the underlying ObjectProperty backing the view Node.

    • @r An AussomJavaObject around an ObjectProperty.
  • stacks ()

    Returns the underlying observable list of stacks for this item.

    • @r An AussomJavaObject around an ObservableList.
  • getStacks ()

    Returns the live ObservableList of ItemStack entries for this item. Same data as stacks() but matches the Java getter name for callers that already use the bean-style accessor.

  • setUserItem (object Value)

    Replaces the user-item key that owns these stacks. Pass any value matching the inventory's item type (typically a string or enum AJO).