AudioAsset
Ease
FastString
FontAsset
NineSlice
PackedSprite
PackedSpriteID
RB
   HardwareSettings
   IRetroBlitGame
RBAsset
Rect2i
ShaderAsset
SoundReference
SpriteGrid
SpriteSheetAsset
TMXMapAsset
   TMXLayer
   TMXLayerLoadState
   TMXObject
   TMXObjectGroup
   TMXProperties
Vector2i

RB.DrawPixelBuffer

Method  -  Static

public static void DrawPixelBuffer(Color32 [] pixels, Vector2i pixelsSize, Vector2i pos)
public static void DrawPixelBuffer(Color32 [] pixels, Vector2i pixelsSize, Vector2i pos, int flags = 0)
public static void DrawPixelBuffer(Color32 [] pixels, Vector2i pixelsSize, Vector2i pos, Vector2i pivot, float rotation)
public static void DrawPixelBuffer(Color32 [] pixels, Vector2i pixelsSize, Vector2i pos, Vector2i pivot, float rotation, int flags = 0)
public static void DrawPixelBuffer(Color32 [] pixels, Vector2i pixelsSize, Rect2i destRect)
public static void DrawPixelBuffer(Color32 [] pixels, Vector2i pixelsSize, Rect2i destRect, int flags = 0)
public static void DrawPixelBuffer(Color32 [] pixels, Vector2i pixelsSize, Rect2i destRect, Vector2i pivot, float rotation)
public static void DrawPixelBuffer(Color32 [] pixels, Vector2i pixelsSize, Rect2i destRect, Vector2i pivot, float rotation, int flags = 0)

Parameters

pixels Color32 [] Pixel array
pixelsSize Vector2i Pixel array dimensions
pos Vector2i Position to draw at
flags int Any combination of flags: RB.FLIP_H, RB.FLIP_V, RB.ROT_90_CW, RB.ROT_180_CW, RB.ROT_270_CW, RB.ROT_90_CCW, RB.ROT_180_CCW, RB.ROT_270_CCW, RB.PIXEL_BUFFER_UNCHANGED
pivot Vector2i Rotation pivot point
rotation float Rotation angle
destRect Rect2i Destination rectangle

Returns

Nothing.

Description

Draw a pixel array with the given pixelsSize dimensions to the display at the given pos. You may also provide destination rectangle, pivot point and rotation.

If the same pixel buffer is used with no changes between calls to DrawPixelBuffer then the flag RB.PIXEL_BUFFER_UNCHANGED should be specified. This flag tells RetroBlit not to re-upload the buffer to the GPU, which improves performance.

Example

void Render()
{
    // Do something with the pixel buffer
    updatePixelBuffer();

    // Draw the pixel buffer
    RB.DrawPixelBuffer(pixelBuffer, new Vector2i(100200), new Vector2i(00));

    // Draw the pixel buffer again at a new location with the pixel data unchanged
    RB.DrawPixelBuffer(pixelBuffer, new Vector2i(100200), new Vector2i(0200), RB.PIXEL_BUFFER_UNCHANGED);
}

See Docs

Features - Pixel Buffers