2010 October 12 / j|d|a|v|i|s|@|c|a|r|l|e|t|o|n|.|e|d|u

WindowJr

Inherits from Window. A window object corresponds to a window on the screen in which drawing takes place. The program begins by creating the window.

__init__(self, width=512, height=512, title="Bopagopa Jr.")

Initializes the window with some default user interface handlers.

getBodies2D(self)

Returns the window's list of 2D bodies, which the user can alter (append, pop, etc.) as desired.

appendBody2D(self, body)

Shortcut for appending a body to the list of 2D bodies.

getBodies3D(self)

Returns the window's list of 3D bodies, which the user can alter (append, pop, etc.) as desired.

appendBody3D(self, body)

Shortcut for appending a body to the list of 2D bodies.

getLights(self)

Returns the window's lights, as a tuple.

setLights(self, lights)

Sets the window's lights to the given tuple.

getCamera(self)

Returns the window's camera.

setAmbientColor(self, rgb)

Sets the ambient light level.

defaultKeyboardHandler(self, xy, key)

Provides some basic viewing controls.

defaultDragHandler2D(self, xyStarting, xyPrevious, xyCurrent, name)

Lets the user drag the 2D bodies around.

defaultClickHandler3D(self, xy, name, xyz)

Translates the focus of the camera.

defaultBeginDragHandler3D(self, xyStarting, xyCurrent, name, xyzStarting)

Prepares for defaultDragHandler3D().

defaultDragHandler3D(self, xyStarting, xyPrevious, xyCurrent, name, xyzStarting)

Following up on defaultBeginDragHandler3D(), lets the user rotate and translate 3D bodies around the scene.