The object that can be drawn on screen
It can be positioned on screen (using X and Y), sized (using Width and Height) and rendered (using the Draw() method)
It can be positioned on screen (using X and Y), sized (using Width and Height) and rendered (using the Draw() method)

C# | Visual Basic | Visual C++ |
public abstract class DisplayObject : EventDispatcher, IDrawable, IDataHost
Public MustInherit Class DisplayObject _ Inherits EventDispatcher _ Implements IDrawable, IDataHost
public ref class DisplayObject abstract : public EventDispatcher, IDrawable, IDataHost

All Members | Constructors | Methods | Properties | Fields | |
Icon | Member | Description |
---|---|---|
![]() | DisplayObject()()()() | Initializes a new instance of the DisplayObject class |
![]() | AddEventListener(String, EventHandler, EventPhase, Int32) |
Adds the event listener
(Inherited from EventDispatcher.) |
![]() | AddEventListener(String, EventHandler, EventPhase) |
Adds the event listener
(Inherited from EventDispatcher.) |
![]() | AddEventListener(String, EventHandler) |
AddEventListener Overload
Assumes that useCapturePhase is false
(Inherited from EventDispatcher.) |
![]() | AddEventListener(String, EventHandler, Int32) |
Adds the event listener
(Inherited from EventDispatcher.) |
![]() | Alpha |
Alpha
|
![]() | AutoDisposeData | |
![]() | Bounds |
Bounds relative to Owner (bakes rect)
|
![]() | ColorEnd()()()() | |
![]() | ColorStart()()()() | |
![]() | ContainsPoint(Point, Boolean) |
Works with global coordinates (*RARE*) Returns true if bounds of this display object (or it's children if recursive) contains point This could be overriden and for instance checked against circle bounds, or by GlobalBounds but slightly expanded (for mobile) e.g. return GlobalBounds.Expand(20).Contains(point); |
![]() | Content |
GUIContent
This is the content used by Unity when rendering pieces of GUI
GUIContent consists of icon and label
|
![]() | Data |
The arbitrary data attached to this piece of GUI
|
![]() | DecreaseSkipFrameCount()()()() | |
![]() | Defer(DisplayObject..::..DeferedCall, Int32, array<Object>[]()[][]) |
Defers the function call for a given number of frames
|
![]() | DispatchEvent(Event, Boolean) |
Dispatches an event with the option of late processing (immediate = TRUE/FALSE)
(Inherited from EventDispatcher.) |
![]() | DispatchEvent(Event) |
Dispatches an event immediatelly
(Inherited from EventDispatcher.) |
![]() | Dispose()()()() | Releases all resources used by the DisplayObject (Overrides EventDispatcher.Dispose()()()().) |
![]() | Draw()()()() | |
![]() | EnqueueEvent(Event) |
Adds an event to the queue
The queue will be processed when ProcessQueue() manually executed
(Inherited from EventDispatcher.) |
![]() | Equals(Object) | (Inherited from Object.) |
![]() | ExecuteListeners(Event) |
Executes event handlers listening for a particular event type
(Inherited from EventDispatcher.) |
![]() | Finalize()()()() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | FirstShow |
The event that fires when the component is shown for the first time
|
![]() | FocusRender()()()() |
Post-draw logic
Renders focus rectangle
|
![]() | FocusRenderSignal |
The signal that emits just before the focus render
|
![]() | GetHashCode()()()() | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType()()()() | Gets the type of the current instance. (Inherited from Object.) |
![]() | HasBubblingEventListener(String) |
Returns true if there are any subscribers in bubbling hierarchy (Inherited from EventDispatcher.)Override in superclass |
![]() | HasEventListener(String) |
Returns true if EventDispatcher has any registered listeners for a specific type and phase
(Inherited from EventDispatcher.) |
![]() | Height |
The Height of the component
|
![]() | HideHandler |
The event that fires when the component is hidden
|
![]() | Initialize()()()() |
Initializes the component Called by the parent upon first addition Sets child's Owner and reference to Stage Sets Skin |
![]() | InitializeContent()()()() |
Initializes GUI content
|
![]() | InitializeStyle()()()() |
Initializes Style
|
![]() | InitTransform()()()() | |
![]() | InvalidateTransform()()()() |
A lifecycle method
Invalidates position
|
![]() | IsDefaultPrevented(String, Boolean) |
Exposes the cancelable event to the outside if there are listeners for that event type
If default prevented, returns false
If not, returns true
(Inherited from EventDispatcher.) |
![]() | IsDefaultPrevented(String) |
No-bubbling version
(Inherited from EventDispatcher.) |
![]() | LocalRenderingRect |
The rendering Rect
This is the optimization technique: since we are using Rectangle class for internal calculations, and Unity uses Rects to render components,
To avoid constant conversions from Rectangle to Rect, we are converting only when needed (when coordinates or size change)
We update this variable on change
|
![]() | MappedToAnyPhase(String, EventHandler, EventPhase) |
Returns true if handler is mapped to any of the specified phases
(Inherited from EventDispatcher.) |
![]() | MemberwiseClone()()()() | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() ![]() | MinScaleX |
A minimal X scale to fight the "Ignoring invalid matrix assinged to GUI.matrix - the matrix needs to be invertible. Did you scale by 0 on Z-axis" bug
|
![]() ![]() | MinScaleY |
A minimal Y scale to fight the "Ignoring invalid matrix assinged to GUI.matrix - the matrix needs to be invertible. Did you scale by 0 on Z-axis" bug
|
![]() | OverlayRender()()()() |
Post-draw logic
Renders component overlay layer
|
![]() | OverlayRenderSignal |
The signal that emits just before the overlay render
|
![]() | Position |
Position
|
![]() | PostRender()()()() |
Post-draw logic
Switching off Alpha, scrollbars and clipping
|
![]() | PostRenderSignal |
The signal that emits after render
|
![]() | PreRender()()()() |
Pre-draw logic
Switching on Alpha, scrollbars and clipping
|
![]() | PreRenderSignal |
The signal that emits before before render
|
![]() | ProcessEvent(Event) |
Could be overriden in a subclass (for instance to implement event bubbling)
(Inherited from EventDispatcher.) |
![]() | ProcessQueue()()()() |
If events are added to queue, they are waiting to be fired (Inherited from EventDispatcher.)in the same order they are added |
![]() | QVisible |
Note: never make this property virtual and override it
This property reflects the true nature of component visibility
This is important because the components are being hidden during the instantiation, and shown on creation complete
This is the way to find out the desired visibility state (some of them might want to be hidden)
|
![]() | RemoveAllListeners(String) |
Removes all listeners for the spacified event type (both capture and bubbling phase)
(Inherited from EventDispatcher.) |
![]() | RemoveAllListeners(String, EventPhase) |
Removes all listeners for the spacified event type and phases
(Inherited from EventDispatcher.) |
![]() | RemoveEventListener(String, EventHandler, EventPhase) |
Removes the event listener
(Inherited from EventDispatcher.) |
![]() | RemoveEventListener(String, EventHandler) |
Removes the event listener
(Inherited from EventDispatcher.) |
![]() | Render()()()() |
Actual draw logic
|
![]() | RenderDoneSignal |
The signal that emits after the render is complete
|
![]() | RenderingRect |
The rendering Rect
This is the optimization technique: since we are using Rectangle class for internal calculations, and Unity uses Rects to render components,
To avoid constant conversions from Rectangle to Rect, we are converting only when needed (when coordinates or size change)
We update this variable on change
|
![]() | RenderSignal |
The signal that emits before render
|
![]() | Rotation |
Rotation
The pivot point is the center of the component
|
![]() | RotationEnd()()()() | |
![]() | RotationPivot |
Rotation pivot
|
![]() | RotationStart()()()() | |
![]() | Scale |
Scale
The pivot point is the center of the component
|
![]() | ScaleEnd()()()() | |
![]() | ScaleStart()()()() | |
![]() | ShowHandler |
The event that fires when the component is shown
|
![]() | SkipRender(Int32) |
This is the approach of skipping the rendering process for N frames
Needed by effects which start tweening one frame too late
TODO: Investigate!
|
![]() | Tooltip |
Tooltip
|
![]() | ToString()()()() | Returns a string that represents the current object. (Inherited from Object.) |
![]() | Transform | |
![]() | Visible |
Is component Visible
If not, isn't processed by draw routine
|
![]() | Width |
The Width of the component
|
![]() | X |
X coordinate
|
![]() | Y |
Y coordinate
|

Object | |||
![]() | EventDispatcher | ||
![]() | DisplayObject | ||
![]() | DisplayListMember |