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).
public sealed record AppIdentity : IEquatable<AppIdentity>Inheritance
Implements
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).
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.
public static readonly Color DefaultBackgroundField Value
IconResource
Name of the embedded PNG resource holding the icon.
public const string IconResource = "MicroEngine.AppIcon.png"Field Value
SplashImageResource
Name of the embedded PNG resource holding the start screen’s image (MicroEngineSplashImage).
public const string SplashImageResource = "MicroEngine.SplashImage.png"Field Value
Properties
Icon
The game’s icon, decoded from the assembly; null when the project declares none.
public PixelImage? Icon { get; init; }Property Value
Id
public string? Id { get; init; }Property Value
Orientation
public AppOrientation Orientation { get; init; }Property Value
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.
public bool Splash { get; init; }Property Value
SplashBackground
The start screen’s background (MicroEngineSplashColor); null: EdgeColor of the image.
public Color? SplashBackground { get; init; }Property Value
SplashBranding
Whether the start screen says “Made with MicroEngine” (MicroEngineSplashBranding, false by default).
public bool SplashBranding { get; init; }Property Value
SplashColor
The start screen’s background colour: SplashBackground, else the edge of its image, else near black.
public Color SplashColor { get; }Property Value
SplashImage
The image the start screen shows: SplashImageOverride, else the icon (null when there is neither).
public PixelImage? SplashImage { get; }Property Value
SplashImageOverride
The start screen’s own image (MicroEngineSplashImage); null: the icon.
public PixelImage? SplashImageOverride { get; init; }Property Value
Title
public string Title { get; init; }Property Value
Version
public string Version { get; init; }Property Value
Methods
<Clone>$()
public AppIdentity <Clone>$()Returns
Deconstruct(out string, out string?, out string, out AppOrientation)
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.
public static Color EdgeColor(PixelImage image)Parameters
image PixelImage
Returns
Equals(object?)
public override bool Equals(object? obj)Parameters
obj object?
Returns
Equals(AppIdentity?)
public bool Equals(AppIdentity? other)Parameters
other AppIdentity?
Returns
GetHashCode()
public override int GetHashCode()Returns
Of(Game)
The identity of the assembly that defines game’s type.
public static AppIdentity? Of(Game game)Parameters
game Game
Returns
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.
public static AppIdentity? Of(Assembly assembly)Parameters
assembly Assembly
Returns
ToString()
public override string ToString()Returns
Operators
operator ==(AppIdentity?, AppIdentity?)
public static bool operator ==(AppIdentity? left, AppIdentity? right)Parameters
left AppIdentity?
right AppIdentity?
Returns
operator !=(AppIdentity?, AppIdentity?)
public static bool operator !=(AppIdentity? left, AppIdentity? right)Parameters
left AppIdentity?
right AppIdentity?