Bases: object
Renderer that can be updated incrementally
Base class to render a map onto a buffer that is suitable for blitting onto the screen as one surface, rather than a collection of tiles.
The class supports differed rendering, multiple layers, shapes and layering surfaces (usually from sprites) in the map, creating an illusion of depth.
This class works well for maps that operate on a small display and where the map is much larger than the display, but you will get poor performance if the map is smaller than the display.
The buffered renderer must be used with a data class to get tile and shape information. See the data class api in pyscroll.data, or use the built in pytmx support.
Bilts (x, y, layer) tuples to buffer from iterator
center the map on a pixel
Draw the map onto a surface
surfaces may optionally be passed that will be blited onto the surface. this must be a list of tuples containing a layer number, image, and rect in screen coordinates. surfaces will be drawn in order passed, and will be correctly drawn with tiles from a higher layer overlapping the surface.
Totally unoptimized drawing of objects to the map
Blit the tiles and block until the tile queue is empty
Get the tile coordinates that need to be redrawn
redraw the visible portion of the buffer – it is slow.
scroll the background in pixels
Set the size of the map in pixels
Draw tiles in the background
the drawing operations and management of the buffer is handled here. if you are updating more than drawing, then updating here will draw off screen tiles. this will limit expensive tile blits during screen draws. if your draw and update happens every game loop, then you will not benefit from updates, but it won’t hurt either.
Add some tiles to the queue
Bases: pyscroll.pyscroll.BufferedRenderer
Off-screen tiling is handled in a thread
This file contains two data classes for use with pytmx.
alias of LegacyTiledMapData
Bases: pygame.sprite.LayeredUpdates
Layered Group with ability to center sprites and scrolling map
Center the group/map on a pixel
The basemap and all sprites will be realigned to draw correctly. Centering the map will not change the rect of the sprites.
Draw all sprites and map onto the surface
Group.draw(surface): return None Draws all of the member sprites onto the given surface.
create a new tile layer from a shape layer totally not working