Skip to content

GameCore.Display ​

Widget 仅客户端 ​

命名空间 GameCore.Display

csharp
public class Widget : IGameObject<GameDataWidget>, IGameObject

Runtime handle for a widget instance inside a status bar or floating text.

备注

A widget handle points to the current native instance. If the owning status bar or floating text is rebuilt, get the widget again and check IsValid before applying runtime changes.

属性 ​

csharp
public IGameLink<GameDataWidget> Link { get; }

Cache 仅客户端 ​

csharp
public GameDataWidget Cache { get; }

IsValid 仅客户端 ​

csharp
public bool IsValid { get; }

Whether the native widget instance still exists.

方法 ​

SetVisible 仅客户端 ​

csharp
public bool SetVisible(bool visible)

SetColor 仅客户端 ​

csharp
public bool SetColor(Color color)

字段 ​

ViewWidget 仅客户端 ​

csharp
private protected readonly IViewWidget ViewWidget

WidgetBar 仅客户端 ​

命名空间 GameCore.Display

csharp
public sealed class WidgetBar : Widget

Runtime handle for a bar widget.

属性 ​

csharp
public new IGameLink<GameDataWidgetBar> Link { get; }

Cache 仅客户端 ​

csharp
public new GameDataWidgetBar Cache { get; }

方法 ​

SetPercentage 仅客户端 ​

csharp
public bool SetPercentage(float percentage)

Sets the displayed bar progress. Values are clamped to the 0..1 range.

SetSkinIndex 仅客户端 ​

csharp
public bool SetSkinIndex(int skinIndex)

Selects a skin by zero-based index from Skins.

WidgetImage 仅客户端 ​

命名空间 GameCore.Display

csharp
public sealed class WidgetImage : Widget

Runtime handle for an image widget.

属性 ​

csharp
public new IGameLink<GameDataWidgetImage> Link { get; }

Cache 仅客户端 ​

csharp
public new GameDataWidgetImage Cache { get; }

方法 ​

SetImage 仅客户端 ​

csharp
public bool SetImage(UTF8String image)

Replaces the image displayed by this widget instance.

SetImage 仅客户端 ​

csharp
public bool SetImage(string? image)

WidgetText 仅客户端 ​

命名空间 GameCore.Display

csharp
public sealed class WidgetText : Widget

Runtime handle for a text widget.

属性 ​

csharp
public new IGameLink<GameDataWidgetText> Link { get; }

Cache 仅客户端 ​

csharp
public new GameDataWidgetText Cache { get; }

方法 ​

SetText 仅客户端 ​

csharp
public bool SetText(UTF8String text)

Replaces the text displayed by this widget instance.

SetText 仅客户端 ​

csharp
public bool SetText(string? text)

GameDataWidget 双端 ​

命名空间 GameCore.Display.Data

csharp
public abstract class GameDataWidget : GameDataCategory<GameDataWidget>, IGameDataCategory<GameDataWidget>, IGameData<GameDataWidget>, IGameData

Base data for visual parts used by StatusBar and FloatingText templates.

备注

Widget data is a standalone category so public APIs can use strongly typed links instead of unstable names or template-local indexes.

构造函数 ​

GameDataWidget 双端 ​

csharp
public GameDataWidget(GameLink<GameDataWidget, GameDataWidget> link)

GameDataWidget 双端 ​

csharp
public GameDataWidget(IGameLink<GameDataWidget> link)

属性 ​

Rect 双端 ​

csharp
public WidgetRect Rect { get; set; }

Color 双端 ​

csharp
public Color? Color { get; set; }

Visible 双端 ​

csharp
public bool Visible { get; set; }

Value 双端 ​

csharp
public WidgetPropertyBinding? Value { get; set; }

Unit property binding used as this widget's displayed value.

csharp
public WidgetPropertyBinding? Blink { get; set; }

Unit property binding that controls blinking. Non-zero values make the widget blink.

BlinkInterval 双端 ​

csharp
public TimeSpan? BlinkInterval { get; set; }

Children 双端 ​

csharp
public List<IGameLink<GameDataWidget>?> Children { get; set; }

Child widgets. Use widget links instead of duplicating embedded widget data.

GameDataWidgetBar 双端 ​

命名空间 GameCore.Display.Data

csharp
public sealed class GameDataWidgetBar : GameDataWidget, IGameData<GameDataWidgetBar>, IGameData

构造函数 ​

GameDataWidgetBar 双端 ​

csharp
public GameDataWidgetBar(GameLink<GameDataWidget, GameDataWidgetBar> link)

GameDataWidgetBar 双端 ​

csharp
public GameDataWidgetBar(IGameLink<GameDataWidgetBar> link)

属性 ​

Skins 双端 ​

csharp
public List<WidgetSkin> Skins { get; set; }

Max 双端 ​

csharp
public WidgetPropertyBinding? Max { get; set; }

Unit property binding used as the denominator when calculating bar percentage.

SkinIndex 双端 ​

csharp
public WidgetPropertyBinding? SkinIndex { get; set; }

Unit property binding that selects a skin. Bound values are one-based for compatibility with native status bar data.

Overlay 双端 ​

csharp
public string? Overlay { get; set; }

Delay 双端 ​

csharp
public TimeSpan? Delay { get; set; }

UseDelayIndicator 双端 ​

csharp
public bool UseDelayIndicator { get; set; }
csharp
public new IGameLink<GameDataWidgetBar> Link { get; }

GameDataWidgetImage 双端 ​

命名空间 GameCore.Display.Data

csharp
public sealed class GameDataWidgetImage : GameDataWidget, IGameData<GameDataWidgetImage>, IGameData

构造函数 ​

GameDataWidgetImage 双端 ​

csharp
public GameDataWidgetImage(GameLink<GameDataWidget, GameDataWidgetImage> link)

GameDataWidgetImage 双端 ​

csharp
public GameDataWidgetImage(IGameLink<GameDataWidgetImage> link)

属性 ​

Texture 双端 ​

csharp
public Texture? Texture { get; set; }

Image resource path or atlas key used by the status bar canvas.

Border 双端 ​

csharp
public WidgetBorder? Border { get; set; }
csharp
public new IGameLink<GameDataWidgetImage> Link { get; }

GameDataWidgetPanel 双端 ​

命名空间 GameCore.Display.Data

csharp
public sealed class GameDataWidgetPanel : GameDataWidget, IGameData<GameDataWidgetPanel>, IGameData

构造函数 ​

GameDataWidgetPanel 双端 ​

csharp
public GameDataWidgetPanel(GameLink<GameDataWidget, GameDataWidgetPanel> link)

GameDataWidgetPanel 双端 ​

csharp
public GameDataWidgetPanel(IGameLink<GameDataWidgetPanel> link)

属性 ​

csharp
public new IGameLink<GameDataWidgetPanel> Link { get; }

GameDataWidgetRuler 双端 ​

命名空间 GameCore.Display.Data

csharp
public sealed class GameDataWidgetRuler : GameDataWidget, IGameData<GameDataWidgetRuler>, IGameData

构造函数 ​

GameDataWidgetRuler 双端 ​

csharp
public GameDataWidgetRuler(GameLink<GameDataWidget, GameDataWidgetRuler> link)

GameDataWidgetRuler 双端 ​

csharp
public GameDataWidgetRuler(IGameLink<GameDataWidgetRuler> link)

属性 ​

Scheme 双端 ​

csharp
public List<RulerScheme> Scheme { get; set; }
csharp
public new IGameLink<GameDataWidgetRuler> Link { get; }

GameDataWidgetText 双端 ​

命名空间 GameCore.Display.Data

csharp
public sealed class GameDataWidgetText : GameDataWidget, IGameData<GameDataWidgetText>, IGameData

构造函数 ​

GameDataWidgetText 双端 ​

csharp
public GameDataWidgetText(GameLink<GameDataWidget, GameDataWidgetText> link)

GameDataWidgetText 双端 ​

csharp
public GameDataWidgetText(IGameLink<GameDataWidgetText> link)

属性 ​

Text 双端 ​

csharp
public string Text { get; set; }

Font 双端 ​

csharp
public Font? Font { get; set; }

Font file path used by normal text rendering.

ImageFontPrefix 双端 ​

csharp
public string? ImageFontPrefix { get; set; }

Prefix used by image-based number/text rendering.

FontSize 双端 ​

csharp
public float? FontSize { get; set; }

HorizontalAlignment 双端 ​

csharp
public WidgetTextHorizontalAlignment HorizontalAlignment { get; set; }

VerticalAlignment 双端 ​

csharp
public WidgetTextVerticalAlignment VerticalAlignment { get; set; }

DisplayValueAsInteger 双端 ​

csharp
public bool DisplayValueAsInteger { get; set; }

Displays numeric values without decimal places.

ReadValueAsInteger 双端 ​

csharp
public bool ReadValueAsInteger { get; set; }

Reads the stored value as an integer payload instead of a floating-point number.

TextPrefix 双端 ​

csharp
public string? TextPrefix { get; set; }

TextSuffix 双端 ​

csharp
public string? TextSuffix { get; set; }

Stroke 双端 ​

csharp
public int Stroke { get; set; }

StrokeColor 双端 ​

csharp
public Color? StrokeColor { get; set; }
csharp
public new IGameLink<GameDataWidgetText> Link { get; }

RulerScheme 双端 ​

命名空间 GameCore.Display.Data

csharp
public sealed class RulerScheme

构造函数 ​

