Skip to content

GameCore.ClientPlatform ​

ClientAllowedOrientations 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public enum ClientAllowedOrientations

枚举值 ​

  • Portrait = 1
  • PortraitUpsideDown = 2
  • LandscapeLeft = 4
  • LandscapeRight = 8
  • Landscape = 0xC
  • All = 0xF

ClientAndroidScreenMetrics 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientAndroidScreenMetrics : IEquatable<ClientAndroidScreenMetrics>

仅 Android:系统显示器与当前 Activity 窗口配置快照。

构造函数 ​

ClientAndroidScreenMetrics 仅客户端 ​

csharp
public ClientAndroidScreenMetrics()

属性 ​

AndroidDisplayId 仅客户端 ​

csharp
public int AndroidDisplayId { get; init; }

Android 系统显示器 ID,不是 SDL 显示器索引。

ScreenPixelSize 仅客户端 ​

csharp
public ClientPixelSize? ScreenPixelSize { get; init; }

Display.getRealMetrics 上报的显示器像素,包含系统装饰区域;不保证等于面板原生像素。

Xdpi 仅客户端 ​

csharp
public double? Xdpi { get; init; }

厂商上报的横向真实密度 xdpi;缺失或无效时为 null,可能不准确。

Ydpi 仅客户端 ​

csharp
public double? Ydpi { get; init; }

厂商上报的纵向真实密度 ydpi;缺失或无效时为 null,可能不准确。

Density 仅客户端 ​

csharp
public double? Density { get; init; }

当前 Activity 资源的逻辑 density(dp 到 px 的比例),不是物理 PPI。

DensityDpi 仅客户端 ​

csharp
public int? DensityDpi { get; init; }

当前 Activity 的逻辑 densityDpi;用于 UI 缩放,不用于估算英寸。

ScaledDensity 仅客户端 ​

csharp
public double? ScaledDensity { get; init; }

当前 Activity 的字体 scaledDensity;新版 Android 非线性字体缩放不能仅靠该值重现。

WindowSizeDp 仅客户端 ​

csharp
public ClientLogicalSize? WindowSizeDp { get; init; }

Configuration.screenWidthDp/screenHeightDp,描述当前窗口可用配置;分屏时可小于整屏。

SmallestScreenWidthDp 仅客户端 ​

csharp
public int? SmallestScreenWidthDp { get; init; }

Configuration.smallestScreenWidthDp,随窗口配置变化,不是屏幕物理短边。

EstimatedPhysicalSize 仅客户端 ​

csharp
public ClientPhysicalSizeEstimate? EstimatedPhysicalSize { get; }

按系统屏幕像素与 xdpi/ydpi 推算的英寸尺寸;数据无效时为 null,准确度取决于厂商。

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientAndroidScreenMetrics? left, ClientAndroidScreenMetrics? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientAndroidScreenMetrics? left, ClientAndroidScreenMetrics? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientAndroidScreenMetrics? other)

ClientDeviceInfo 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientDeviceInfo : IEquatable<ClientDeviceInfo>

构造函数 ​

ClientDeviceInfo 仅客户端 ​

csharp
public ClientDeviceInfo()

属性 ​

Binary 仅客户端 ​

csharp
public string Binary { get; init; }

Package 仅客户端 ​

csharp
public string? Package { get; init; }

BuildInfo 仅客户端 ​

csharp
public string BuildInfo { get; init; }

BuildInfoHash 仅客户端 ​

csharp
public uint BuildInfoHash { get; init; }

Detail 仅客户端 ​

csharp
public string Detail { get; init; }

FormFactor 仅客户端 ​

csharp
public string FormFactor { get; init; }

AndroidApiLevel 仅客户端 ​

csharp
public int? AndroidApiLevel { get; init; }

DiskFreeBytes 仅客户端 ​

csharp
public ulong DiskFreeBytes { get; init; }

LocalIp 仅客户端 ​

csharp
public string? LocalIp { get; init; }

LocalMac 仅客户端 ​

csharp
public string? LocalMac { get; init; }

GraphicsBackend 仅客户端 ​

csharp
public string? GraphicsBackend { get; init; }

InstancingAvailable 仅客户端 ​

csharp
public bool? InstancingAvailable { get; init; }

引擎当前的实例化支持标志,可能被原生调试开关修改;不等于独立硬件能力。

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientDeviceInfo? left, ClientDeviceInfo? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientDeviceInfo? left, ClientDeviceInfo? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientDeviceInfo? other)

ClientDiagnosticOperation 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public enum ClientDiagnosticOperation

枚举值 ​

  • CaptureCpuProfile = 0
  • NativeMemorySnapshot = 5
  • DumpNativeAllocations = 6
  • DumpNativeAllocationSummary = 7
  • CaptureRenderDoc = 8
  • DumpGpuMemory = 9
  • UploadCpuProfile = 10

ClientDisplayDpi 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientDisplayDpi : IEquatable<ClientDisplayDpi>

显示器横向与纵向每英寸像素数;原生后端可能返回系统缩放或估算值。

  • Display — SDL 显示器索引。
  • HorizontalDpi — 横向 DPI;缺失、非有限或非正数时为 null。
  • VerticalDpi — 纵向 DPI;缺失、非有限或非正数时为 null。

构造函数 ​

ClientDisplayDpi 仅客户端 ​

csharp
public ClientDisplayDpi(int Display, double? HorizontalDpi, double? VerticalDpi)

显示器横向与纵向每英寸像素数;原生后端可能返回系统缩放或估算值。

  • Display — SDL 显示器索引。
  • HorizontalDpi — 横向 DPI;缺失、非有限或非正数时为 null。
  • VerticalDpi — 纵向 DPI;缺失、非有限或非正数时为 null。

属性 ​

Display 仅客户端 ​

csharp
public int Display { get; init; }

SDL 显示器索引。

HorizontalDpi 仅客户端 ​

csharp
public double? HorizontalDpi { get; init; }

横向 DPI;缺失、非有限或非正数时为 null。

VerticalDpi 仅客户端 ​

csharp
public double? VerticalDpi { get; init; }

纵向 DPI;缺失、非有限或非正数时为 null。

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientDisplayDpi? left, ClientDisplayDpi? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientDisplayDpi? left, ClientDisplayDpi? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientDisplayDpi? other)

Deconstruct 仅客户端 ​

csharp
public void Deconstruct(out int Display, out double? HorizontalDpi, out double? VerticalDpi)

ClientDisplayInfo 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientDisplayInfo : IEquatable<ClientDisplayInfo>

构造函数 ​

ClientDisplayInfo 仅客户端 ​

csharp
public ClientDisplayInfo()

属性 ​

Index 仅客户端 ​

csharp
public int Index { get; init; }

Name 仅客户端 ​

csharp
public string Name { get; init; }

Bounds 仅客户端 ​

csharp
public ClientDisplayRectangle? Bounds { get; init; }

WorkArea 仅客户端 ​

csharp
public ClientDisplayRectangle? WorkArea { get; init; }

DesktopMode 仅客户端 ​

csharp
public ClientDisplayMode? DesktopMode { get; init; }

CurrentMode 仅客户端 ​

csharp
public ClientDisplayMode? CurrentMode { get; init; }

Modes 仅客户端 ​

csharp
public ClientDisplayMode[] Modes { get; init; }

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientDisplayInfo? left, ClientDisplayInfo? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientDisplayInfo? left, ClientDisplayInfo? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientDisplayInfo? other)

ClientDisplayMode 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public record ClientDisplayMode

构造函数 ​

ClientDisplayMode 仅客户端 ​

csharp
public ClientDisplayMode(int Width, int Height, int RefreshRate)

ClientDisplayMode 仅客户端 ​

csharp
protected ClientDisplayMode(ClientDisplayMode original)

属性 ​

EqualityContract 仅客户端 ​

csharp
protected virtual Type EqualityContract { get; }

Width 仅客户端 ​

csharp
public int Width { get; init; }

Height 仅客户端 ​

csharp
public int Height { get; init; }

RefreshRate 仅客户端 ​

csharp
public int RefreshRate { get; init; }

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

PrintMembers 仅客户端 ​

csharp
protected virtual bool PrintMembers(StringBuilder builder)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public virtual bool Equals(ClientDisplayMode? other)

Deconstruct 仅客户端 ​

csharp
public void Deconstruct(out int Width, out int Height, out int RefreshRate)

ClientDisplayRectangle 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public record ClientDisplayRectangle

构造函数 ​

ClientDisplayRectangle 仅客户端 ​

csharp
public ClientDisplayRectangle(int X, int Y, int Width, int Height)

ClientDisplayRectangle 仅客户端 ​

csharp
protected ClientDisplayRectangle(ClientDisplayRectangle original)

属性 ​

EqualityContract 仅客户端 ​

csharp
protected virtual Type EqualityContract { get; }

X 仅客户端 ​

csharp
public int X { get; init; }

Y 仅客户端 ​

csharp
public int Y { get; init; }

Width 仅客户端 ​

csharp
public int Width { get; init; }

Height 仅客户端 ​

csharp
public int Height { get; init; }

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

PrintMembers 仅客户端 ​

csharp
protected virtual bool PrintMembers(StringBuilder builder)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public virtual bool Equals(ClientDisplayRectangle? other)

Deconstruct 仅客户端 ​

csharp
public void Deconstruct(out int X, out int Y, out int Width, out int Height)

ClientFileChecksumAlgorithm 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public enum ClientFileChecksumAlgorithm

枚举值 ​

  • Md5
  • Crc32
  • Sha1

ClientFrameTimingInfo 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientFrameTimingInfo : IEquatable<ClientFrameTimingInfo>

构造函数 ​

ClientFrameTimingInfo 仅客户端 ​

csharp
public ClientFrameTimingInfo(int MaximumFps, int LockedFps, int TimeStepClampFps, int BackgroundFps, bool PauseWhenMinimized, float TimeScale, bool? VSync)

属性 ​

MaximumFps 仅客户端 ​

csharp
public int MaximumFps { get; init; }

LockedFps 仅客户端 ​

csharp
public int LockedFps { get; init; }

TimeStepClampFps 仅客户端 ​

csharp
public int TimeStepClampFps { get; init; }

BackgroundFps 仅客户端 ​

csharp
public int BackgroundFps { get; init; }

PauseWhenMinimized 仅客户端 ​

csharp
public bool PauseWhenMinimized { get; init; }

TimeScale 仅客户端 ​

csharp
public float TimeScale { get; init; }

VSync 仅客户端 ​

csharp
public bool? VSync { get; init; }

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientFrameTimingInfo? left, ClientFrameTimingInfo? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientFrameTimingInfo? left, ClientFrameTimingInfo? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientFrameTimingInfo? other)

Deconstruct 仅客户端 ​

csharp
public void Deconstruct(out int MaximumFps, out int LockedFps, out int TimeStepClampFps, out int BackgroundFps, out bool PauseWhenMinimized, out float TimeScale, out bool? VSync)

ClientFrameTimingSetting 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public enum ClientFrameTimingSetting

枚举值 ​

  • MaximumFps
  • LockedFps
  • TimeStepClampFps
  • BackgroundFps
  • PauseWhenMinimized
  • TimeScale
  • VSync

ClientGamepadInfo 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientGamepadInfo : IEquatable<ClientGamepadInfo>

构造函数 ​

ClientGamepadInfo 仅客户端 ​

csharp
public ClientGamepadInfo(int Id, string Name, bool IsController, bool[] Buttons, float[] Axes, int[] Hats)

属性 ​

Id 仅客户端 ​

csharp
public int Id { get; init; }

Name 仅客户端 ​

csharp
public string Name { get; init; }

IsController 仅客户端 ​

csharp
public bool IsController { get; init; }

Buttons 仅客户端 ​

csharp
public bool[] Buttons { get; init; }

Axes 仅客户端 ​

csharp
public float[] Axes { get; init; }

Hats 仅客户端 ​

csharp
public int[] Hats { get; init; }

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientGamepadInfo? left, ClientGamepadInfo? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientGamepadInfo? left, ClientGamepadInfo? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientGamepadInfo? other)

Deconstruct 仅客户端 ​

csharp
public void Deconstruct(out int Id, out string Name, out bool IsController, out bool[] Buttons, out float[] Axes, out int[] Hats)

ClientHomeIndicatorBehavior 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public enum ClientHomeIndicatorBehavior

枚举值 ​

  • Visible
  • HiddenUntilTouch
  • Dimmed

ClientIOSScreenMetrics 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientIOSScreenMetrics : IEquatable<ClientIOSScreenMetrics>

仅 iOS:当前窗口所在 UIScreen 的像素与 point 尺寸快照。

构造函数 ​

ClientIOSScreenMetrics 仅客户端 ​

csharp
public ClientIOSScreenMetrics()

属性 ​

NativePixelSize 仅客户端 ​

csharp
public ClientPixelSize? NativePixelSize { get; init; }

UIScreen.nativeBounds 像素尺寸,坐标轴固定,不随应用方向旋转;不受本应用 Surface 降分辨率影响。

ScreenSizePoints 仅客户端 ​

csharp
public ClientLogicalSize? ScreenSizePoints { get; init; }

UIScreen.bounds 的 point 尺寸;描述整屏,不是分屏应用窗口。

ViewSizePoints 仅客户端 ​

csharp
public ClientLogicalSize? ViewSizePoints { get; init; }

当前应用视图 bounds 的 point 尺寸;分屏时可能小于整屏。

Scale 仅客户端 ​

csharp
public double? Scale { get; init; }

UIScreen.scale,逻辑 point 到默认 backing 像素的比例,不是 DPI。

NativeScale 仅客户端 ​

csharp
public double? NativeScale { get; init; }

UIScreen.nativeScale,屏幕原生像素与 point 的比例;可能不同于 Scale。

EstimatedHorizontalDpi 仅客户端 ​

csharp
public double? EstimatedHorizontalDpi { get; init; }

SDL 根据 iOS 设备型号表或默认比例得到的估算 DPI;外接显示器可能不可用。

EstimatedVerticalDpi 仅客户端 ​

csharp
public double? EstimatedVerticalDpi { get; init; }

SDL 根据 iOS 设备型号表或默认比例得到的估算 DPI;外接显示器可能不可用。

EstimatedPhysicalSize 仅客户端 ​

csharp
public ClientPhysicalSizeEstimate? EstimatedPhysicalSize { get; }

按 nativeBounds 和 SDL 估算 DPI 推算的英寸尺寸;新型号或外接屏可能不准确,无效时为 null。

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientIOSScreenMetrics? left, ClientIOSScreenMetrics? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientIOSScreenMetrics? left, ClientIOSScreenMetrics? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientIOSScreenMetrics? other)

ClientLogicalSize 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientLogicalSize : IEquatable<ClientLogicalSize>

宽高尺寸,可用于 Android dp 或 iOS point;单位由所在属性说明。

  • Width — 逻辑宽度。
  • Height — 逻辑高度。

构造函数 ​

ClientLogicalSize 仅客户端 ​

csharp
public ClientLogicalSize(double Width, double Height)

宽高尺寸,可用于 Android dp 或 iOS point;单位由所在属性说明。

  • Width — 逻辑宽度。
  • Height — 逻辑高度。

属性 ​

Width 仅客户端 ​

csharp
public double Width { get; init; }

逻辑宽度。

Height 仅客户端 ​

csharp
public double Height { get; init; }

逻辑高度。

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientLogicalSize? left, ClientLogicalSize? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientLogicalSize? left, ClientLogicalSize? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientLogicalSize? other)

Deconstruct 仅客户端 ​

csharp
public void Deconstruct(out double Width, out double Height)

ClientNativeDiagnostics 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientNativeDiagnostics : IEquatable<ClientNativeDiagnostics>

构造函数 ​

ClientNativeDiagnostics 仅客户端 ​

csharp
public ClientNativeDiagnostics()

属性 ​

ProcessMemoryBytes 仅客户端 ​

csharp
public ulong ProcessMemoryBytes { get; init; }

NativeAllocatorBytes 仅客户端 ​

csharp
public ulong? NativeAllocatorBytes { get; init; }

NativeParticleEmitters 仅客户端 ​

csharp
public ulong? NativeParticleEmitters { get; init; }

NativeUnits 仅客户端 ​

csharp
public uint? NativeUnits { get; init; }

TickedNativeUnits 仅客户端 ​

csharp
public uint? TickedNativeUnits { get; init; }

ServerCostMilliseconds 仅客户端 ​

csharp
public float? ServerCostMilliseconds { get; init; }

ServerCpuUsage 仅客户端 ​

csharp
public double? ServerCpuUsage { get; init; }

PingThresholdMilliseconds 仅客户端 ​

csharp
public uint? PingThresholdMilliseconds { get; init; }

LargePingThresholdMilliseconds 仅客户端 ​

csharp
public uint? LargePingThresholdMilliseconds { get; init; }

ActiveBones 仅客户端 ​

csharp
public uint? ActiveBones { get; init; }

ActivePrimitives 仅客户端 ​

csharp
public uint? ActivePrimitives { get; init; }

CpuProfilingSupported 仅客户端 ​

csharp
public bool CpuProfilingSupported { get; init; }

AllocatorProfilingSupported 仅客户端 ​

csharp
public bool AllocatorProfilingSupported { get; init; }

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientNativeDiagnostics? left, ClientNativeDiagnostics? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientNativeDiagnostics? left, ClientNativeDiagnostics? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientNativeDiagnostics? other)

ClientOperationResult 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public enum ClientOperationResult

原生请求结果;Accepted 只表示受理,实际尺寸等以变化事件/后续读取为准。

枚举值 ​

  • Applied
  • Accepted
  • Unsupported
  • BlockedByHost
  • InvalidArgument
  • Unavailable
  • Failed
  • Busy

ClientOptionScope 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public enum ClientOptionScope

枚举值 ​

  • Game
  • Device

ClientOptionWriteMode 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public enum ClientOptionWriteMode

枚举值 ​

  • Transient
  • Persisted
  • Default

ClientPhysicalSizeEstimate 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientPhysicalSizeEstimate : IEquatable<ClientPhysicalSizeEstimate>

根据像素与 DPI 推算的物理尺寸,单位为英寸;不保证等于实测值。

  • WidthInches — 所用像素坐标轴上的估算宽度。
  • HeightInches — 所用像素坐标轴上的估算高度。
  • DiagonalInches — 估算对角线英寸数。

构造函数 ​

ClientPhysicalSizeEstimate 仅客户端 ​

csharp
public ClientPhysicalSizeEstimate(double WidthInches, double HeightInches, double DiagonalInches)

根据像素与 DPI 推算的物理尺寸,单位为英寸;不保证等于实测值。

  • WidthInches — 所用像素坐标轴上的估算宽度。
  • HeightInches — 所用像素坐标轴上的估算高度。
  • DiagonalInches — 估算对角线英寸数。

属性 ​

WidthInches 仅客户端 ​

csharp
public double WidthInches { get; init; }

所用像素坐标轴上的估算宽度。

HeightInches 仅客户端 ​

csharp
public double HeightInches { get; init; }

所用像素坐标轴上的估算高度。

DiagonalInches 仅客户端 ​

csharp
public double DiagonalInches { get; init; }

估算对角线英寸数。

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientPhysicalSizeEstimate? left, ClientPhysicalSizeEstimate? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientPhysicalSizeEstimate? left, ClientPhysicalSizeEstimate? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientPhysicalSizeEstimate? other)

Deconstruct 仅客户端 ​

csharp
public void Deconstruct(out double WidthInches, out double HeightInches, out double DiagonalInches)

ClientPixelSize 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public record ClientPixelSize

构造函数 ​

ClientPixelSize 仅客户端 ​

csharp
public ClientPixelSize(int Width, int Height)

ClientPixelSize 仅客户端 ​

csharp
protected ClientPixelSize(ClientPixelSize original)

属性 ​

EqualityContract 仅客户端 ​

csharp
protected virtual Type EqualityContract { get; }

Width 仅客户端 ​

csharp
public int Width { get; init; }

Height 仅客户端 ​

csharp
public int Height { get; init; }

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

PrintMembers 仅客户端 ​

csharp
protected virtual bool PrintMembers(StringBuilder builder)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public virtual bool Equals(ClientPixelSize? other)

Deconstruct 仅客户端 ​

csharp
public void Deconstruct(out int Width, out int Height)

ClientPlatform 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public static class ClientPlatform

客户端原生服务,要求客户端能力版本 9。所有状态仅属于本地客户端。

备注

窗口、帧调度、字体和设备级操作影响进程;渲染细项使用 GameGraph.Rendering.GameRenderSettings。

方法 ​

GetDisplayDpi 仅客户端 ​

csharp
public static ClientDisplayDpi? GetDisplayDpi(int display = 0)

读取 SDL 上报的显示器横向、纵向 DPI。要求客户端能力 9;平台后端不支持时返回 null。

  • display — GetDisplays 返回的显示器索引,从 0 开始。

返回: 显示器 DPI;索引无效或原生查询失败时为 null。

备注

Windows 可能返回系统缩放 DPI;Android 来自厂商上报;iOS 来自型号表或比例估算。都不保证是真实 PPI,不能用 DPR 代替。

GetAndroidScreenMetrics 仅客户端 ​

csharp
public static ClientAndroidScreenMetrics? GetAndroidScreenMetrics()

仅 Android:读取所在显示器的系统像素、xdpi/ydpi、density 和当前窗口 dp 配置。要求客户端能力 9。

返回: Android 屏幕快照;其它平台、Activity 或显示器不可用时为 null。

备注

屏幕像素来自 Display.getRealMetrics,不读取被主动缩小的渲染 Surface;系统分辨率覆盖及厂商错误 DPI 仍会影响物理尺寸估算。

GetIOSScreenMetrics 仅客户端 ​

csharp
public static ClientIOSScreenMetrics? GetIOSScreenMetrics()

仅 iOS:读取当前 SDL 窗口所在 UIScreen 的原生像素、屏幕与应用视图 point 尺寸、scale/nativeScale 和估算 DPI。要求客户端能力 9。

返回: iOS 屏幕快照;其它平台或窗口不可用时为 null。

备注

NativePixelSize 使用 UIScreen.nativeBounds 的固定坐标轴,不随旋转切换长宽;ScreenSizePoints 和 ViewSizePoints 使用当前方向。DPI 来自 SDL 型号表或比例估算,并非实测。

GetDisplays 仅客户端 ​

csharp
public static ClientDisplayInfo[] GetDisplays()

显示器及 SDL 支持的模式列表;保留刷新率。移动端列表不代表可任意切换的 Surface。

GetWindow 仅客户端 ​

csharp
public static ClientWindowInfo? GetWindow()

GetSurface 仅客户端 ​

csharp
public static ClientSurfaceInfo? GetSurface()

默认应用 Surface、当前渲染像素和窗口尺寸;默认尺寸不承诺等于面板物理像素。

SetWindowMode 仅客户端 ​

csharp
public static ClientOperationResult SetWindowMode(int width, int height, ClientWindowMode mode, int display = 0, int refreshRate = 0)

SetFullscreen 仅客户端 ​

csharp
public static ClientOperationResult SetFullscreen(bool fullscreen)

ApplyWindowMode 仅客户端 ​

csharp
public static ClientOperationResult ApplyWindowMode()

ShowWindow 仅客户端 ​

csharp
public static ClientOperationResult ShowWindow()

HideWindow 仅客户端 ​

csharp
public static ClientOperationResult HideWindow()

RaiseWindow 仅客户端 ​

csharp
public static ClientOperationResult RaiseWindow()

MinimizeWindow 仅客户端 ​

csharp
public static ClientOperationResult MinimizeWindow()

MaximizeWindow 仅客户端 ​

csharp
public static ClientOperationResult MaximizeWindow()

RestoreWindow 仅客户端 ​

csharp
public static ClientOperationResult RestoreWindow()

SetWindowPosition 仅客户端 ​

csharp
public static ClientOperationResult SetWindowPosition(int x, int y)

SetWindowAspectRatio 仅客户端 ​

csharp
public static ClientOperationResult SetWindowAspectRatio(int width, int height)

设为 0,0 清除宽高比约束。

SetWindowMinimumSize 仅客户端 ​

csharp
public static ClientOperationResult SetWindowMinimumSize(int width, int height)

SetWindowMaximumSize 仅客户端 ​

csharp
public static ClientOperationResult SetWindowMaximumSize(int width, int height)

SetWindowResizable 仅客户端 ​

csharp
public static ClientOperationResult SetWindowResizable(bool resizable)

SetSurfaceSize 仅客户端 ​

csharp
public static ClientOperationResult SetSurfaceSize(int width, int height)

移动端请求渲染像素尺寸;iOS 保持窗口宽高比,最终尺寸以 resize 后读取为准。

RestoreDefaultSurface 仅客户端 ​

csharp
public static ClientOperationResult RestoreDefaultSurface()

恢复系统布局和默认 backing scale,旋转/分屏后重新跟随当前窗口。

RequestOrientation 仅客户端 ​

csharp
public static ClientOperationResult RequestOrientation(ClientScreenDirection direction)

SetAllowedOrientations 仅客户端 ​

csharp
public static ClientOperationResult SetAllowedOrientations(ClientAllowedOrientations directions)

允许的屏幕方向集合;Android 支持单方向、双横屏、双竖屏或全部方向,其它组合返回 Unsupported。最终方向受宿主和系统限制。

SetHomeIndicator 仅客户端 ​

csharp
public static ClientOperationResult SetHomeIndicator(ClientHomeIndicatorBehavior behavior)

GetFrameTiming 仅客户端 ​

csharp
public static ClientFrameTimingInfo? GetFrameTiming()

SetFrameTiming 仅客户端 ​

csharp
public static ClientOperationResult SetFrameTiming(ClientFrameTimingSetting setting, double value)

修改进程级客户端调度。TimeStepClampFps 限制过大的帧时间步;TimeScale 不改变服务器模拟。

GetDeviceInfo 仅客户端 ​

csharp
public static ClientDeviceInfo? GetDeviceInfo()

GetDiagnostics 仅客户端 ​

csharp
public static ClientNativeDiagnostics? GetDiagnostics()

即时原生诊断;null 字段代表未采集或不支持,不将旧原生单位统计当成托管实体数。

RequestDiagnostic 仅客户端 ​

csharp
public static ClientOperationResult RequestDiagnostic(ClientDiagnosticOperation operation, string name = "")

请求原生诊断操作。采集受原生编译开关限制。

ProfileCpuBlock 仅客户端 ​

csharp
public static ClientOperationResult ProfileCpuBlock(string name, Action action)

同步执行并配对采集原生 CPU 块,回调不能为 async void。不支持采集时仍执行 action。

ProfileNativeMemoryBlock 仅客户端 ​

csharp
public static ClientOperationResult ProfileNativeMemoryBlock(string name, Action action)

同步执行并配对采集原生分配块,回调不能为 async void。不支持采集时仍执行 action。

GetFileChecksum 仅客户端 ​

csharp
public static string? GetFileChecksum(string path, ClientFileChecksumAlgorithm algorithm, bool raw = false)

引擎 File 读取的校验值。raw=false 尝试解混淆;CRC32 返回无符号十进制文本。失败/不支持返回 null。

GetResourceChecksum 仅客户端 ​

csharp
public static string? GetResourceChecksum(string path, ClientFileChecksumAlgorithm algorithm)

通过当前游戏 ResourceCache 读取逻辑资源(包括资源包)并计算校验值;不表示包文件的原始字节校验。

GetGamepads 仅客户端 ​

csharp
public static ClientGamepadInfo[] GetGamepads()

ReloadFontMap 仅客户端 ​

csharp
public static ClientOperationResult ReloadFontMap()

RequestExit 仅客户端 ​

csharp
public static ClientOperationResult RequestExit(bool embeddedSdk = false)

CreateProjectShortcut 仅客户端 ​

csharp
public static ClientOperationResult CreateProjectShortcut()

SendTelemetry 仅客户端 ​

csharp
public static ClientOperationResult SendTelemetry(string eventName, IReadOnlyDictionary<string, object?> fields, bool error = false)

RecordStage 仅客户端 ​

csharp
public static ClientOperationResult RecordStage(string key, string name = "", ClientStageOperation operation = ClientStageOperation.Mark)

SetLagThresholds 仅客户端 ​

csharp
public static ClientOperationResult SetLagThresholds(uint pingMilliseconds, uint largePingMilliseconds)

GetOption 仅客户端 ​

csharp
public static JsonElement? GetOption(string key, ClientOptionScope scope = ClientOptionScope.Game)

读取项目/设备选项,未设置时为 null。Game scope 继承设备默认值。

SetOption 仅客户端 ​

csharp
public static ClientOperationResult SetOption(string key, object? value, ClientOptionWriteMode mode = ClientOptionWriteMode.Transient, ClientOptionScope scope = ClientOptionScope.Game)

写入 bool/float/string。Transient 仅保存本局数据并通知订阅者,不调用进程级设置处理器;null 清除覆盖。Default 不覆盖显式值。

GenerateQrCode 仅客户端 ​

csharp
public static ClientQrCode? GenerateQrCode(string text, int errorCorrection = 3)

二维码编码像素,由现有原生编码器提供;不可用或文本过长时返回 null。

GetResourceDependencies 仅客户端 ​

csharp
public static ClientResourceDependency[] GetResourceDependencies()

当前原生依赖资源路径和资源包版本;资源包版本未知时为 null,不表示托管程序集版本。

ScanQrCodeAsync 仅客户端 ​

csharp
public static Task<ClientQrScanResult> ScanQrCodeAsync(CancellationToken cancellationToken = default(CancellationToken))

启动相机扫码并等待结果;取消或游戏结束时取消原生请求。

事件 ​

Changed 仅客户端 ​

csharp
public static event Action<ClientPlatformChange> Changed

仅在订阅期间接收原生手柄、显示和设置变化。设置事件包含项目和 scope。

ClientPlatformChange 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientPlatformChange : IEquatable<ClientPlatformChange>

Kind 为 gamepad.connected/disconnected/button/axis/hat、display.changed、option.changed 或 state.resync。state.resync 表示事件队列溢出,应重新读取手柄和选项状态。

构造函数 ​

ClientPlatformChange 仅客户端 ​

csharp
public ClientPlatformChange()

属性 ​

Kind 仅客户端 ​

csharp
public string Kind { get; init; }

DeviceId 仅客户端 ​

csharp
public int DeviceId { get; init; }

Control 仅客户端 ​

csharp
public int Control { get; init; }

Value 仅客户端 ​

csharp
public float Value { get; init; }

Key 仅客户端 ​

csharp
public string? Key { get; init; }

Project 仅客户端 ​

csharp
public string? Project { get; init; }

Scope 仅客户端 ​

csharp
public ClientOptionScope Scope { get; init; }

WriteMode 仅客户端 ​

csharp
public ClientOptionWriteMode WriteMode { get; init; }

OptionValue 仅客户端 ​

csharp
public JsonElement? OptionValue { get; init; }

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientPlatformChange? left, ClientPlatformChange? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientPlatformChange? left, ClientPlatformChange? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientPlatformChange? other)

ClientQrCode 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientQrCode : IEquatable<ClientQrCode>

Width × Width 行优先的二维码模块矩阵;1 为深色,0 为浅色,不含四周静区。

构造函数 ​

ClientQrCode 仅客户端 ​

csharp
public ClientQrCode(int Width, int[] Pixels)

Width × Width 行优先的二维码模块矩阵;1 为深色,0 为浅色,不含四周静区。

属性 ​

Width 仅客户端 ​

csharp
public int Width { get; init; }

Pixels 仅客户端 ​

csharp
public int[] Pixels { get; init; }

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientQrCode? left, ClientQrCode? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientQrCode? left, ClientQrCode? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientQrCode? other)

Deconstruct 仅客户端 ​

csharp
public void Deconstruct(out int Width, out int[] Pixels)

ClientQrScanResult 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientQrScanResult : IEquatable<ClientQrScanResult>

构造函数 ​

ClientQrScanResult 仅客户端 ​

csharp
public ClientQrScanResult(ClientQrScanStatus Status, string? Text, string? NativeStatus = null)

属性 ​

Status 仅客户端 ​

csharp
public ClientQrScanStatus Status { get; init; }

Text 仅客户端 ​

csharp
public string? Text { get; init; }

NativeStatus 仅客户端 ​

csharp
public string? NativeStatus { get; init; }

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientQrScanResult? left, ClientQrScanResult? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientQrScanResult? left, ClientQrScanResult? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientQrScanResult? other)

Deconstruct 仅客户端 ​

