A list of child components for providing automatic callbacks for common interfaces.
sealed class
|
ObjectList
|
implements
|
IGraphicsComponent
|
||
IInputConsumerEx
|
|||||
extends
|
Initializable
|
||||
implements
|
IRenderPreparable
|
||||
IUpdateableFrameTime
|
Callbacks
for
IInputConsumer
are
performed
in
the
order
in
which
the
IInputConsumer
objects
have
been
added
to
this
list,
until
an
object
returns
true
from
ConsumeInput.
There are no automatic callbacks for Render and Render2D, since the issuing of render commands is usually tightly coupled with the render pipeline.
Returns the lifecycle state of this object.
public
override
property
|
LifecycleState
{
get
}
|
||
type
|
LifecycleState
|
||
value
|
The lifecycle state. | ||
inherited
|
Initializable.LifecycleState
|
Should the mouse be captured, because this input consumer only processes relative input?
public
property
|
ShouldCaptureMouse
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
the
mouse
should
be
captured,
false
if
not. |
||
implements
|
IInputConsumerEx.ShouldCaptureMouse
|
See also:
IApplicationWindow.MouseCapturedCreates a new instance of ObjectList.
public
constructor
|
ObjectList
()
|
Acquires a strong reference to this disposable object.
[OwnerReturn, ThreadSafe]
|
||||
public
method
|
AcquireTry
()
|
|||
type
|
IDisposable
|
|||
returns
|
this
if
a
new
strong
reference
has
been
acquired,
null
if
this
object
is
already
being
disposed.
|
|||
inherited
|
Disposable.AcquireTry
|
Remarks:
The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.
This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.
Consumes the given user input event.
public
method
|
ConsumeInput
(InputEvent inputEvent)
|
||
type
|
bool
|
||
params
|
inputEvent
|
The user input event. | |
returns
|
true
if
the
input
event
has
been
consumed,
false
if
not. |
||
implements
|
IInputConsumer.ConsumeInput
|
Remarks:
Input events are provided to an IInputConsumer object only if it has the input focus (see FocusGained and FocusLost). Mouse events are provided when the mouse cursor is inside of the input bounds (MouseEnter and MouseLeave). The Closing event can be provided at any time.
Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.
[Dispose, OwnerThis, ThreadSafe]
|
||||
public
method
|
Dispose
()
|
|||
inherited
|
Disposable.Dispose
|
Remarks:
The Dispose method silently returns if the object has already been disposed.
Attaches this component to the given Graphics context.
public
method
|
GraphicsAttach
(Graphics graphics)
|
||
params
|
graphics
|
[not-null]
|
The graphics context. |
implements
|
IGraphicsComponent.GraphicsAttach
|
Remarks:
All graphics-related resources should be created here.
Detaches this user interface component from its Graphics context.
public
method
|
GraphicsDetach
()
|
||
implements
|
IGraphicsComponent.GraphicsDetach
|
Remarks:
All graphics-related resources should be disposed here.
The screen size has changed.
public
method
|
GraphicsResize
(Vec2I screenSize)
|
||
params
|
screenSize
|
The new screen size, in pixels. | |
implements
|
IGraphicsComponent.GraphicsResize
|
Remarks:
The given screen size is equal to the value of ScreenSize of the Graphics object that has been passed to GraphicsAttach earlier.
Initializes the object, if necessary
public
method
|
Initialize
()
|
||
inherited
|
Initializable.Initialize
|
Remarks:
The Initialize method returns silently if the object is already in the state Initialized.
Attaches this input consumer to the given input state object.
public
method
|
InputAttach
(IInputState input)
|
||
params
|
input
|
[not-null]
|
The input state object. |
implements
|
IInputConsumerEx.InputAttach
|
Remarks:
The input state object provides a snapshot of the input keys and buttons. It should not be used to detect up/down/click events.
Detached this input consumer from its input state object.
public
method
|
InputDetach
()
|
||
implements
|
IInputConsumerEx.InputDetach
|
Adds an object to this list.
public
method
|
ObjectAdd
(object obj,
ObjectListFlags callbacks = ObjectListFlags.All)
|
||
params
|
obj
|
[not-null]
|
The object to add. |
callbacks
|
The callbacks to perform. Defaults to All. |
Remarks:
The following callbacks are performed immediately on obj:
Adds an owned object to this list.
public
method
|
ObjectAddOwn
([Owner]
IDisposable obj,
ObjectListFlags callbacks = ObjectListFlags.All)
|
||
params
|
obj
|
[not-null]
|
The object to add. |
callbacks
|
The callbacks to perform. Defaults to All. |
Remarks:
The following callbacks are performed immediately on obj:
Removes an object from this list.
public
method
|
ObjectRemove
(object obj)
|
||
params
|
obj
|
[not-null]
|
The object to remove. |
Remarks:
The following callbacks are performed immediately on obj:
Prepares rendering.
public
method
|
RenderPrepare
()
|
||
implements
|
IRenderPreparable.RenderPrepare
|
Remarks:
This method is called before Render, when the graphics context has not yet begun to render the scene.
All setup work that does not require a graphics context (e.g. matrix computation, per-frame visibility determination) should be done here. This can help to maximize parallelism between the CPU and the GPU.
This method is called once per application frame.
public
method
|
UpdateFrameTime
(float32 time)
|
||
type
|
bool
|
||
params
|
time
|
[>0]
|
The amount of time that has elapsed since the last frame, in seconds. |
returns
|
true
if
the
object
needs
to
be
presented
again,
false
if
the
current
presentation
is
still
valid.
|
||
implements
|
IUpdateableFrameTime.UpdateFrameTime
|