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

Constructors

this
this(Display container)

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

Members

Functions

draw
void draw()

How the screen should be drawn Drawing of screen components is handled after this method

handleEvent
void handleEvent(SDL_Event event)

How the screen should respond to events Is necessary because it is an event handler

update
void 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

Variables

components
Component[] components;

All the components that the screen contains; components are handled separately from the screen

container
Display container;

The display that contains this screen

Meta