ViewSystem

EntitySystemceramic.ViewSystem (Class)

System responsible for managing and updating the UI view layout.

ViewSystem is automatically created and bound when the first View is instantiated. It handles the layout computation phase during the engine's update cycle, ensuring all views are properly sized and positioned before rendering.

Key responsibilities:

  • Triggers layout computation for all dirty views
  • Ensures layout updates happen at the right time in the frame
  • Manages the global view layout update cycle

The system runs in the late update phase (order 7000) to ensure:

  • All game logic has completed
  • Views can be properly positioned before rendering
  • Layout changes are batched efficiently
See: View The base view class that uses this system, System The base system class

Static Members

ui
shared: ViewSystem

Shared singleton instance of the ViewSystem. Created lazily when first accessed (typically when the first View is created). This ensures the system is only created when UI functionality is actually used.

Instance Members

ui
new(): Void

Create a new ViewSystem. Sets the late update order to 7000 to ensure layout happens after most game logic but before rendering.

Private Members

ui
bind(): Void

Called by View class to ensure the system is created and active. This method exists to trigger the lazy initialization of the shared instance without exposing system internals.

@private Only accessible by ceramic.View


ui
lateUpdate(delta: Float): Void

Called during the late update phase of each frame. Triggers the layout computation for all views that need updating. This ensures all view layouts are computed and applied before rendering.

Name Type Description
delta Float Time elapsed since last frame in seconds

Metadata

Name Parameters
:build tracker.macros.EventsMacro.build()
:autoBuild tracker.macros.EventsMacro.build()
:build ceramic.macros.EntityMacro.buildForCompletion()
:autoBuild ceramic.macros.EntityMacro.buildForCompletion()