Assembly: Sandbox.Common.dll

public interface IMyTextSurface

Describes one of block LCDs where you can write text or draw things (PB scripting interface)

Properties

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

Methods

Member Description
AddImagesToSelection(List, bool) Adds image to list of shown images. You can get image ids by GetSelectedImages(List)
AddImageToSelection(string, bool) Adds image to list of shown images. You can get image ids by GetSelectedImages(List)
ClearImagesFromSelection() Removes images from shown images.
DrawFrame() Creates a new draw frame where you can add sprites to be rendered.
GetFonts(List) Gets a list of available fonts
GetScripts(List) Gets a list of available scripts
GetSelectedImages(List) Outputs the selected image ids to the specified list. NOTE: List is not cleared internally.
GetSprites(List) Gets a list of available sprites
GetText() Gets current text that is written on surface. Allocates memory (StringBuilder.ToString())! This method doesn't allocate memory ReadText(StringBuilder, bool)
MeasureStringInPixels(StringBuilder, string, float) Calculates how many pixels a string of a given font and scale will take up.
ReadText(StringBuilder, bool) Gets current text that is written on surface.
RemoveImageFromSelection(string, bool) Removes image from shown images.
RemoveImagesFromSelection(List, bool) Removes images from shown images.
WriteText(string, bool) Writes text to surface. If somebody opened LCD text in popup dialog, text can no longer be added to the surface. Resulting text must is capped with 100000 symbols
WriteText(StringBuilder, bool) Writes text to surface. If somebody opened LCD text in popup dialog, text can no longer be added to the surface. Resulting text must is capped with 100000 symbols

Inheritors:

Type Definitions: