Skip to content

Components: ViewportComponent

mrpetro edited this page Mar 6, 2020 · 2 revisions

Associated systems

  • ViewportSystem

Associated components

  • PositionComponent
  • CameraComponent

Purpose

Stores viewport rectangle width and height and camera entity ID.

Entities with ViewportComponent and PositionComponent are processed by ViewportSystem to render assigned camera FOV into viewport. PositionComponent defines center of viewport rectangle in world coordinates.

Viewport entity and Camera entity doesn't need to occupy same world.

Viewport component with camera entity ID set to -1 will not render any camera FOV.

Clone this wiki locally