47 private Vector2 _posPx;
81 Rectangle? screenBounds,
82 Rectangle? worldBounds,
84 : base(renderSurfaceHost, mode, sceneLayer, view, screenBounds, worldBounds, name)
87 _posPx =
new Vector2(bounds.X, bounds.Y);
210 int x = (int)MathF.Round(p.X);
211 int y = (int)MathF.Round(p.Y);
216 WorldBounds =
new Rectangle(x, y, r.Width, r.Height);
233 void IDirectCompositeChild.SetZOrder(
int zOrder)
238 void IDirectCompositeChild.SetOpacity(
float opacity)
243 void IDirectCompositeChild.FadeTo(
float targetOpacity,
float durationSec)
282 HighResTimer.GetDuration(
_lastTick, tick);
int ZOrder
Gets or sets the Z-order (depth) used for sorting this direct drawing relative to other drawables.
View? View
Gets the view to which this direct drawing is attached, or null if the drawing is in scene-layer mode...
long _lastTick
The last engine tick value used for delta-time calculations in Update.
bool Visible
Gets or sets a value indicating whether this direct drawing is visible and should be rendered.
float Opacity
Gets or sets the current opacity of this direct drawing.
SceneLayer? SceneLayer
Gets the scene layer to which this direct drawing is attached, or null if the drawing is in view mode...
Rectangle WorldBounds
Gets or sets the world-space bounds of this direct drawing in pixels.
DirectDrawingMode Mode
Gets the drawing mode that determines how this direct drawing is positioned and transformed.
DirectDrawingBase(RenderSurfaceHostBase renderSurfaceHost, DirectDrawingMode mode, SceneLayer? sceneLayer, View? view, Rectangle? screenBounds, Rectangle? worldBounds, string? nickname=null)
Initializes a new instance of the DirectDrawingBase class.
Rectangle ScreenBounds
Gets or sets the screen-space bounds of this direct drawing in pixels.
Vector2 GetPosition()
Gets the current position of this direct drawing in pixel coordinates.
override void Update(long tick)
Advances this direct drawing's movement using the elapsed time since its previous update,...
DirectDrawingMovableBase(RenderSurfaceHostBase renderSurfaceHost, DirectDrawingMode mode, SceneLayer? sceneLayer, View? view, Rectangle? screenBounds, Rectangle? worldBounds, string? name=null)
Initializes a new instance of the DirectDrawingMovableBase class with integrated movement capabilitie...
MovementSpace PositionSpace
Gets the coordinate space in which this movable object's position is expressed.
void SetPosition(Vector2 p)
Sets the position of this direct drawing to the specified pixel coordinates.
MovementController Movement
Gets the movement controller responsible for changing this direct drawing's position over time.
Central controller responsible for managing all movement modes for a single IMovable object....
Represents a base class for hosting a render surface, providing functionality for managing rendering ...
Defines a movable direct drawable that may be owned by a DirectComposite.
void SetIsVisible(bool visible)
Applies a visibility value to this child.
DirectDrawingMode
Specifies where direct drawing operations are applied within the rendering pipeline.
@ SceneLayer
Performs direct drawing within a scene layer using world-space coordinates.
MovementSpace
Specifies the coordinate system used for movement calculations and updates.
Represents the current motion state of an IMovable object, including velocity, acceleration,...