function setTilesheet(target, tilesheet) {
	target.ox = 0;
	target.oy = 0;

	if (tilesheet._isImageWrapper) {
		// Image Wrapper (for tool)
		tilesheet = tilesheet.asset;
	}

	if (tilesheet._isSprite) {
		// Sprite
		target.ox = tilesheet.x;
		target.oy = tilesheet.y;
		target.tilesheet = tilesheet.img;

	} else if (tilesheet._isMap) {
		// Tilemap
		// force redraw if map's texture is not set yet
		if (!tilesheet.texture) tilesheet._prepareTexture();
		target.tilesheet = tilesheet.texture.canvas;

	} else if (tilesheet._isTexture) {
		// Texture
		target.tilesheet = tilesheet.canvas;

	} else if (tilesheet instanceof Image) {
		// Image
		target.tilesheet = tilesheet;

	} else if (tilesheet instanceof HTMLCanvasElement) {
		// Canvas
		target.tilesheet = tilesheet;

	}
}
Set texture palette. The charset sheet is recreated when this method is called.
@param {string[]} palette - palette definition. This is an array of css formated colors.
                   At initialisation it is `['#000000', '#FFFFFF']` and is it is redifined by
                   the default palette in the settings file.