Skip to content

GraphicsAPI reference

Class Art

Namespace: MicroEngine.Graphics
Assembly: MicroEngine.Graphics2D.dll
Guide: Graphics

Deterministic helpers for procedural pixel art: hash noise, ordered dithering and palette ramps. Every sample game builds its sprites and tiles from these at load time.

C#
public static class Art

Inheritance

object ← Art

Methods

Dither(int, int, float)

Ordered (Bayer 4x4) dither: true when level (0..1) exceeds the threshold at x,y.

C#
public static bool Dither(int x, int y, float level)

Parameters

x int

y int

level float

Returns

bool

Hash(int, int, int)

Stable pseudo-random value in 0..1 for integer coordinates and a seed.

C#
public static float Hash(int x, int y, int seed = 0)

Parameters

x int

y int

seed int

Returns

float

Palette(params string[])

Builds a palette dictionary from “char=#hex” pairs, e.g. Palette(“a=#000000”, “b=#ffffff”).

C#
public static Dictionary<char, Color> Palette(params string[] entries)

Parameters

entries string[]

Returns

Dictionary<char, Color>

Ramp(IReadOnlyList<Color>, float, int, int)

Picks a ramp entry for a 0..1 value with dithered transitions between steps.

C#
public static Color Ramp(IReadOnlyList<Color> ramp, float value, int x, int y)

Parameters

ramp IReadOnlyList<Color>

value float

x int

y int

Returns

Color

ValueNoise(float, float, float, int)

Smooth value noise in 0..1 with the given cell size.

C#
public static float ValueNoise(float x, float y, float cell, int seed = 0)

Parameters

x float

y float

cell float

seed int

Returns

float