Grease logo

Table Of Contents

Previous topic

grease.geometry – 2D Geometry

Next topic

grease.mode – Modal Framework

This Page

grease – Base Classes

class grease.System[source]

Grease system abstract base class. Systems define behaviorial aspects of a World. All systems must define a step() method that is invoked by the world each timestep. User-defined systems are not required to subclass this class.

See an example system from the tutorial.

set_world(world)[source]

Bind the system to a world

step(dt)[source]

Execute a time step for the system. Must be defined by all system classes.

Parameters:
  • dt (float) – Time since last step invocation
world

The World this system belongs to

class grease.Renderer[source]

Grease renderer abstract base class. Renderers define the presentation of a World. All renderers must define a draw() method that is invoked by the world when the display needs to be redrawn. User-defined renderers are not required to subclass this class.

See an example renderer from the tutorial.

draw()[source]

Issue drawing commands for this renderer. Must be defined for all renderer classes.

set_world(world)[source]

Bind the system to a world

world

The World this renderer belongs to

Other Base Classes

The following other common base classes can be imported from here for convenience: