Home | Trees | Index | Help |
---|
|
object
--+
|
DisplayEngine
Method Summary | |
---|---|
Create a new platform graphics engine, containing no sprites. | |
Add a widget to the graphics engine. | |
Initialize the graphics engine, and set its background. | |
Remove a widget from the graphics engine. | |
Return the screen position corresponding to the world position worldpos , given the current location of the viewport. | |
Update all on-screen sprites' animations, draw them onto the screen at their current position, and update the display. | |
Return the world position corresponding to the screen position screenpos , given the current location of the viewport. | |
Erase all sprites from the screen (but do not update the display). | |
Update all on-screen sprites' animations, draw them onto the screen at their current position, and update the display. | |
_get_background(self)
| |
_set_background(self,
background_file)
| |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
Return hash(x)... | |
Return a new object with type S, a subtype of T... | |
helper for pickle | |
helper for pickle | |
Return repr(x)... | |
x.__setattr__('name', value) <==> x.name = value | |
Return str(x)... |
Property Summary | |
---|---|
background : The name of the image that should be displayed in the background. | |
height : The height of the screen, in pixels. | |
size : The size of the screen, in pixels. | |
width : The width of the screen, in pixels. |
Instance Variable Summary | |
---|---|
Widgets | |
_screen_widgets : A list of the widgets that should be drawn relative to the screen,
sorted by layer. | |
_world_widgets : A ProximityGrid of the widgets that should be
drawn relative to world coordinates. | |
Screen | |
_screen : The display screen. | |
_screen_size : The size of the screen. | |
viewport : A pygame Rect whose size is equal to the screen size,
indicating which portion of the world is currently on-screen. | |
_dirty_rects : A list of the screen-relative rectangles that were modified by the
last call to _draw() . | |
Background | |
_background_file : The filename of the file containing the current background image. | |
_background : The current background image. |
Class Variable Summary | |
---|---|
tuple |
TILE_SIZE = (300, 300)
|
str |
_background_style = 'center'
|
Method Details |
---|
__init__(self,
width=640,
height=480,
delay_init=False,
background=None)
Create a new platform graphics engine, containing no sprites. If
|
add(self, widget)Add a widget to the graphics engine. This will cause the widget to be displayed whenever its location is on-screen. |
init(self, background_file=None)Initialize the graphics engine, and set its background. |
remove(self, widget)Remove a widget from the graphics engine. This will cause the graphics engine to stop displaying the widget. (It will be erased on the next screen-refresh, such as a call toupdate ).
|
screenpos(self, worldpos)
|
update(self, duration)Update all on-screen sprites' animations, draw them onto the screen at their current position, and update the display. Then erase all sprites, but do not update the display. This ensures that they will be properly erased from their old locations on the next call todraw , before they are drawn in their new
locations.
|
worldpos(self, screenpos)
|
_clear(self)Erase all sprites from the screen (but do not update the display). This should be called afterdraw , but before any sprites
have been moved.
|
_draw(self, duration)Update all on-screen sprites' animations, draw them onto the screen at their current position, and update the display.
|
_get_background(self) |
_set_background(self, background_file) |
Property Details |
---|
backgroundThe name of the image that should be displayed in the background. Ifbackground is set to None , then a default
(solid color) background is used. If the image loaded from the specified
file is not the same size as the screen, then it will be tiled.
|
heightThe height of the screen, in pixels.
|
sizeThe size of the screen, in pixels.
|
widthThe width of the screen, in pixels.
|
Instance Variable Details |
---|
_screen_widgetsA list of the widgets that should be drawn relative to the screen, sorted by layer. |
_world_widgetsAProximityGrid of the widgets that should be
drawn relative to world coordinates.
|
_screenThe display screen. |
_screen_sizeThe size of the screen. |
_background_fileThe filename of the file containing the current background image. |
_backgroundThe current background image. |
Class Variable Details |
---|
TILE_SIZE
|
_background_style
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Thu Sep 22 22:52:45 2005 | http://epydoc.sf.net |