Package pajammin :: Package display :: Module engine :: Class WorldWidget
[show private | hide private]
[frames | no frames]

Type WorldWidget

object --+
         |
        WorldWidget

Known Subclasses:
EditorLabelWidget, LabelWidget, LineMarker, PointMarker, RectMarker, Sprite, TextMarker

A base class for graphical elements that are displayed relative to world coordinates.
Method Summary
  draw(self, screen, duration, dx, dy)
Draw this widget to the screen.
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
Return hash(x)...
  __new__(T, S, ...)
Return a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
Return repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
Return str(x)...

Instance Variable Summary
  layer: An integer indicating the order in which the widget should be drawn to the screen, relative to other widgets.
  movement_callback: A callback method that should be called whenever the sprite is moved.
NoneType rect: A pygame Rect describing the extent of this widget, in world coordinates.

Method Details

draw(self, screen, duration, dx, dy)

Draw this widget to the screen.
Parameters:
screen - The screen surface.
duration - The amount of time that has elapsed since the last call to draw, in msec.
dx, dy - An offset that should be added to world coordinates to give screen coordinates.
Returns:
A pygame Rect indicating what area of the screen has been modified by this draw operation.

Instance Variable Details

layer

An integer indicating the order in which the widget should be drawn to the screen, relative to other widgets. Widgets with higher layer numbers will be drawn later.

movement_callback

A callback method that should be called whenever the sprite is moved. This is used by the graphics engine to update its grids.

rect

A pygame Rect describing the extent of this widget, in world coordinates. This Rect is used to determine whether or not the widget is currently on the screen. If this is left at its default value of None, then the widget will always be drawn, even if it is off-screen.
Type:
NoneType
Value:
None