Class BaseScreenComponent
Provides features common to all screen components.
Inheritance
BaseScreenComponent
Assembly: Assembly-CSharp.dll
Syntax
public abstract class BaseScreenComponent : IDisposable
Constructors
|
Improve this Doc
View Source
BaseScreenComponent()
Declaration
public BaseScreenComponent()
Fields
|
Improve this Doc
View Source
animatedBackgroundTextures
Declaration
protected Texture2D[] animatedBackgroundTextures
Field Value
|
Improve this Doc
View Source
backgroundTexture
Declaration
protected Texture2D backgroundTexture
Field Value
|
Improve this Doc
View Source
backgroundTextureLayout
Declaration
protected BackgroundLayout backgroundTextureLayout
Field Value
|
Improve this Doc
View Source
rectRestrictedRenderArea
Declaration
protected Rect rectRestrictedRenderArea
Field Value
|
Improve this Doc
View Source
restrictedRenderAreaCoordinateType
Declaration
protected BaseScreenComponent.RestrictedRenderArea_CoordinateType restrictedRenderAreaCoordinateType
Field Value
|
Improve this Doc
View Source
restrictedRenderAreaCustomParent
Declaration
protected Panel restrictedRenderAreaCustomParent
Field Value
Properties
|
Improve this Doc
View Source
AnimatedBackgroundTextures
Gets or sets array of background textures for animated background.
Set null to disable animated background.
Any existing background texture is removed when setting an animated background.
Declaration
public Texture2D[] AnimatedBackgroundTextures { get; set; }
Property Value
|
Improve this Doc
View Source
AnimationDelayInSeconds
Gets or sets animation delay in seconds.
Declaration
public float AnimationDelayInSeconds { get; set; }
Property Value
|
Improve this Doc
View Source
AutoSize
Gets or sets autosize mode.
This is how control resizes itself to parent.
Declaration
public AutoSizeModes AutoSize { get; set; }
Property Value
|
Improve this Doc
View Source
BackgroundColor
Gets or sets background colour.
Declaration
public Color BackgroundColor { get; set; }
Property Value
|
Improve this Doc
View Source
BackgroundColorTexture
Gets or sets background colour texture.
Declaration
public Texture2D BackgroundColorTexture { get; set; }
Property Value
|
Improve this Doc
View Source
BackgroundCroppedRect
Gets or sets subrect when using BackgroundLayout.Cropped
Subrect should be in pixel coordinates relative to texture size.
Selected subrect will be scaled to fit inside panel area.
Declaration
public Rect BackgroundCroppedRect { get; set; }
Property Value
|
Improve this Doc
View Source
BackgroundTexture
Gets or sets background texture.
Will replace BackgroundColor if set.
Declaration
public Texture2D BackgroundTexture { get; set; }
Property Value
|
Improve this Doc
View Source
BackgroundTextureLayout
Gets or sets background texture layout behaviour.
Declaration
public BackgroundLayout BackgroundTextureLayout { get; set; }
Property Value
|
Improve this Doc
View Source
BottomMargin
Declaration
public int BottomMargin { get; set; }
Property Value
|
Improve this Doc
View Source
CustomMousePosition
Gets or sets custom mouse position.
When null the screen mouse position will be used from Input system as normal.
When non-null this value will be used in place of mouse coordinates from Input system.
Will propagate down through Panel hierarchy from root to leaf controls.
Allows for custom pointer input from rays and other sources.
Input must be in "pixel coordinates" relatve to root panel dimensions.
For example, if root panel is 256x256 pixels then coordinates are between 0,0 and 255,255.
Declaration
public Vector2? CustomMousePosition { get; set; }
Property Value
|
Improve this Doc
View Source
Enabled
Gets or sets enabled flag.
Declaration
public bool Enabled { get; set; }
Property Value
|
Improve this Doc
View Source
HorizontalAlignment
Gets or sets horizontal alignment.
Declaration
public HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
|
Improve this Doc
View Source
InteriorHeight
Gets interior height between vertical margins.
Declaration
public int InteriorHeight { get; }
Property Value
|
Improve this Doc
View Source
InteriorWidth
Gets interior width between horizontal margins.
Declaration
public int InteriorWidth { get; }
Property Value
|
Improve this Doc
View Source
LastMousePosition
Gets previous mouse position from last update.
Declaration
public Vector2 LastMousePosition { get; }
Property Value
|
Improve this Doc
View Source
LeftMargin
Declaration
public int LeftMargin { get; set; }
Property Value
|
Improve this Doc
View Source
LocalScale
Gets local scale in screen space based on parent scale and scaling mode.
Declaration
public Vector2 LocalScale { get; }
Property Value
|
Improve this Doc
View Source
MaxAutoScale
Gets or sets upper autoscale clamp. 0 to disable.
Declaration
public float MaxAutoScale { get; set; }
Property Value
|
Improve this Doc
View Source
MinAutoScale
Gets or sets lower autoscale clamp. 0 to disable.
Declaration
public float MinAutoScale { get; set; }
Property Value
|
Improve this Doc
View Source
MouseOverBackgroundColor
Gets or sets alternate background colour when mouse is over control.
This colour will replace any other background colour for the time mouse is over control.
Declaration
public Color MouseOverBackgroundColor { get; set; }
Property Value
|
Improve this Doc
View Source
MouseOverComponent
True if mouse over this component.
Declaration
public bool MouseOverComponent { get; }
Property Value
|
Improve this Doc
View Source
MousePosition
Gets current mouse position from recent update.
Declaration
public Vector2 MousePosition { get; }
Property Value
|
Improve this Doc
View Source
Name
Declaration
public string Name { get; set; }
Property Value
|
Improve this Doc
View Source
OverridesHotkeySequences
Gets or sets flag to make control bypass hotkeys.
When enabled, hotkeys will not be interpreted while this control has focus.
Declaration
public bool OverridesHotkeySequences { get; set; }
Property Value
|
Improve this Doc
View Source
Parent
Declaration
public virtual BaseScreenComponent Parent { get; }
Property Value
|
Improve this Doc
View Source
Position
Gets position relative to parent panel.
Declaration
public virtual Vector2 Position { get; set; }
Property Value
|
Improve this Doc
View Source
Rectangle
Gets screen area occupied by component.
Declaration
public Rect Rectangle { get; }
Property Value
|
Improve this Doc
View Source
RectRestrictedRenderArea
Gets or sets a restricted render area for background rendering - the background will only be rendered inside the specified Rect's bounds
Declaration
public Rect RectRestrictedRenderArea { get; set; }
Property Value
|
Improve this Doc
View Source
RestrictedRenderAreaCoordinateType
Gets or sets the type of coordinate specification (e.g. absolute) of the restricted render area
Declaration
public BaseScreenComponent.RestrictedRenderArea_CoordinateType RestrictedRenderAreaCoordinateType { get; set; }
Property Value
|
Improve this Doc
View Source
RestrictedRenderAreaCustomParent
Gets or sets a custom panel for restricted memory area.
Declaration
public Panel RestrictedRenderAreaCustomParent { get; set; }
Property Value
|
Improve this Doc
View Source
RightMargin
Declaration
public int RightMargin { get; set; }
Property Value
|
Improve this Doc
View Source
RootSize
Gets or sets root size when no parent is avaialable.
Should only be set for root panel in UI stack.
If root size is not set then screen dimensions will be used.
Declaration
public Vector2 RootSize { get; set; }
Property Value
|
Improve this Doc
View Source
Scale
Gets or sets manual scale for when ScalingMode = None.
Declaration
public Vector2 Scale { get; set; }
Property Value
|
Improve this Doc
View Source
ScaledMousePosition
Gets scaled mouse position relative to top-left of this control.
If mouse is outside of control area this will return -1,-1.
Declaration
public Vector2 ScaledMousePosition { get; }
Property Value
|
Improve this Doc
View Source
Size
Declaration
public virtual Vector2 Size { get; set; }
Property Value
|
Improve this Doc
View Source
Gets or sets tooltip suppression, preventing tooltip from drawing.
Tooltip hover time will be scrubbed on resume.
Declaration
public bool SuppressToolTip { get; set; }
Property Value
|
Improve this Doc
View Source
Tag
Declaration
public object Tag { get; set; }
Property Value
|
Improve this Doc
View Source
Gets or sets tooltip for this component.
Declaration
public ToolTip ToolTip { get; set; }
Property Value
|
Improve this Doc
View Source
ToolTipText
Gets or sets tooltip text for this component.
Declaration
public string ToolTipText { get; set; }
Property Value
|
Improve this Doc
View Source
TopMargin
Declaration
public int TopMargin { get; set; }
Property Value
|
Improve this Doc
View Source
UseFocus
Gets or sets flag to make control focus-senstitive.
When enabled, this control will gain focus when clicked and lose focus when another control is clicked.
How focus is implemented depends on inherited control.
Declaration
public bool UseFocus { get; set; }
Property Value
|
Improve this Doc
View Source
UseRestrictedRenderArea
Check if restricted rendering area used.
Declaration
public bool UseRestrictedRenderArea { get; }
Property Value
|
Improve this Doc
View Source
VerticalAlignment
Gets or sets vertical alignment.
Declaration
public VerticalAlignment VerticalAlignment { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
Dispose()
Called when component is to be disposed.
Override if special handling needed
to dispose of component resources.
Declaration
public virtual void Dispose()
|
Improve this Doc
View Source
Draw()
Called when screen component should draw itself.
Declaration
public virtual void Draw()
|
Improve this Doc
View Source
GotFocus()
Called when control gains focus in window.
Declaration
public virtual void GotFocus()
|
Improve this Doc
View Source
HasFocus()
Checks if this control has focus.
Declaration
Returns
|
Improve this Doc
View Source
KeyboardEvent(Event)
KeyDown or KeyUp events that matches hotkey sequence
Returns whether the event could be delivered
Declaration
protected virtual bool KeyboardEvent(Event keyboardEvent)
Parameters
Type |
Name |
Description |
Event |
keyboardEvent |
|
Returns
|
Improve this Doc
View Source
LostFocus()
Called when control loses focus in window.
Declaration
public virtual void LostFocus()
|
Improve this Doc
View Source
MiddleMouseClick(Vector2)
Middle Mouse clicked inside control area.
Declaration
protected virtual void MiddleMouseClick(Vector2 clickPosition)
Parameters
Type |
Name |
Description |
Vector2 |
clickPosition |
|
|
Improve this Doc
View Source
MiddleMouseDoubleClick(Vector2)
Middle Mouse double-clicked inside control area.
Declaration
protected virtual void MiddleMouseDoubleClick(Vector2 clickPosition)
Parameters
Type |
Name |
Description |
Vector2 |
clickPosition |
|
|
Improve this Doc
View Source
MouseClick(Vector2)
Mouse clicked inside control area.
Declaration
protected virtual void MouseClick(Vector2 clickPosition)
Parameters
Type |
Name |
Description |
Vector2 |
clickPosition |
|
|
Improve this Doc
View Source
MouseDoubleClick(Vector2)
Mouse double-clicked inside control area.
Declaration
protected virtual void MouseDoubleClick(Vector2 clickPosition)
Parameters
Type |
Name |
Description |
Vector2 |
clickPosition |
|
|
Improve this Doc
View Source
MouseEnter()
Mouse entered control area.
Declaration
protected virtual void MouseEnter()
|
Improve this Doc
View Source
MouseLeave(BaseScreenComponent)
Mouse exited control area.
Declaration
protected virtual void MouseLeave(BaseScreenComponent sender)
Parameters
|
Improve this Doc
View Source
MouseMove(Int32, Int32)
Declaration
protected virtual void MouseMove(int x, int y)
Parameters
|
Improve this Doc
View Source
Mouse wheel scrolled down.
Declaration
protected virtual void MouseScrollDown()
|
Improve this Doc
View Source
Declaration
protected virtual void MouseScrollUp()
|
Improve this Doc
View Source
OffsetFrom(BaseScreenComponent, Sides, Int32)
Offsets position of component relative to another component.
Declaration
public void OffsetFrom(BaseScreenComponent component, Sides side, int distance)
Parameters
Type |
Name |
Description |
BaseScreenComponent |
component |
Component to offset against.
|
Sides |
side |
The side of the component to offset from.
|
Int32 |
distance |
Distance between offset components.
|
|
Improve this Doc
View Source
RightMouseClick(Vector2)
Right Mouse clicked inside control area.
Declaration
protected virtual void RightMouseClick(Vector2 clickPosition)
Parameters
Type |
Name |
Description |
Vector2 |
clickPosition |
|
|
Improve this Doc
View Source
RightMouseDoubleClick(Vector2)
Right Mouse double-clicked inside control area.
Declaration
protected virtual void RightMouseDoubleClick(Vector2 clickPosition)
Parameters
Type |
Name |
Description |
Vector2 |
clickPosition |
|
|
Improve this Doc
View Source
ScreenToLocal(Rect)
Converts a screen rect to a local rect relative to this control.
Declaration
public Rect ScreenToLocal(Rect screenRect)
Parameters
Type |
Name |
Description |
Rect |
screenRect |
Screen rect.
|
Returns
Type |
Description |
Rect |
Local rect.
|
|
Improve this Doc
View Source
ScreenToLocal(Vector2)
Converts a screen position to a local position relative to this control.
Declaration
public Vector2 ScreenToLocal(Vector2 screenPosition)
Parameters
Type |
Name |
Description |
Vector2 |
screenPosition |
Screen position.
|
Returns
Type |
Description |
Vector2 |
Local position.
|
|
Improve this Doc
View Source
SetFocus()
Set focus to this control.
Declaration
|
Improve this Doc
View Source
SetMargins(Margins, Int32)
Sets value for one or more margins using flags.
Declaration
public void SetMargins(Margins margin, int value)
Parameters
Type |
Name |
Description |
Margins |
margin |
Margin flags.
|
Int32 |
value |
Value to set.
|
|
Improve this Doc
View Source
TriggerMouseClick()
Manually trigger an OnMouseClick event for this component.
Declaration
public virtual void TriggerMouseClick()
|
Improve this Doc
View Source
Update()
Called when screen component should update itself.
Declaration
public virtual void Update()
Events
|
Improve this Doc
View Source
OnKeyboardEvent
Declaration
public event BaseScreenComponent.OnKeyboardEventHandler OnKeyboardEvent
Event Type
|
Improve this Doc
View Source
OnMiddleMouseClick
Declaration
public event BaseScreenComponent.OnMiddleMouseClickHandler OnMiddleMouseClick
Event Type
|
Improve this Doc
View Source
OnMiddleMouseDoubleClick
Declaration
public event BaseScreenComponent.OnMiddleMouseDoubleClickHandler OnMiddleMouseDoubleClick
Event Type
|
Improve this Doc
View Source
OnMiddleMouseDown
Declaration
public event BaseScreenComponent.OnMiddleMouseDownHandler OnMiddleMouseDown
Event Type
|
Improve this Doc
View Source
OnMiddleMouseUp
Declaration
public event BaseScreenComponent.OnMiddleMouseUpHandler OnMiddleMouseUp
Event Type
|
Improve this Doc
View Source
OnMouseClick
Declaration
public event BaseScreenComponent.OnMouseClickHandler OnMouseClick
Event Type
|
Improve this Doc
View Source
OnMouseDoubleClick
Declaration
public event BaseScreenComponent.OnMouseDoubleClickHandler OnMouseDoubleClick
Event Type
|
Improve this Doc
View Source
OnMouseDown
Declaration
public event BaseScreenComponent.OnMouseDownHandler OnMouseDown
Event Type
|
Improve this Doc
View Source
OnMouseEnter
Declaration
public event BaseScreenComponent.OnMouseEnterHandler OnMouseEnter
Event Type
|
Improve this Doc
View Source
OnMouseLeave
Declaration
public event BaseScreenComponent.OnMouseLeaveHandler OnMouseLeave
Event Type
|
Improve this Doc
View Source
OnMouseMove
Declaration
public event BaseScreenComponent.OnMouseMoveHandler OnMouseMove
Event Type
|
Improve this Doc
View Source
Declaration
public event BaseScreenComponent.OnMouseScrollDownEventHandler OnMouseScrollDown
Event Type
|
Improve this Doc
View Source
Declaration
public event BaseScreenComponent.OnMouseScrollUpEventHandler OnMouseScrollUp
Event Type
|
Improve this Doc
View Source
OnMouseUp
Declaration
public event BaseScreenComponent.OnMouseUpHandler OnMouseUp
Event Type
|
Improve this Doc
View Source
OnRightMouseClick
Declaration
public event BaseScreenComponent.OnRightMouseClickHandler OnRightMouseClick
Event Type
|
Improve this Doc
View Source
OnRightMouseDoubleClick
Declaration
public event BaseScreenComponent.OnRightMouseDoubleClickHandler OnRightMouseDoubleClick
Event Type
|
Improve this Doc
View Source
OnRightMouseDown
Declaration
public event BaseScreenComponent.OnRightMouseDownHandler OnRightMouseDown
Event Type
|
Improve this Doc
View Source
OnRightMouseUp
Declaration
public event BaseScreenComponent.OnRightMouseUpHandler OnRightMouseUp
Event Type