An entity that renders a graphical source, such as an image, to the display.
- def __init__(self, image=None, x=0, y=0, w=0, h=0, color=0xffffffff)
If an image is passed when creating a drawable, width and height are set to match the image's size if not given explicitly.
- def draw(self)
The current state at the time of calling this function is what will be used when rendering. So it's possible to call draw, change this drawable's state, and call draw again to render in its new state.
# This will render the same green square at two locations. >>> lib2d.init() >>> d = lib2d.Drawable(x=100, y=0, w=100, h=100, color=0x00ff00ff) >>> d.draw() >>> d.y = 100 >>> d.draw()
How many pixels from the left of the screen to render.
How many pixels down from the top of the screen to render.
Width of this drawable.
Height of this drawable.
Multiplies each pixel value of the referenced image by this color (format: