Advertisement
otorp2

mA replace pixels in sprite

Apr 27th, 2020
630
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let mySprite = sprites.create(img`
  2.     1 . 2 . 3 .
  3.     . . . . . .
  4.     1 . 2 . 3 .
  5.     . . . . . .
  6.     1 . 2 . 3 .
  7.     . . . . . .
  8. `, SpriteKind.Player)
  9. // mySprite.say("hi", 5000)
  10. let bg = scene.backgroundImage()
  11. bg.drawLine(0, 0, 100, 100, 10)
  12. bg.print("hihi", 100, 100);
  13. for (const sprite of sprites.allOfKind(SpriteKind.Player)) {
  14.     // Replace all pixels with the color 0 (transparent) with 1 (white)
  15.     sprite.image.replace(0, 1)
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement