Skip to content

Spritesheet class is broken, in the web Ctx #22

@wkta

Description

@wkta

How to reproduce the bug?
you can use the following file for testing!

tileset

In your source-code (gamedef.py),
use a spritesheet .png without any json information tied to it ,then

Spritesheet = pyv.gfx.Spritesheet 
tileset = Spritesheet(img, 2)  # use upscaling x2
tileset.set_infos((32, 32))
EXIT_TILE_RANK = 24
adhoc_exit_tile = shared.TILESET.image_by_rank(EXIT_TILE_RANK)
# your custom code goes there
...
# then, we blit but we pass a full Rect (4 parameters)
scrref.blit(
    adhoc_exit_tile,
    (potion['position'][0] * shared.CELL_SIDE, potion['position'][1] * shared.CELL_SIDE,
    32, 32)
)

this will crash in web ctx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions