Space Engineers
Classes | Public Member Functions | Public Attributes | Properties | List of all members
Sandbox.Graphics.GUI.MyGuiControlLabel Class Reference
Inheritance diagram for Sandbox.Graphics.GUI.MyGuiControlLabel:
Sandbox.Graphics.GUI.MyGuiControlBase Sandbox.Graphics.GUI.IMyGuiControlsOwner

Classes

class  StyleDefinition
 

Public Member Functions

 MyGuiControlLabel ()
 
 MyGuiControlLabel (Vector2?position=null, Vector2?size=null, String text=null, Vector4?colorMask=null, float textScale=MyGuiConstants.DEFAULT_TEXT_SCALE, string font=MyFontEnum.Blue, MyGuiDrawAlignEnum originAlign=MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)
 
override void Init (MyObjectBuilder_GuiControlBase objectBuilder)
 
override MyObjectBuilder_GuiControlBase GetObjectBuilder ()
 
override void Draw (float transitionAlpha, float backgroundTransitionAlpha)
 
void Autowrap (float width)
 Inserts newlines into text to make it fit size. Works only on TextToDraw. More...
 
Vector2 GetTextSize ()
 
void UpdateFormatParams (params object[] args)
 If label's text contains params, we can update them here. Also, don't forget that text is defined two time: one as a definition and one that we draw. More...
 
void RecalculateSize ()
 
void RefreshInternals ()
 
void ApplyStyle (StyleDefinition style)
 
- Public Member Functions inherited from Sandbox.Graphics.GUI.MyGuiControlBase
virtual MyGuiControlGridDragAndDrop GetDragAndDropHandlingNow ()
 
virtual MyGuiControlBase GetExclusiveInputHandler ()
 
virtual MyGuiControlBase GetMouseOverControl ()
 Returns first control, which has mouse over. More...
 
virtual MyGuiControlBase HandleInput ()
 Method returns true if input was captured by control, so no other controls, nor screen can use input in this update. More...
 
virtual void HideToolTip ()
 
virtual bool IsMouseOverAnyControl ()
 
virtual void ShowToolTip ()
 
virtual void Update ()
 
virtual bool CheckMouseOver ()
 Checks if mouse cursor is over control. GR: Update: Also check if mouse over parent controls. Slower but more solid implementation (and we get rid of a few bugs). Also there is no need for HandleMouse variable (removed) More...
 
virtual string GetMouseCursorTexture ()
 
Vector2 GetPositionAbsolute ()
 
Vector2 GetPositionAbsoluteBottomLeft ()
 
Vector2 GetPositionAbsoluteBottomRight ()
 
Vector2 GetPositionAbsoluteCenterLeft ()
 
Vector2 GetPositionAbsoluteCenter ()
 
Vector2 GetPositionAbsoluteTopLeft ()
 
Vector2 GetPositionAbsoluteTopRight ()
 
Vector2 GetSize ()
 
void SetToolTip (MyToolTips toolTip)
 
void SetToolTip (String text)
 
void SetToolTip (MyStringId text)
 
virtual void OnRemoving ()
 Removes various references and clears event handlers. More...
 
void GetElementsUnderCursor (Vector2 position, bool visibleOnly, List< MyGuiControlBase > controls)
 
virtual MyGuiControlBase GetNextFocusControl (MyGuiControlBase currentFocusControl, bool forwardMovement)
 
virtual void Clear ()
 
override string ToString ()
 

Public Attributes

StringBuilder TextToDraw
 
bool AutoEllipsis = false
 Automatically shorten text by using triple dot character More...
 
- Public Attributes inherited from Sandbox.Graphics.GUI.MyGuiControlBase
readonly MyGuiControls Elements
 
MyGuiCompositeTexture BackgroundTexture
 
Vector4 BorderColor
 
bool BorderEnabled
 
bool DrawWhilePaused
 
bool ShowTooltipWhenDisabled
 
bool IsActiveControl
 There are some controls, that cannot receive any handle input(control panel for example), thus disable them with this. More...
 
MyGuiControlHighlightType HighlightType
 

Properties

string Font [get, set]
 Font used for drawing. Setting null will switch to default font (ie. this never returns null). More...
 
string Text [get, set]
 
