ppb / pursuedpybear

A python game engine.
https://ppb.dev/
Artistic License 2.0
258 stars 98 forks source link

RectangleSprite objects create a Square image as default. #691

Closed pathunstrom closed 7 months ago

pathunstrom commented 9 months ago

Probably need to special case our default asset creation to create an appropriately shaped rectangle instead of a square.

Sample code:

import ppb

class Platform(ppb.RectangleSprite):
    pass

def setup(scene):
    scene.add(Platform(width=3, height=1, position=ppb.Vector(0, -5)))

We end up with a square of size 3 instead of a rectangle with a 3:1 aspect ratio.

image

What it should look like:

image

Noting, this currently gets set in the asset (https://github.com/ppb/pursuedpybear/blob/canon/ppb/systems/renderer.py#L93-L107) and would require some refactoring to make it possible to contextually choose the asset definition.

davidism commented 7 months ago

I'm working on this at the PyCascades 2024 sprint!