Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Sandbox.ModAPI.Ingame.IMyTextSurface

Morten Aune Lyrstad edited this page Feb 17, 2020 · 28 revisions

IndexNamespace Index

IMyTextSurface Interface

public interface IMyTextSurface

Namespace: Sandbox.ModAPI.Ingame
Assembly: Sandbox.Common.dll

Inheritors:

Properties

Member Description
CurrentlyShownImage { get; } The image that is currently shown on the screen. Returns NULL if there are no images selected OR the screen is in text mode.
FontSize { get; set; } Gets or sets font size
FontColor { get; set; } Gets or sets font color
BackgroundColor { get; set; } Gets or sets background color
BackgroundAlpha { get; set; } Value for offscreen texture alpha channel - for PBR material it is metalness (should be 0) - for transparent texture it is opacity
ChangeInterval { get; set; } Gets or sets the change interval for selected textures
Font { get; set; } Gets or sets the font
Alignment { get; set; } How should the text be aligned
Script { get; set; } Currently running script
ContentType { get; set; } Type of content to be displayed on the screen.
SurfaceSize { get; } Size of the drawing surface.
TextureSize { get; } Size of the texture the drawing surface is rendered to.
PreserveAspectRatio { get; set; } Preserve aspect ratio of images.
TextPadding { get; set; } Text padding from all sides of the panel.
ScriptBackgroundColor { get; set; } Background color used for scripts.
ScriptForegroundColor { get; set; } Foreground color used for scripts.
Name { get; } Identifier name of this surface.
DisplayName { get; } Localized name of this surface.

Methods

Member Description
WriteText(string, bool)
GetText()
WriteText(StringBuilder, bool)
ReadText(StringBuilder, bool)
AddImageToSelection(string, bool)
AddImagesToSelection(List, bool)
RemoveImageFromSelection(string, bool)
RemoveImagesFromSelection(List, bool)
ClearImagesFromSelection()
GetSelectedImages(List) Outputs the selected image ids to the specified list. NOTE: List is not cleared internally.
GetFonts(List) Gets a list of available fonts
GetSprites(List) Gets a list of available sprites
GetScripts(List) Gets a list of available scripts
DrawFrame() Creates a new draw frame where you can add sprites to be rendered.
MeasureStringInPixels(StringBuilder, string, float) Calculates how many pixels a string of a given font and scale will take up.
Clone this wiki locally