Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ItemConfig

[19:7] extends: FxObj

Wraps FXGL's ItemConfig, the small data object passed into Inventory.addConfig to describe a new item's display name, description, stack cap, and view Node. The view is rendered by any FXGL inventory list view that displays the inventory's itemsProperty. All four fields are mutable, and all are optional in the underlying Kotlin constructor; defaults are empty strings, Integer.MAX_VALUE for the stack cap, and an empty Group for the view.

Methods

  • ItemConfig (string Name = "", string Description = "", int MaxStackQuantity = 2147483647, ViewObj = null)

    Creates a new ItemConfig with the given fields. Pass null for ViewObj to leave the view as FXGL's default empty Group (suitable for headless tests). Pass a fx.Node wrapper to attach a visual representation.

    • @p Name is the display name.
    • @p Description is the item description.
    • @p MaxStackQuantity is the per-stack cap.
    • @p ViewObj is an optional fx.Node wrapper.
  • adopt (object Ajo)

    Wraps an existing ItemConfig AussomJavaObject.

    • @p Ajo is an AussomJavaObject around an ItemConfig.
    • @r A new wrapper.
  • getName ()

    Returns the configured display name.

  • setName (string Name)

    Sets the display name.

  • getDescription ()

    Returns the configured description.

  • setDescription (string Description)

    Sets the description.

  • getMaxStackQuantity ()

    Returns the per-stack quantity cap.

  • setMaxStackQuantity (int MaxStackQuantity)

    Sets the per-stack quantity cap.

  • getView ()

    Returns the configured view as an AussomJavaObject around the underlying JavaFX Node. Wrap with the appropriate fx.* class to call its methods.

  • setView (object ViewObj)

    Sets the view Node.

    • @p ViewObj is a fx.Node wrapper.