When a RectangleSprite falls back to rendering a default shape instead
of an image, use its dimensions rather than a default square.
This adds a private _file_missing_dimensions tuple to Image, which defaults to (1, 1). RectangleSprite.__image__ sets this to its dimensions so that the default shape is a rectangle instead of a square.
fixes #691
import ppb
class Platform(ppb.RectangleSprite):
pass
class Player(ppb.Sprite):
pass
def setup(scene):
platform = Platform(width=3, height=1, position=ppb.Vector(0, -5))
scene.add(platform)
player = Player()
scene.add(player)
ppb.run(setup)
When a RectangleSprite falls back to rendering a default shape instead of an image, use its dimensions rather than a default square.
This adds a private
_file_missing_dimensions
tuple toImage
, which defaults to(1, 1)
.RectangleSprite.__image__
sets this to its dimensions so that the default shape is a rectangle instead of a square.fixes #691