Visual¶
Drawing¶
SurfaceDrawing¶
-
class
serge.visual.SurfaceDrawing(width, height, pixel_format=65536)[source]¶ Bases:
serge.visual.DrawingA visual object that renders to a surface.
You can create an instance of this class and then write to its surface or use this as a base class for your own class that will write the surface.
Sprite¶
-
class
serge.visual.Sprite[source]¶ Bases:
serge.visual.DrawingAn object that gets drawn on the screen
FontStore¶
-
class
serge.visual.FontStore[source]¶ Bases:
serge.registry.GeneralStoreA store for fonts
Store¶
-
class
serge.visual.Store[source]¶ Bases:
serge.registry.GeneralStoreStores sprites
-
registerFromFiles(name, path, number, framerate=0, running=False, rectangular=True, angle=0.0, zoom=1.0, start=1, loop=True, one_direction=False, convert_alpha=False)[source]¶ Register a multi cell sprite from a number of files
The path should be a string with a single numerical substitution. We will pass the numbers 1..number to this substitution to find the names of the files.
-
registerItemsFromPattern(pattern, prefix='', w=1, h=1, framerate=0, running=False, rectangular=True, angle=0.0, zoom=1.0, loop=True, one_direction=False, convert_alpha=False)[source]¶ Register all items matching a certain regular expression
The items will be registered as the filename with the extension dropped off. You can optionally specify a prefix to be used to put in front of the registered name.
-
registerMultipleItems(names, path, w, h=1, rectangular=True, angle=0.0, zoom=1.0, one_direction=False, convert_alpha=False)[source]¶ Register a number of sprites from a single image
The image must be a horizontal row of sprites and you must provide a list of names the same size as the row of sprites. Each other sprites will be created.
-
Text¶
-
class
serge.visual.Text(text, colour, font_name='DEFAULT', font_size=12, justify='center', fixed_char_width=None)[source]¶ Bases:
serge.visual.DrawingSome text to display