/// <summary> /// /// </summary> /// <param name="id"></param> /// <param name="x"></param> /// <param name="y"></param> /// <param name="colorOffset"></param> public void DrawSprite(int id, int x, int y, int colorOffset = 0) { // This only works when the canvas has a reference to the gameChip if (gameChip == null) { return; } var pixelData = gameChip.Sprite(id); if (colorOffset > 0) { var total = pixelData.Length; for (int i = 0; i < total; i++) { pixelData[i] = pixelData[i] + colorOffset; } } // Canvas is reversed, so flip the pixel data SpriteChipUtil.FlipSpriteData(ref pixelData, spriteSize.x, spriteSize.y); SetPixels(x, y, spriteSize.x, spriteSize.y, pixelData); }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <param name="x"></param> /// <param name="y"></param> /// <param name="colorOffset"></param> public void DrawSprite(int id, int x, int y, int colorOffset = 0) { // This only works when the canvas has a reference to the gameChip if (gameChip == null) { return; } MergePixels(x, y, spriteSize.x, spriteSize.y, gameChip.Sprite(id), colorOffset); }