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. | |
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 | |
---|---|
Screen | |
viewport : A pygame Rect whose size is equal to the screen size,
indicating which portion of the world is currently on-screen. |
Class Variable Summary | |
---|---|
tuple |
TILE_SIZE = (300, 300)
|
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)
|
Property Details |
---|
heightThe height of the screen, in pixels.
|
sizeThe size of the screen, in pixels.
|
widthThe width of the screen, in pixels.
|
Instance Variable Details |
---|
Class Variable Details |
---|
TILE_SIZE
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Thu Sep 22 22:52:45 2005 | http://epydoc.sf.net |