Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GenericBarViewComponent

[15:7] extends: ChildViewComponent

Wraps FXGL's GenericBarViewComponent (com.almasb.fxgl.dsl.components.view.GenericBarViewComponent), a ChildViewComponent that draws a configurable bar (HP, mana, energy) attached to the entity. The bar widget can be retrieved via getBar() for custom styling.

Methods

  • GenericBarViewComponent (double X = 0.0, double Y = 0.0, object ColorObj = null, double InitialValue = 0.0, double MaxValue = 100.0, double Width = 100.0, double Height = 10.0)

    Creates a new GenericBarViewComponent.

    • @p X is the X offset from the entity origin.
    • @p Y is the Y offset from the entity origin.
    • @p ColorObj is a javafx.scene.paint.Color AJO.
    • @p InitialValue is the starting bar value.
    • @p MaxValue is the bar maximum (defaults to InitialValue).
    • @p Width is the bar width in pixels.
    • @p Height is the bar height in pixels.
  • adopt (object Ajo)

    Wraps an existing GenericBarViewComponent AussomJavaObject.

  • getBar ()

    Returns the underlying ProgressBar widget AJO.

  • valueProperty ()

    Returns the bar value DoubleProperty.

  • maxValueProperty ()

    Returns the bar max-value DoubleProperty.