GeonBit.UI Documentation
Entity Class |
Basic UI entity.
All entities inherit from this class and share this API.

Namespace: GeonBit.UI.Entities
Assembly: GeonBit.UI (in GeonBit.UI.dll) Version: 1.0.0.0 (1.0.0.0)

C#
public class Entity
The Entity type exposes the following members.


Name | Description | |
---|---|---|
![]() | Background |
Optional background entity that will not respond to events and will always be rendered right behind this entity.
|
![]() | Draggable |
Is the entity draggable (eg can a user grab it and drag it around).
|
![]() | EntityDefaultSize |
Return the default size for this entity.
|
![]() | FillColor |
Entity fill color - this is just a sugarcoat to access the default fill color style property.
|
![]() | InternalDestRect |
Get internal destination rect.
|
![]() | IsDirty |
Get if this entity needs to recalculate destination rect.
|
![]() | IsFocused | Does this entity or one of its children currently focused? |
![]() | IsMouseDown |
Return if the mouse is currently pressing on this entity (eg over it and left mouse button is down).
|
![]() | IsMouseOver |
Return if the mouse is currently over this entity (regardless of weather or not mouse button is down).
|
![]() | Opacity |
Entity fill color opacity - this is just a sugarcoat to access the default fill color alpha style property.
|
![]() | OutlineColor |
Entity outline color - this is just a sugarcoat to access the default outline color style property.
|
![]() | OutlineOpacity |
Entity outline color opacity - this is just a sugarcoat to access the default outline color alpha style property.
|
![]() | OutlineWidth |
Entity outline width - this is just a sugarcoat to access the default outline color style property.
|
![]() | Padding |
Entity padding - this is just a sugarcoat to access the default padding style property.
|
![]() | Parent |
Get the direct parent of this entity.
|
![]() | Priority |
Return entity priority in drawing order and event handling.
|
![]() | Scale |
Entity scale - this is just a sugarcoat to access the default scale style property.
|
![]() | ShadowColor |
Entity shadow color - this is just a sugarcoat to access the default shadow color style property.
|
![]() | ShadowOffset |
Entity shadow offset - this is just a sugarcoat to access the default shadow offset style property.
|
![]() | ShadowScale |
Entity shadow scale - this is just a sugarcoat to access the default shadow scale style property.
|
![]() | Size |
Entity current size property.
|
![]() | SpaceAfter |
Extra space (in pixels) to reserve *after* this entity when using Auto Anchors.
|
![]() | SpaceBefore |
Extra space (in pixels) to reserve *before* this entity when using Auto Anchors.
|
![]() | State |
Current entity state (default / mouse hover / mouse down..).
|
![]() | Visible |
Set / get visibility.
|

Name | Description | |
---|---|---|
![]() | AddChild |
Add a child entity.
|
![]() | BringToFront |
Bring this entity to be on front (inside its parent).
|
![]() | CalcDestRect |
Calculate and return the destination rectangle, eg the space this entity is rendered on.
|
![]() | CalcInternalRect |
Calculate and return the internal destination rectangle (note: this relay on the dest rect having a valid value first).
|
![]() | ClearChildren |
Remove all children entities.
|
![]() | Draw |
Draw this entity and its children.
|
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | Find(String, Boolean) |
Find and return first occurance of a child entity with a given identifier.
|
![]() | FindT(String, Boolean) |
Find and return first occurance of a child entity with a given identifier and specific type.
|
![]() | GetActiveStyle |
Return stylesheet property for current entity state (or default if undefined for state).
|
![]() | GetActualDestRect |
Return actual destination rectangle.
This can be override and implemented by things like Paragraph, where the actual destination rect is based on
text content, font and word-wrap.
|
![]() | GetChildren |
Return all children of this entity.
|
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object.) |
![]() | GetRelativeOffset |
Return the relative offset, in pixels, from parent top-left corner.
|
![]() | GetStyleProperty |
Return stylesheet property for a given state.
|
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | IsDeepChildOf |
Check if this entity is a descendant of another entity.
This goes up all the way to root.
|
![]() | IsDisabled |
Return if this entity is currently disabled, due to self or one of the parents / grandparents being disabled.
|
![]() | IsInsideEntity |
Test if a given point is inside entity's boundaries.
|
![]() | IsLocked |
Return if this entity is currently locked, due to self or one of the parents / grandparents being locked.
|
![]() | IsNaturallyInteractable |
Return true if this entity is naturally interactable, like buttons, lists, etc.
Entities that are not naturally interactable are things like paragraph, colored rectangle, icon, etc.
|
![]() | IsVisible |
Return if this entity is currently visible, eg this and all its parents and grandparents are visible.
|
![]() | IterateChildren |
Iterate over children and call 'callback' for every direct child of this entity.
|
![]() | MarkAsDirty |
Mark that this entity boundaries or style changed and it need to recalculate cached destination rect and other things.
|
![]() | PropagateEventsTo |
Propagate all events trigger by this entity to a given other entity.
For example, if "OnClick" will be called on this entity, it will trigger OnClick on 'other' as well.
|
![]() | RemoveChild |
Remove child entity.
|
![]() | RemoveFromParent |
Remove this entity from its parent.
|
![]() | SetAnchor |
Set the anchor of this entity.
|
![]() | SetOffset |
Set the offset of this entity.
|
![]() | SetPosition |
Set the position and anchor of this entity.
|
![]() | SetStyleProperty |
Set a stylesheet property.
|
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | Update |
Called every frame to update entity state and call events.
|
![]() | UpdateDestinationRects |
Update dest rect and internal dest rect.
This is called internally whenever a change is made to the entity or its parent.
|
![]() | UpdateDestinationRectsIfDirty |
Update dest rect and internal dest rect, but only if needed (eg if something changed since last update).
|
![]() | UpdateStyle |
Update the entire stylesheet from a different stylesheet.
|