MyStringId TextEnum [get, set]
 
float TextScale [get, set]
 
float TextScaleWithLanguage [get]
 
- Properties inherited from Sandbox.Graphics.GUI.MyGuiControlBase
float Alpha [get, set]
 
string Name [get, set]
 
IMyGuiControlsOwner Owner [get]
 
MyToolTips Tooltips [get]
 
Vector2 Position [get, set]
 Position of control's center (normalized and relative to parent screen center (not left/top corner!!!)) More...
 
float PositionY [get, set]
 
float PositionX [get, set]
 
Vector2 Size [get, set]
 Size of control (normalized). More...
 
Vector2 MinSize [get, protected set]
 
Vector2 MaxSize [get, protected set]
 
Vector4 ColorMask [get, set]
 
int BorderSize [get, set]
 
bool Enabled [get, set]
 False to disable control, disabled controls are skipped when switching with Tab key etc., look implemented atm. only in MyGuiControlButton. More...
 
MyGuiDrawAlignEnum OriginAlign [get, set]
 
bool Visible [get, set]
 Says whether control is visible. Note that this is not a constant time operation (checks parents, fires events on set). More...
 
bool HasHighlight [get]
 Says whether control is currently highlighted. When control is highlit depends on HighlightType. More...
 
bool HasFocus [get]
 
bool IsMouseOver [get, set]
 
bool CanHaveFocus [get, set]
 
bool AllowFocusingElements [get, set]
 Indicates whether elements can have focus or not. More...
 
object UserData [get, set]
 Specific user data for this control. More...
 
string DebugNamePath [get]
 
- Properties inherited from Sandbox.Graphics.GUI.IMyGuiControlsOwner
string DebugNamePath [get]
 
string Name [get]
 
