Use Icons

Use Icons

Leader equipment icons

Goal

  • Render item/skill/status icons using the built‑in <Icon> component, which reads the engine’s icon sheet and crops the correct region automatically.

What you’ll build

  • A small list that shows the current party leader’s equipped weapon/armor icons, and an arbitrary icon index example.

  1. Import and show an icon by index

  1. Show the leader’s equipment icons

Notes

  • <Icon> determines the icon sheet path via platform.gameInfo.getIconPath() and selects the correct sprite rectangle using platform.gameInfo.iconImageSize.getIconSprite(index).

  • Control size with Tailwind classes (w-6 h-6, w-8 h-8, etc.). The component preserves pixel‑perfect cropping by rendering through <ImageViewport>.

  • You can use any valid icon index from database items/skills/states, e.g., $dataItems[ID].iconIndex inside UI code when that data is in scope.

See also

Last updated