Name | Description | |
---|---|---|
![]() | AfterDraw | Callback to execute every frame after this entity is rendered. |
![]() | AfterUpdate | Callback to execute every frame after this entity updates. |
![]() | AttachedData | Optional data you can attach to this entity and retrieve later (for example when handling events). |
![]() | BeforeDraw | Callback to execute every frame before this entity is rendered. |
![]() | BeforeUpdate | Callback to execute every frame before this entity updates. |
![]() | ClickThrough |
If this boolean is true, events will just "go through" this entity to its children or entities behind it.
This bool comes to solve conditions where you have two panels without skin that hide each other but you want
users to be able to click on the bottom panel through the upper panel, provided it doesn't hit any of the first
panel's children.
|
![]() ![]() | DefaultSize | Default size this entity will have when no size is provided or when -1 is set for either width or height. |
![]() ![]() | DefaultStyle | Basic default style that all entities share. Note: loaded from UI theme xml file. |
![]() | Disabled | If true, this entity and its children will be drawn in greyscale effect and will not respond to events. |
![]() | ExtraMargin |
Adds extra space outside the dest rect for collision detection.
In other words, if extra margin is set to 10 and the user points with its mouse 5 pixels above this entity,
it would still think the user points on the entity.
|
![]() | Identifier | Optional identifier you can attach to entities so you can later search and retrieve by. |
![]() | LimitDraggingToParentBoundaries | If true, users will not be able to drag this entity outside its parent boundaries. |
![]() | Locked | If true, this entity and its children will not respond to events (but will be drawn normally, unlike when disabled). |
![]() | OnClick | Callback to execute when user clicks on this entity (eg release mouse over it). |
![]() | OnFocusChange | Callback to execute every time this entity focus / unfocus. |
![]() | OnMouseDown | Callback to execute when mouse button is pressed over this entity (called once when button is pressed). |
![]() | OnMouseEnter | Callback to execute when mouse start hovering over this entity (eg enters its region). |
![]() | OnMouseLeave | Callback to execute when mouse stop hovering over this entity (eg leaves its region). |
![]() | OnMouseReleased | Callback to execute when mouse button is released over this entity (called once when button is released). |
![]() | OnMouseWheelScroll | Callback to execute when mouse wheel scrolls and this entity is the active entity. |
![]() | OnStartDrag | Called when entity starts getting dragged (only if draggable). |
![]() | OnStopDrag | Called when entity stop getting dragged (only if draggable). |
![]() | OnValueChange | Callback to execute when entity value changes (relevant only for entities with value). |
![]() | OnVisiblityChange | Callback to execute every time the visibility of this entity changes (also invokes when parent becomes invisible / visible again). |
![]() | PromiscuousClicksMode | If in promiscuous mode, mouse button is pressed *outside* the entity and then released on the entity, click event will be fired.
If false, in order to fire click event the mouse button must be pressed AND released over this entity (but can travel outside while being
held down, as long as its released inside).
Note: Windows default behavior is non promiscuous mode. |
![]() | ToolTipText |
Optional tooltip text to show if the user points on this entity for long enough.
|
![]() ![]() | USE_DEFAULT_SIZE |
A special size used value to use when you want to get the entity default size.
|
![]() | UseActualSizeForCollision |
If true (default), will use the actual object size for collision detection. If false, will use the size property.
This is useful for paragraphs, for example, where the actual width is based on text content and can vary and be totally
different than the size set in the constructor.
|
![]() | WhileDragging | Called every frame while the entity is being dragged. |
![]() | WhileMouseDown | Callback to execute every frame while mouse button is pressed over the entity. |
![]() | WhileMouseHover | Callback to execute every frame while mouse is hovering over the entity. |

Reference

SystemObject
GeonBit.UI.EntitiesEntity
GeonBit.UI.EntitiesButton
GeonBit.UI.EntitiesCheckBox
GeonBit.UI.EntitiesColoredRectangle
GeonBit.UI.EntitiesDropDown
GeonBit.UI.EntitiesHorizontalLine
GeonBit.UI.EntitiesImage
GeonBit.UI.EntitiesLineSpace
GeonBit.UI.EntitiesPanel
GeonBit.UI.EntitiesPanelTabs
GeonBit.UI.EntitiesParagraph
GeonBit.UI.EntitiesSlider
GeonBit.UI.EntitiesEntity
GeonBit.UI.EntitiesButton
GeonBit.UI.EntitiesCheckBox
GeonBit.UI.EntitiesColoredRectangle
GeonBit.UI.EntitiesDropDown
GeonBit.UI.EntitiesHorizontalLine
GeonBit.UI.EntitiesImage
GeonBit.UI.EntitiesLineSpace
GeonBit.UI.EntitiesPanel
GeonBit.UI.EntitiesPanelTabs
GeonBit.UI.EntitiesParagraph
GeonBit.UI.EntitiesSlider