IScreenObject Interface
Definition
Section titled “Definition”A generic object processed by SadConsole. Provides parent/child, components, position, and input callbacks.
public interface IScreenObject : IPositionable, IComponentHostProperties
Section titled “Properties”SortOrder
Section titled “SortOrder”Indicates the sorting order this object should use when parented. Sorting is a manual operation on the Children collection.
uint SortOrder { get; set; }FocusedMode
Section titled “FocusedMode”How the object should handle becoming active.
FocusBehavior FocusedMode { get; set; }AbsolutePosition
Section titled “AbsolutePosition”A position that’s based on the current SadRogue.Primitives.IPositionable.Position, as interpreted by the implementing class, in pixels.
Point AbsolutePosition { get; }Remarks
Section titled “Remarks”Most objects will implement this property based on SadRogue.Primitives.IPositionable.Position which usually depends on the Parent object’s position.
IgnoreParentPosition
Section titled “IgnoreParentPosition”When true, this object should ignore it’s parent position when calculating AbsolutePosition; otherwise false.
bool IgnoreParentPosition { get; set; }Children
Section titled “Children”The child objects of this instance.
ScreenObjectCollection Children { get; }IsEnabled
Section titled “IsEnabled”Gets or sets the visibility of this object.
bool IsEnabled { get; set; }IsExclusiveMouse
Section titled “IsExclusiveMouse”Gets or sets whether or not this object has exclusive access to the mouse events.
bool IsExclusiveMouse { get; set; }IsFocused
Section titled “IsFocused”Gets or sets this console as the focused object for input.
bool IsFocused { get; set; }IsVisible
Section titled “IsVisible”Gets or sets the visibility of this object.
bool IsVisible { get; set; }Parent
Section titled “Parent”The parent object that this instance is a child of.
IScreenObject? Parent { get; set; }UseKeyboard
Section titled “UseKeyboard”When true, this object will use the keyboard; otherwise false.
bool UseKeyboard { get; set; }UseMouse
Section titled “UseMouse”When true, this object will use the mouse; otherwise false.
bool UseMouse { get; set; }Methods
Section titled “Methods”Render(TimeSpan)
Section titled “Render(TimeSpan)”Draws all SadComponents and Children.
void Render(TimeSpan delta)Parameters
Section titled “Parameters”delta TimeSpan
The time that has elapsed since the last call.
Remarks
Section titled “Remarks”Only processes if IsVisible is true.
OnFocused()
Section titled “OnFocused()”Called when this object is focused.
void OnFocused()OnFocusLost()
Section titled “OnFocusLost()”Called when this object’s focus has been lost.
void OnFocusLost()ProcessKeyboard(Keyboard)
Section titled “ProcessKeyboard(Keyboard)”Called by the engine to process the keyboard.
bool ProcessKeyboard(Keyboard keyboard)Parameters
Section titled “Parameters”keyboard Keyboard
Keyboard information.
Returns
Section titled “Returns”bool
True when the keyboard had data and this console did something with it.
ProcessMouse(MouseScreenObjectState)
Section titled “ProcessMouse(MouseScreenObjectState)”Processes the mouse.
bool ProcessMouse(MouseScreenObjectState state)Parameters
Section titled “Parameters”state MouseScreenObjectState
The mouse state related to this object.
Returns
Section titled “Returns”bool
True when this object should halt further mouse processing..
LostMouse(MouseScreenObjectState)
Section titled “LostMouse(MouseScreenObjectState)”Called when the mouse is being used by something else.
void LostMouse(MouseScreenObjectState state)Parameters
Section titled “Parameters”state MouseScreenObjectState
The current state of the mouse based on this object.
Update(TimeSpan)
Section titled “Update(TimeSpan)”Updates all SadComponents and Children.
void Update(TimeSpan delta)Parameters
Section titled “Parameters”delta TimeSpan
The time that has elapsed since the last call.
Remarks
Section titled “Remarks”Only processes if IsEnabled is true.
UpdateAbsolutePosition()
Section titled “UpdateAbsolutePosition()”Sets a value for AbsolutePosition based on the SadRogue.Primitives.IPositionable.Position of this instance and the Parent instance.
void UpdateAbsolutePosition()Events
Section titled “Events”IsEnabledChanged
Section titled “IsEnabledChanged”Raised when the IsEnabled property changes.
event EventHandler IsEnabledChangedEvent Type
Section titled “Event Type”ParentChanged
Section titled “ParentChanged”Raised when the Parent property changes.
event EventHandler<ValueChangedEventArgs<IScreenObject?>> ParentChangedEvent Type
Section titled “Event Type”EventHandler<ValueChangedEventArgs<IScreenObject>>
IsVisibleChanged
Section titled “IsVisibleChanged”Raised when the IsVisible property changes.
event EventHandler IsVisibleChangedEvent Type
Section titled “Event Type”FocusLost
Section titled “FocusLost”Raised when the IsFocused property is false.
event EventHandler FocusLostEvent Type
Section titled “Event Type”Focused
Section titled “Focused”Raised when the IsFocused property is true.
event EventHandler Focused