Closed atomos-social closed 1 year ago
The kaboom types indicate you can specify a quad in the sprite options (ie: sprite("name", { quad: quad(0, 0, 1, 1) }), which describes
sprite("name", { quad: quad(0, 0, 1, 1) })
The rectangular sub-area of the texture to render
I assume this means quad works like some kind of overflow or clipping in CSS.
quad
quad has no effect (or just scales the sprite) instead of rendering a sub-area.
This was mentioned as a possible solution, but it doesn't seem to work for me
add([sprite("test"]).quad.h *= 0.5
Playground and code:
kaboom() loadSprite("bean", "/sprites/bean.png") add([ // I expected the bean to be cut in half, but I see no visible changes sprite("bean", { quad: quad(0, 0, 0.5, 1) }), pos(center()) ])
Output:
{ "devDependencies": { "typescript": "^5.0.2", "vite": "^4.4.0" }, "dependencies": { "kaboom": "^3000.0.14" } }
edit: added more context
Fixed in 115613a
Expected Behavior
The kaboom types indicate you can specify a quad in the sprite options (ie:
sprite("name", { quad: quad(0, 0, 1, 1) })
, which describesI assume this means
quad
works like some kind of overflow or clipping in CSS.Current Behavior
quad
has no effect (or just scales the sprite) instead of rendering a sub-area.Current Solutions
This was mentioned as a possible solution, but it doesn't seem to work for me
Steps to Reproduce
Playground and code:
Output:
Environment
edit: added more context