reports a list of all pixels in the given costume. Each pixel is represented by a 4-item sublist of RGBA values
pixelsname pixels width heightwidthheightcostume var i, pixels = [], src = costume.contents.getContext('2d').getImageData( 0, 0, costume.width(), costume.height() ); for (i = 0; i < src.data.length; i += 4) { pixels.push(new List([ src.data[i], src.data[i + 1], src.data[i + 2], src.data[i + 3] ])); } return new List(pixels);
overwrite the pixels in the given costume with another list of pixels. Caution! This operation directly changes the costume. Make sure to use a copy in case you would like to revert changes later.
reports the sprite's actual current costume, which may or may not be part of its wardrobe e.g. if it is a copy
reports a copy of the given costume. This is especially useful when modifying a costume, so you can keep the original around
display the given bitmap in a copy of the current costume (so you can switch back to the original costume again)
takes a snapshot with the webcam and reports it as a new costume, or zero if the user cancels