Skip to content

KernelAPI reference

Class AppIdentity

Namespace: MicroEngine.Core
Assembly: MicroEngine.dll
Guide: Name, id, version and icon

The application identity a game declares once, in its project file (docs/guide/app-identity.md): ApplicationTitle, ApplicationId, Version, MicroEngineIcon and MicroEngineOrientation. The MicroEngine build targets write it into the game assembly; packaging turns it into each system’s metadata, and platforms read it at run time (application name, window icon, phone orientation).

C#
public sealed record AppIdentity : IEquatable<AppIdentity>

Inheritance

object ← AppIdentity

Implements

IEquatable<AppIdentity>

Constructors

AppIdentity(string, string?, string, AppOrientation)

The application identity a game declares once, in its project file (docs/guide/app-identity.md): ApplicationTitle, ApplicationId, Version, MicroEngineIcon and MicroEngineOrientation. The MicroEngine build targets write it into the game assembly; packaging turns it into each system’s metadata, and platforms read it at run time (application name, window icon, phone orientation).

C#
public AppIdentity(string Title, string? Id, string Version, AppOrientation Orientation)

Parameters

Title string

Id string?

Version string

Orientation AppOrientation

Fields

DefaultBackground

The background used when nothing gives one.

C#
public static readonly Color DefaultBackground

Field Value

Color

IconResource

Name of the embedded PNG resource holding the icon.

C#
public const string IconResource = "MicroEngine.AppIcon.png"

Field Value

string

SplashImageResource

Name of the embedded PNG resource holding the start screen’s image (MicroEngineSplashImage).

C#
public const string SplashImageResource = "MicroEngine.SplashImage.png"

Field Value

string

Properties

Icon

The game’s icon, decoded from the assembly; null when the project declares none.

C#
public PixelImage? Icon { get; init; }

Property Value

PixelImage?

Id

C#
public string? Id { get; init; }

Property Value

string?

Orientation

C#
public AppOrientation Orientation { get; init; }

Property Value

AppOrientation

Splash

Whether the game opens on its start screen (MicroEngineSplash, true by default): the system’s launch screen on phones and the loading screen in browsers show SplashImage on SplashColor, and the engine keeps showing it while the game loads, so no black screen comes before the first frame.

C#
public bool Splash { get; init; }

Property Value

bool

SplashBackground

The start screen’s background (MicroEngineSplashColor); null: EdgeColor of the image.

C#
public Color? SplashBackground { get; init; }

Property Value

Color?

SplashBranding

Whether the start screen says “Made with MicroEngine” (MicroEngineSplashBranding, false by default).

C#
public bool SplashBranding { get; init; }

Property Value

bool

SplashColor

The start screen’s background colour: SplashBackground, else the edge of its image, else near black.

C#
public Color SplashColor { get; }

Property Value

Color

SplashImage

The image the start screen shows: SplashImageOverride, else the icon (null when there is neither).

C#
public PixelImage? SplashImage { get; }

Property Value

PixelImage?

SplashImageOverride

The start screen’s own image (MicroEngineSplashImage); null: the icon.

C#
public PixelImage? SplashImageOverride { get; init; }

Property Value

PixelImage?

Title

C#
public string Title { get; init; }

Property Value

string

Version

C#
public string Version { get; init; }

Property Value

string

Methods

<Clone>$()

C#
public AppIdentity <Clone>$()

Returns

AppIdentity

Deconstruct(out string, out string?, out string, out AppOrientation)

C#
public void Deconstruct(out string Title, out string? Id, out string Version, out AppOrientation Orientation)

Parameters

Title string

Id string?

Version string

Orientation AppOrientation

EdgeColor(PixelImage)

The average opaque colour along an image’s border: a background that continues a full-bleed icon (Android’s adaptive icon, launch screens). Transparent borders give DefaultBackground.

C#
public static Color EdgeColor(PixelImage image)

Parameters

image PixelImage

Returns

Color

Equals(object?)

C#
public override bool Equals(object? obj)

Parameters

obj object?

Returns

bool

Equals(AppIdentity?)

C#
public bool Equals(AppIdentity? other)

Parameters

other AppIdentity?

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

Of(Game)

The identity of the assembly that defines game’s type.

C#
public static AppIdentity? Of(Game game)

Parameters

game Game

Returns

AppIdentity?

Of(Assembly)

Reads the identity the build targets wrote into assembly; null for an assembly built without them (a test or a game that predates them), so callers keep their defaults.

C#
public static AppIdentity? Of(Assembly assembly)

Parameters

assembly Assembly

Returns

AppIdentity?

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(AppIdentity?, AppIdentity?)

C#
public static bool operator ==(AppIdentity? left, AppIdentity? right)

Parameters

left AppIdentity?

right AppIdentity?

Returns

bool

operator !=(AppIdentity?, AppIdentity?)

C#
public static bool operator !=(AppIdentity? left, AppIdentity? right)

Parameters

left AppIdentity?

right AppIdentity?

Returns

bool