IMyGuiControlsOwner Owner [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from Sandbox.Graphics.GUI.MyGuiControlBase
static void ReadIfHasValue< T > (ref T target, T?source)
 
static void ReadIfHasValue (ref Color target, Vector4?source)
 
static MyGuiControlBase GetExclusiveInputHandler (MyGuiControls controls)
 
static Color ApplyColorMaskModifiers (Vector4 sourceColorMask, bool enabled, float transitionAlpha)
 Modifies source color mask using transition alpha and color multiplier in case a control is disabled. More...
 
static bool CheckMouseOver (Vector2 size, Vector2 position, MyGuiDrawAlignEnum originAlign)
 
static bool IsPointInside (Vector2 queryPoint, Vector2 size, Vector2 position, MyGuiDrawAlignEnum originAlign)
 
- Protected Member Functions inherited from Sandbox.Graphics.GUI.MyGuiControlBase
 MyGuiControlBase (Vector2?position=null, Vector2?size=null, Vector4?colorMask=null, String toolTip=null, MyGuiCompositeTexture backgroundTexture=null, bool isActiveControl=true, bool canHaveFocus=false, bool allowFocusingElements=false, MyGuiControlHighlightType highlightType=MyGuiControlHighlightType.WHEN_ACTIVE, MyGuiDrawAlignEnum originAlign=MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER)
 
void DrawBackground (float transitionAlpha)
 
void DrawBorder (float transitionAlpha)
 
virtual bool ShouldHaveHighlight ()
 
virtual void OnHasHighlightChanged ()
 
virtual void OnPositionChanged ()
 
virtual void OnSizeChanged ()
 
virtual void OnVisibleChanged ()
 
virtual void OnOriginAlignChanged ()
 
virtual void OnEnabledChanged ()
 
virtual void OnColorMaskChanged ()
 
MyGuiScreenBase GetTopMostOwnerScreen ()
 
bool IsMouseOverOrKeyboardActive ()
 
virtual void DrawElements (float transitionAlpha, float backgroundTransitionAlpha)
 
MyGuiControlBase HandleInputElements ()
 
virtual void ClearEvents ()
 
- Protected Attributes inherited from Sandbox.Graphics.GUI.MyGuiControlBase
bool m_mouseButtonPressed = false
 
bool m_showToolTip = false
 
Vector2 m_toolTipPosition
 
- Events inherited from Sandbox.Graphics.GUI.MyGuiControlBase
Action< MyGuiControlBase, NameChangedArgsNameChanged
 
Action< MyGuiControlBaseSizeChanged
 
VisibleChangedDelegate VisibleChanged
 
Action< MyGuiControlBase, bool > FocusChanged
 Called when the control enters or leaves focus. More...
 

Detailed Description

Definition at line 18 of file MyGuiControlLabel.cs.

Constructor & Destructor Documentation

Sandbox.Graphics.GUI.MyGuiControlLabel.MyGuiControlLabel ( )
inline

Definition at line 101 of file MyGuiControlLabel.cs.

Sandbox.Graphics.GUI.MyGuiControlLabel.MyGuiControlLabel ( Vector2 position = null,
Vector2 size = null,
String  text = null,
Vector4 colorMask = null,
float  textScale = MyGuiConstants.DEFAULT_TEXT_SCALE,
string  font = MyFontEnum.Blue,
MyGuiDrawAlignEnum  originAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER 
)
inline

Definition at line 106 of file MyGuiControlLabel.cs.

Member Function Documentation

void Sandbox.Graphics.GUI.MyGuiControlLabel.ApplyStyle ( StyleDefinition  style)
inline

Definition at line 262 of file MyGuiControlLabel.cs.

void Sandbox.Graphics.GUI.MyGuiControlLabel.Autowrap ( float  width)
inline

Inserts newlines into text to make it fit size. Works only on TextToDraw.

Definition at line 201 of file MyGuiControlLabel.cs.

override void Sandbox.Graphics.GUI.MyGuiControlLabel.Draw ( float  transitionAlpha,
float  backgroundTransitionAlpha 
)
inlinevirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 183 of file MyGuiControlLabel.cs.

override MyObjectBuilder_GuiControlBase Sandbox.Graphics.GUI.MyGuiControlLabel.GetObjectBuilder ( )
inlinevirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 171 of file MyGuiControlLabel.cs.

Vector2 Sandbox.Graphics.GUI.MyGuiControlLabel.GetTextSize ( )
inline

Definition at line 209 of file MyGuiControlLabel.cs.

override void Sandbox.Graphics.GUI.MyGuiControlLabel.Init ( MyObjectBuilder_GuiControlBase  objectBuilder)
inlinevirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 158 of file MyGuiControlLabel.cs.

void Sandbox.Graphics.GUI.MyGuiControlLabel.RecalculateSize ( )
inline

Definition at line 246 of file MyGuiControlLabel.cs.

void Sandbox.Graphics.GUI.MyGuiControlLabel.RefreshInternals ( )
inline

Definition at line 252 of file MyGuiControlLabel.cs.

void Sandbox.Graphics.GUI.MyGuiControlLabel.UpdateFormatParams ( params object[]  args)
inline

If label's text contains params, we can update them here. Also, don't forget that text is defined two time: one as a definition and one that we draw.

Parameters
args

Definition at line 219 of file MyGuiControlLabel.cs.

Member Data Documentation

bool Sandbox.Graphics.GUI.MyGuiControlLabel.AutoEllipsis = false

Automatically shorten text by using triple dot character

Definition at line 99 of file MyGuiControlLabel.cs.

StringBuilder Sandbox.Graphics.GUI.MyGuiControlLabel.TextToDraw

Definition at line 90 of file MyGuiControlLabel.cs.

Property Documentation

string Sandbox.Graphics.GUI.MyGuiControlLabel.Font
getset

Font used for drawing. Setting null will switch to default font (ie. this never returns null).

Definition at line 34 of file MyGuiControlLabel.cs.

string Sandbox.Graphics.GUI.MyGuiControlLabel.Text
getset

Definition at line 41 of file MyGuiControlLabel.cs.

MyStringId Sandbox.Graphics.GUI.MyGuiControlLabel.TextEnum
getset

Definition at line 55 of file MyGuiControlLabel.cs.

float Sandbox.Graphics.GUI.MyGuiControlLabel.TextScale
getset

Definition at line 70 of file MyGuiControlLabel.cs.

float Sandbox.Graphics.GUI.MyGuiControlLabel.TextScaleWithLanguage
get

Definition at line 85 of file MyGuiControlLabel.cs.


The documentation for this class was generated from the following file: