change sprite.hide() : now disables sprite instead of moving it offscreen.

added sprite.show() to re-enable it (with z-order 3, as all sprites have by default in this module)
added sprite.zdepth() to set a custom z-depth.
This commit is contained in:
Irmen de Jong 2024-08-27 19:58:44 +02:00
parent 2da35fec17
commit b36e1e3baf

View File

@ -138,7 +138,15 @@ sprites {
} }
sub hide(ubyte spritenum) { sub hide(ubyte spritenum) {
pos(spritenum, -64, -64) cx16.vpoke_and(1, VERA_SPRITEREGS + 6 + spritenum*$0008, %11110011)
}
sub show(ubyte spritenum) {
cx16.vpoke_or(1, VERA_SPRITEREGS + 6 + spritenum*$0008, %00001100)
}
sub zdepth(ubyte spritenum, ubyte depth) {
cx16.vpoke_mask(1, VERA_SPRITEREGS + 6 + spritenum*$0008, %11110011, depth<<2)
} }
sub flipx(ubyte spritenum, bool flipped) { sub flipx(ubyte spritenum, bool flipped) {