Skip to content

Resource bar (separated units)

A bar that represents a resource in the game (health, mana, ammo, etc).

Authors and contributors to this experimental extension: D8H, VictrisGames, Entropy.


A bar that represents a resource in the game (health, mana, ammo, etc).

There are ready-to-use resource bars in the asset-store resource bars pack.

Read more...

Tip

Learn how to install new extensions by following a step-by-step guide.

Resource bar (separated units)

A bar that represents a resource in the game (health, mana, ammo, etc).

Object properties

  • Maximum value (🔢 Number, Dimensionless). Default value is 3.
  • Initial value (🔢 Number, Dimensionless). Default value is 3.
  • Unit width (🔢 Number, Distance). How much pixels to show for a value of 1. Default value is 24.
See internal technical details
  • Maximum value is stored as MaxValue (Number). Unit is Dimensionless. Default value is 3.
  • Initial value is stored as InitialValue (Number). Unit is Dimensionless. Default value is 3.
  • Unit width is stored as UnitWidth (Number). Unit is Pixel. Default value is 24.

Object actions

Maximum value
Change the maximum value of the object.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🟰 Operator
  • Parameter 2 (🔢 Number): Value

Technical note: parameter 3 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is TiledUnitsBar::TiledUnitsBar::SetMaxValue.

Value
Change the value of the object.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🟰 Operator
  • Parameter 2 (🔢 Number): Value

Technical note: parameter 3 is an internal parameter handled by GDevelop.

Technical note: this action internal type (in GDevelop JSON) is TiledUnitsBar::TiledUnitsBar::SetValue.

Object conditions

Empty
Check if the bar is empty.

See parameters & details
  • Parameter 0: 👾 Object

Technical note: parameter 1 is an internal parameter handled by GDevelop.

Technical note: this condition internal type (in GDevelop JSON) is TiledUnitsBar::TiledUnitsBar::IsEmpty.

Full
Check if the bar is full.

See parameters & details
  • Parameter 0: 👾 Object

Technical note: parameter 1 is an internal parameter handled by GDevelop.

Technical note: this condition internal type (in GDevelop JSON) is TiledUnitsBar::TiledUnitsBar::IsFull.

Maximum value
Compare the maximum value of the object.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🟰 Relational operator
  • Parameter 2 (🔢 Number): Value to compare

Technical note: parameter 3 is an internal parameter handled by GDevelop.

Technical note: this condition internal type (in GDevelop JSON) is TiledUnitsBar::TiledUnitsBar::MaxValue.

Value
Compare the value of the object.

See parameters & details
  • Parameter 0: 👾 Object
  • Parameter 1: 🟰 Relational operator
  • Parameter 2 (🔢 Number): Value to compare

Technical note: parameter 3 is an internal parameter handled by GDevelop.

Technical note: this condition internal type (in GDevelop JSON) is TiledUnitsBar::TiledUnitsBar::Value.

Object expressions

Expression Description
Object.MaxValue() Return the maximum value of the object.
Object.Value() Return the value of the object.

This page is an auto-generated reference page about the Resource bar (separated units) extension for GDevelop, the open-source, AI-powered, cross-platform game engine designed for everyone. Learn more about all GDevelop extensions here.