csharp
public void Deconstruct(out ClientQrScanStatus Status, out string? Text, out string? NativeStatus)

ClientQrScanStatus 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public enum ClientQrScanStatus

枚举值 ​

  • Success
  • PermissionDenied
  • Cancelled
  • Busy
  • Unsupported
  • Unavailable
  • Failed

ClientResourceDependency 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientResourceDependency : IEquatable<ClientResourceDependency>

构造函数 ​

ClientResourceDependency 仅客户端 ​

csharp
public ClientResourceDependency(string Name, string ResourcePath, string? ResourcePackageVersion = null)

属性 ​

Name 仅客户端 ​

csharp
public string Name { get; init; }

ResourcePath 仅客户端 ​

csharp
public string ResourcePath { get; init; }

ResourcePackageVersion 仅客户端 ​

csharp
public string? ResourcePackageVersion { get; init; }

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientResourceDependency? left, ClientResourceDependency? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientResourceDependency? left, ClientResourceDependency? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientResourceDependency? other)

Deconstruct 仅客户端 ​

csharp
public void Deconstruct(out string Name, out string ResourcePath, out string? ResourcePackageVersion)

ClientScreenDirection 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public enum ClientScreenDirection

枚举值 ​

  • Portrait
  • Landscape

ClientStageOperation 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public enum ClientStageOperation

枚举值 ​

  • Mark
  • Clear
  • Upload
  • AppRecord

ClientSurfaceInfo 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientSurfaceInfo : IEquatable<ClientSurfaceInfo>

构造函数 ​

ClientSurfaceInfo 仅客户端 ​

csharp
public ClientSurfaceInfo(ClientPixelSize RenderSize, ClientPixelSize? DefaultSize, ClientPixelSize WindowSize, float ScaleX, float ScaleY)

属性 ​

RenderSize 仅客户端 ​

csharp
public ClientPixelSize RenderSize { get; init; }

DefaultSize 仅客户端 ​

csharp
public ClientPixelSize? DefaultSize { get; init; }

WindowSize 仅客户端 ​

csharp
public ClientPixelSize WindowSize { get; init; }

ScaleX 仅客户端 ​

csharp
public float ScaleX { get; init; }

ScaleY 仅客户端 ​

csharp
public float ScaleY { get; init; }

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientSurfaceInfo? left, ClientSurfaceInfo? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientSurfaceInfo? left, ClientSurfaceInfo? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientSurfaceInfo? other)

Deconstruct 仅客户端 ​

csharp
public void Deconstruct(out ClientPixelSize RenderSize, out ClientPixelSize? DefaultSize, out ClientPixelSize WindowSize, out float ScaleX, out float ScaleY)

ClientWindowInfo 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public sealed class ClientWindowInfo : IEquatable<ClientWindowInfo>

构造函数 ​

ClientWindowInfo 仅客户端 ​

csharp
public ClientWindowInfo()

属性 ​

Width 仅客户端 ​

csharp
public int Width { get; init; }

Height 仅客户端 ​

csharp
public int Height { get; init; }

X 仅客户端 ​

csharp
public int X { get; init; }

Y 仅客户端 ​

csharp
public int Y { get; init; }

Display 仅客户端 ​

csharp
public int Display { get; init; }

RefreshRate 仅客户端 ​

csharp
public int RefreshRate { get; init; }

Mode 仅客户端 ​

csharp
public ClientWindowMode Mode { get; init; }

Visible 仅客户端 ​

csharp
public bool Visible { get; init; }

Resizable 仅客户端 ​

csharp
public bool Resizable { get; init; }

Minimized 仅客户端 ​

csharp
public bool Minimized { get; init; }

Maximized 仅客户端 ​

csharp
public bool Maximized { get; init; }

ControlledByHost 仅客户端 ​

csharp
public bool ControlledByHost { get; init; }

MinimumSize 仅客户端 ​

csharp
public ClientPixelSize? MinimumSize { get; init; }

MaximumSize 仅客户端 ​

csharp
public ClientPixelSize? MaximumSize { get; init; }

方法 ​

ToString 仅客户端 ​

csharp
public override string ToString()

operator != 仅客户端 ​

csharp
public static bool operator !=(ClientWindowInfo? left, ClientWindowInfo? right)

operator == 仅客户端 ​

csharp
public static bool operator ==(ClientWindowInfo? left, ClientWindowInfo? right)

GetHashCode 仅客户端 ​

csharp
public override int GetHashCode()

Equals 仅客户端 ​

csharp
public override bool Equals(object? obj)

Equals 仅客户端 ​

csharp
public bool Equals(ClientWindowInfo? other)

ClientWindowMode 仅客户端 ​

命名空间 GameCore.ClientPlatform

csharp
public enum ClientWindowMode

枚举值 ​

  • Windowed
  • ExclusiveFullscreen
  • BorderlessFullscreen