Class StatsView

All Implemented Interfaces:
HasLocalTransform, CloneableSmartAsset, Collidable, Savable, Control, JmeCloneable, Cloneable

public class StatsView extends Node implements Control, JmeCloneable
The StatsView provides a heads-up display (HUD) of various statistics of rendering. The data is retrieved every frame from a Statistics and then displayed on screen.

To use the stats view, you need to retrieve the Statistics from the Renderer used by the application. Then, attach the StatsView to the scene graph.

 Statistics stats = renderer.getStatistics();
 StatsView statsView = new StatsView("MyStats", assetManager, stats);
  • Constructor Details

  • Method Details

    • getHeight

      public float getHeight()
    • update

      public void update(float tpf)
      Description copied from interface: Control
      Updates the control. This should not be called from user code.
      Specified by:
      update in interface Control
      tpf - Time per frame.
    • cloneForSpatial

      @Deprecated public Control cloneForSpatial(Spatial spatial)
      Description copied from interface: Control
      Creates a clone of the Control, the given Spatial is the cloned version of the spatial to which this control is attached to.
      Specified by:
      cloneForSpatial in interface Control
      spatial - the Spatial to be controlled by the clone
      A clone of this control for the spatial
    • jmeClone

      public StatsView jmeClone()
      Description copied from class: Spatial
      Called internally by com.jme3.util.clone.Cloner. Do not call directly.
      Specified by:
      jmeClone in interface JmeCloneable
      jmeClone in class Spatial
      a new instance
    • cloneFields

      public void cloneFields(Cloner cloner, Object original)
      Description copied from class: Node
      Called internally by com.jme3.util.clone.Cloner. Do not call directly.
      Specified by:
      cloneFields in interface JmeCloneable
      cloneFields in class Node
      cloner - The cloner that is performing the cloning operation. The cloneFields method can call back into the cloner to make clones of its subordinate fields.
      original - The original object from which this object was cloned. This is provided for the very rare case that this object needs to refer to its original for some reason. In general, all of the relevant values should have been transferred during the shallow clone, and this object need only clone what it wants.
    • setSpatial

      public void setSpatial(Spatial spatial)
      Specified by:
      setSpatial in interface Control
      spatial - the spatial to be controlled. This should not be called from user code.
    • setEnabled

      public void setEnabled(boolean enabled)
    • isEnabled

      public boolean isEnabled()
    • render

      public void render(RenderManager rm, ViewPort vp)
      Description copied from interface: Control
      Should be called prior to queuing the spatial by the RenderManager. This should not be called from user code.
      Specified by:
      render in interface Control
      rm - the caller (not null)
      vp - the relevant ViewPort (not null)