Class Component

A component defines something that can be drawn, handle events, and takes up a space on the screen

class Component
  : EventHandler ;

Constructors

NameDescription
this It may be useful for a component to have access to it's containing display

Fields

NameTypeDescription
container DisplayThe display that contains this component

Properties

NameTypeDescription
location[get] AxisAlignedBoundingBox!(int,2)Gets where the component is on the screen

Methods

NameDescription
draw How the component should draw itself on the screen
handleEvent Takes in an SDL event and should define what behaviour should happen for specific events