Class Activity

An object that represents an Activity or a Screen or a point in time of the display Draws itself to the screen, can handle events, and can contain components which do the same Adding components to an activity ensures that they will automatically get handled as long as the activity is active

class Activity
  : EventHandler ;

Constructors

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

Fields

NameTypeDescription
components Component[]All the components that the screen contains; components are handled separately from the screen
container DisplayThe display that contains this screen

Methods

NameDescription
draw How the screen should be drawn Drawing of screen components is handled after this method
handleEvent How the screen should respond to events Is necessary because it is an event handler
update What the screen should do every screen update If the renderer is on VSync, update may be called more than once per actual frame Can be treated as the insides of a while(true) loop