RulerScheme 双端 ​

csharp
public RulerScheme()

属性 ​

Skin 双端 ​

csharp
public Texture? Skin { get; set; }

Color 双端 ​

csharp
public Color? Color { get; set; }

Gap 双端 ​

csharp
public float Gap { get; set; }

Level 双端 ​

csharp
public float Level { get; set; }

Thickness 双端 ​

csharp
public float Thickness { get; set; }

ShortHeightScale 双端 ​

csharp
public float ShortHeightScale { get; set; }

LongHeightScale 双端 ​

csharp
public float LongHeightScale { get; set; }

Interval 双端 ​

csharp
public int Interval { get; set; }

WidgetAnimationSegment 双端 ​

命名空间 GameCore.Display.Data

csharp
public sealed class WidgetAnimationSegment

构造函数 ​

WidgetAnimationSegment 双端 ​

csharp
public WidgetAnimationSegment()

属性 ​

Duration 双端 ​

csharp
public TimeSpan Duration { get; set; }

ControlPoints 双端 ​

csharp
public List<Vector2> ControlPoints { get; set; }

Start 双端 ​

csharp
public WidgetAnimationState Start { get; set; }

End 双端 ​

csharp
public WidgetAnimationState End { get; set; }

WidgetAnimationSequence 双端 ​

命名空间 GameCore.Display.Data

csharp
public sealed class WidgetAnimationSequence

构造函数 ​

WidgetAnimationSequence 双端 ​

csharp
public WidgetAnimationSequence()

属性 ​

Sequence 双端 ​

csharp
public List<WidgetAnimationSegment> Sequence { get; set; }

WidgetAnimationState 双端 ​

命名空间 GameCore.Display.Data

csharp
public sealed class WidgetAnimationState

构造函数 ​

WidgetAnimationState 双端 ​

csharp
public WidgetAnimationState()

属性 ​

T 双端 ​

csharp
public float T { get; set; }

Alpha 双端 ​

csharp
public float? Alpha { get; set; }

Scale 双端 ​

csharp
public Vector2? Scale { get; set; }

WidgetBorder 双端 ​

命名空间 GameCore.Display.Data

csharp
public sealed class WidgetBorder

构造函数 ​

WidgetBorder 双端 ​

csharp
public WidgetBorder()

属性 ​

Left 双端 ​

csharp
public float Left { get; set; }

Top 双端 ​

csharp
public float Top { get; set; }
csharp
public float Right { get; set; }

Bottom 双端 ​

csharp
public float Bottom { get; set; }

WidgetPropertyBinding 双端 ​

命名空间 GameCore.Display.Data

csharp
public sealed class WidgetPropertyBinding

Binds a widget value to one unit property source.

备注

If more than one field is set, serialization uses the first non-null value in this order: Property, Vital, then UnitField.

构造函数 ​

WidgetPropertyBinding 双端 ​

csharp
public WidgetPropertyBinding()

属性 ​

Property 双端 ​

csharp
public IGameLink<GameDataUnitProperty>? Property { get; set; }

GameData-defined unit property, such as max health.

Vital 双端 ​

csharp
public PropertyVital? Vital { get; set; }

Unit vital value, such as current or max health.

UnitField 双端 ​

csharp
public PropertyUnit? UnitField { get; set; }

Unit field identified by a PropertyUnit value, including framework-defined and user-extended entries.

备注

Extended PropertyUnit values can be provided by user code, so the widget binding cannot infer their payload type. If the bound unit field is text or an image path, write the property value as UTF8String instead of String so the native status bar reads valid UTF8 bytes.

WidgetRect 双端 ​

命名空间 GameCore.Display.Data

csharp
public sealed class WidgetRect

构造函数 ​

WidgetRect 双端 ​

csharp
public WidgetRect()

属性 ​

X 双端 ​

csharp
public float X { get; set; }

Y 双端 ​

csharp
public float Y { get; set; }

Width 双端 ​

csharp
public float Width { get; set; }

Height 双端 ​

csharp
public float Height { get; set; }

WidgetSkin 双端 ​

命名空间 GameCore.Display.Data

csharp
public sealed class WidgetSkin

构造函数 ​

WidgetSkin 双端 ​

csharp
public WidgetSkin()

属性 ​

Texture 双端 ​

csharp
public Texture? Texture { get; set; }

Color 双端 ​

csharp
public Color? Color { get; set; }

WidgetTextHorizontalAlignment 双端 ​

命名空间 GameCore.Display.Data

csharp
public enum WidgetTextHorizontalAlignment

枚举值 ​

  • Left
  • Center
  • Right

WidgetTextVerticalAlignment 双端 ​

命名空间 GameCore.Display.Data

csharp
public enum WidgetTextVerticalAlignment

枚举值 ​

  • Top
  • Center
  • Bottom