Skip to content

GamePictures

namespace Griff.Runtime;
public sealed class GamePictures

Pictures a running game makes for itself rather than reads from its files, such as the screenshots of its saved games (see SaveGame), drawn by naming them where an image’s path goes: their names start with Mark (“@save/1”). Each frame carries its game’s (see Pictures), and a renderer loads one again whenever it changes.

public IReadOnlyList<string> Names { get; }

The names of every picture, for a test or a look at what’s there.

public ValueTuple<byte[], int> Get(string name)

The PNG called name and a number that changes whenever it does (0, with no PNG, for none).

public static bool IsPicture(string? name)

True if name names one of a game’s pictures rather than a file.

public void Set(string name, byte[]? png)

Gives name the PNG png, replacing what it had; null takes it away.

public const char Mark

What a picture’s name starts with, so no file in Assets is taken for one.