Vixen
02b45cc4
csharp
public sealed class Image

A picture.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Two halves, and only one of them is here. Source names the asset the way the application's asset system names things, and aspect-ratio in the stylesheet keeps the box the right shape. What turns a name into pixels is the application's: it loads the asset, registers the texture with the renderer, and puts the number it was given in Texture.

⚠ An unset Texture draws nothing, which is what an image whose asset has not finished loading should do. A background colour on it is a perfectly good placeholder in the meantime.

Fields and properties (11)

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • protected override bool AcceptsFocus

    Whether the focus can rest on this kind of control at all.

  • public string? Source
  • public string? Description
  • public ulong Texture

    The renderer's number for the texture to draw, or zero for none.

  • public Rectangle SourceRectangle

    Which part of the texture to draw, in UVs. The whole of it by default.

  • public NineSlice Border

    How far the corners reach in, in document pixels. Empty stretches the whole image.

  • public NineSlice SourceBorder

    The same cut of the texture, in UVs.

  • public bool HollowCentre

    Whether the middle of a nine-slice is left undrawn.

  • public static readonly UiPropertyKey SourceProperty

    Identity for Source.

  • public static readonly UiPropertyKey DescriptionProperty

    Identity for Description.

Methods (3)

  • protected override void OnDraw(DrawContext context)

    Draws whatever this element is, beyond what a stylesheet can describe.

  • public void ClearSource()

    Unsets Source, so it takes its default or its ancestor's value again.

  • public void ClearDescription()

    Unsets Description, so it takes its default or its ancestor's value again.

Used by (5)

  • AssetGridVixen.Editor.App
  • AssetTileVixen.Editor.App
  • MaterialViewVixen.Editor.AssetEditors
  • SpriteSheetViewVixen.Editor.AssetEditors
  • TextureImportViewVixen.Editor.AssetEditors