Class VirtualScreenManager
Viewport Category Model class.
Inheritance
Implements
Inherited Members
Namespace: Evergine.Framework.Managers
Assembly: Evergine.Framework.dll
Syntax
public class VirtualScreenManager : SceneManager, IDependencyObject
Constructors
VirtualScreenManager()
Initializes a new instance of the Virtual
Declaration
public VirtualScreenManager()
Fields
height
The height.
Declaration
protected float height
Field Value
Type | Description |
---|---|
float |
width
The width.
Declaration
protected float width
Field Value
Type | Description |
---|---|
float |
Properties
BottomEdge
Gets the bottom.
Declaration
public float BottomEdge { get; }
Property Value
Type | Description |
---|---|
float |
Expand
Gets or sets a value indicating whether this is expanded.
Declaration
public bool Expand { get; set; }
Property Value
Type | Description |
---|---|
bool |
|
LeftEdge
Gets the left.
Declaration
public float LeftEdge { get; }
Property Value
Type | Description |
---|---|
float |
RatioX
Gets Ratio X.
Declaration
public float RatioX { get; }
Property Value
Type | Description |
---|---|
float |
Exceptions
Type | Condition |
---|---|
Invalid |
the ViewportManager isn't activated. |
RatioY
Gets Ratio Y.
Declaration
public float RatioY { get; }
Property Value
Type | Description |
---|---|
float |
Exceptions
Type | Condition |
---|---|
Invalid |
the ViewportManager isn't activated. |
RightEdge
Gets the right.
Declaration
public float RightEdge { get; }
Property Value
Type | Description |
---|---|
float |
ScreenHeight
Gets the height of the screen.
Declaration
public float ScreenHeight { get; }
Property Value
Type | Description |
---|---|
float |
Exceptions
Type | Condition |
---|---|
Invalid |
the ViewportManager isn't activated. |
ScreenToVirtualTransform
Gets the matrix that transform from screen space to virtual space.
Declaration
public Matrix4x4 ScreenToVirtualTransform { get; }
Property Value
Type | Description |
---|---|
Matrix4x4 |
ScreenWidth
Gets the width of the screen.
Declaration
public float ScreenWidth { get; }
Property Value
Type | Description |
---|---|
float |
Exceptions
Type | Condition |
---|---|
Invalid |
the ViewportManager isn't activated. |
Stretch
Gets or sets the stretch.
Declaration
public StretchMode Stretch { get; set; }
Property Value
Type | Description |
---|---|
Stretch |
Exceptions
Type | Condition |
---|---|
Invalid |
the ViewportManager isn't activated. |
TopEdge
Gets the top.
Declaration
public float TopEdge { get; }
Property Value
Type | Description |
---|---|
float |
VirtualHeight
Gets or sets the height of the virtual.
Declaration
public float VirtualHeight { get; set; }
Property Value
Type | Description |
---|---|
float |
Exceptions
Type | Condition |
---|---|
Invalid |
the ViewportManager isn't activated. |
VirtualScreenRectangle
Gets the virtual screen rectangle.
Declaration
public RectangleF VirtualScreenRectangle { get; }
Property Value
Type | Description |
---|---|
Rectangle |
The screen rectangle. |
VirtualWidth
Gets or sets the width of the virtual.
Declaration
public float VirtualWidth { get; set; }
Property Value
Type | Description |
---|---|
float |
Exceptions
Type | Condition |
---|---|
Invalid |
the ViewportManager isn't activated. |
Methods
OnAttached()
Invoked when the object is attached to the system.
Declaration
protected override bool OnAttached()
Returns
Type | Description |
---|---|
bool | True if all is OK. |
Overrides
Refresh()
Updates the properties.
Declaration
public void Refresh()
ToScreen(ref Rectangle)
Translates the specified rectangle.
Declaration
public void ToScreen(ref Rectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
Rectangle | rectangle | The rectangle. |
ToScreen(ref RectangleF)
Translates from viewport rectangle to final screen rectangle.
Declaration
public void ToScreen(ref RectangleF rectangle)
Parameters
Type | Name | Description |
---|---|---|
Rectangle |
rectangle | The rectangle. |
ToScreen(ref Vector2, ref Vector2)
Translates from viewport position and scale to final screen position and scale.
Declaration
public void ToScreen(ref Vector2 position, ref Vector2 scale)
Parameters
ToScreenPosition(ref Vector2)
Translates from viewport position to final screen position.
Declaration
public void ToScreenPosition(ref Vector2 position)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The position. |
ToScreenScale(ref Vector2)
Translates from viewport scale to final screen scale.
Declaration
public void ToScreenScale(ref Vector2 scale)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | scale | The scale. |
ToScreenX(float)
Translates from viewport position X to final screen X.
Declaration
public float ToScreenX(float x)
Parameters
Type | Name | Description |
---|---|---|
float | x | The x. |
Returns
Type | Description |
---|---|
float | final screen x. |
ToScreenY(float)
Translates from viewport position Y to final screen Y.
Declaration
public float ToScreenY(float y)
Parameters
Type | Name | Description |
---|---|---|
float | y | The y. |
Returns
Type | Description |
---|---|
float | final screen y. |
ToVirtual(ref Rectangle)
Recover from the specified rectangle.
Declaration
public void ToVirtual(ref Rectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
Rectangle | rectangle | The rectangle. |
ToVirtual(ref RectangleF)
Recover from the specified rectangle.
Declaration
public void ToVirtual(ref RectangleF rectangle)
Parameters
Type | Name | Description |
---|---|---|
Rectangle |
rectangle | The rectangle. |
ToVirtual(ref Vector2, ref Vector2)
Recover from final screen position and scale to viewport manager position and scale.
Declaration
public void ToVirtual(ref Vector2 position, ref Vector2 scale)
Parameters
ToVirtualPosition(ref Vector2)
Recovers from final screen position to viewport position.
Declaration
public void ToVirtualPosition(ref Vector2 position)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The position. |
ToVirtualScale(ref Vector2)
Recovers from final screen scale to viewport scale.
Declaration
public void ToVirtualScale(ref Vector2 scale)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | scale | The scale. |
ToVirtualX(float)
Recovers from final screen position X to viewport screen X.
Declaration
public float ToVirtualX(float x)
Parameters
Type | Name | Description |
---|---|---|
float | x | The x. |
Returns
Type | Description |
---|---|
float | final screen x. |
ToVirtualY(float)
Recovers from final screen position Y to viewport screen Y.
Declaration
public float ToVirtualY(float y)
Parameters
Type | Name | Description |
---|---|---|
float | y | The y. |
Returns
Type | Description |
---|---|
float | final screen y. |
UpdateProperties(float, float, StretchMode, bool)
Activates the virtual screen manager with a specific parameters.
Declaration
public void UpdateProperties(float virtualWidth, float virtualHeight, StretchMode stretch, bool expand = true)
Parameters
Type | Name | Description |
---|---|---|
float | virtualWidth | Width of the virtual. |
float | virtualHeight | Height of the virtual. |
Stretch |
stretch | The stretch. |
bool | expand | if set to |
Events
OnRefresh
The viewport manager has been refreshed
Declaration
public event EventHandler<VirtualScreenManager> OnRefresh
Event Type
Type | Description |
---|---|
Event |