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.
public static class ArtInheritance
Methods
Dither(int, int, float)
Ordered (Bayer 4x4) dither: true when level (0..1) exceeds the threshold at x,y.
public static bool Dither(int x, int y, float level)Parameters
x int
y int
level float
Returns
Hash(int, int, int)
Stable pseudo-random value in 0..1 for integer coordinates and a seed.
public static float Hash(int x, int y, int seed = 0)Parameters
x int
y int
seed int
Returns
Palette(params string[])
Builds a palette dictionary from “char=#hex” pairs, e.g. Palette(“a=#000000”, “b=#ffffff”).
public static Dictionary<char, Color> Palette(params string[] entries)Parameters
entries string[]
Returns
Ramp(IReadOnlyList<Color>, float, int, int)
Picks a ramp entry for a 0..1 value with dithered transitions between steps.
public static Color Ramp(IReadOnlyList<Color> ramp, float value, int x, int y)Parameters
ramp IReadOnlyList<Color>
value float
x int
y int
Returns
ValueNoise(float, float, float, int)
Smooth value noise in 0..1 with the given cell size.
public static float ValueNoise(float x, float y, float cell, int seed = 0)Parameters
x float
y float
cell float
seed int