An entity that renders a graphical source, such as an image, to the display.
A TrueType font that can render text.
References a bitmap that can be rendered by a Drawable.
An enum to specify which rendering backend to use.
- def init(render_backend=RenderBackend.GL, render_context=0)
Depending on the RenderBackend used you may need to pass in relevant context information. This is platform specific. For OpenGL make sure the context is currently bound when you call this function and pass NULL to render_context.
>>> import pygame >>> from pygame.locals import * >>> screen = pygame.display.set_mode((800, 600), HWSURFACE|OPENGL|DOUBLEBUF) >>> lib2d.init(RenderBackend.GL) >>> lib2d.viewport(800, 600)
- def shutdown()
Releases all resources created by lib2d.
>>> lib2d.init() >>> # game code ... >>> lib2d.shutdown()
- def viewport(width, height)
Informs lib2d of the current viewport size.
This should be kept up to date with the size of the window or surface you are rendering to.
- def render()
Executes all draw commands issued since the last call to this function.