Generated by DocFX

Class VRC

Ladybug Virtual Resolution Container

Inheritance
System.Object
VRC
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Ladybug
Assembly: ladybug.dll
Syntax
public class VRC

Constructors

| Improve this Doc View Source

VRC(Scene, Int32, Int32)

Creates a new Virtual Resolution Container

Declaration
public VRC(Scene parentScene, int virtualWidth, int virtualHeight)
Parameters
Type Name Description
Scene parentScene

Parent Scene

System.Int32 virtualWidth

Virtual Resolution Width

System.Int32 virtualHeight

Virtual Resolution Height

Properties

| Improve this Doc View Source

ActualAspectRatio

Actual aspect ratio of the application window

Declaration
public float ActualAspectRatio { get; }
Property Value
Type Description
System.Single
| Improve this Doc View Source

BackgroundColor

Background color of the VRC. Affects the color of Letterbox bars

Declaration
public Color BackgroundColor { get; }
Property Value
Type Description
Microsoft.Xna.Framework.Color
| Improve this Doc View Source

Canvas

The Canvas contains the content the VRC is rendering, which automatically resizes to maintain aspect ratio as the game window size changes

Declaration
public Rectangle Canvas { get; }
Property Value
Type Description
Microsoft.Xna.Framework.Rectangle
| Improve this Doc View Source

GraphicsDevice

GraphicsDevice of the parent Game instance

Declaration
public GraphicsDevice GraphicsDevice { get; }
Property Value
Type Description
Microsoft.Xna.Framework.Graphics.GraphicsDevice
| Improve this Doc View Source

PreferredAspectRatio

Virtual aspect ratio the VRC will maintain as window size changes

Declaration
public float PreferredAspectRatio { get; }
Property Value
Type Description
System.Single
| Improve this Doc View Source

Scale

Calculated scale of the VRC's canvas

Declaration
public Vector2 Scale { get; }
Property Value
Type Description
Microsoft.Xna.Framework.Vector2
| Improve this Doc View Source

TransformMatrix

Matrix representing this VRC's size, scale, and rotation

Declaration
public Matrix TransformMatrix { get; }
Property Value
Type Description
Microsoft.Xna.Framework.Matrix
| Improve this Doc View Source

VirtualHeight

Virtual height value of the VRC's canvas

Declaration
public int VirtualHeight { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

VirtualWidth

Virtual width value of the VRC's canvas

Declaration
public int VirtualWidth { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Window

Window of the parent Game instance

Declaration
public GameWindow Window { get; }
Property Value
Type Description
Microsoft.Xna.Framework.GameWindow

Methods

| Improve this Doc View Source

Draw(GameTime, SpriteBatch)

Draws all content handled by the VRC to its canvas, then draws the canvas centered within the game window

Declaration
public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
Parameters
Type Name Description
Microsoft.Xna.Framework.GameTime gameTime
Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch
| Improve this Doc View Source

OnDraw(Action<GameTime, SpriteBatch>)

Sets the action performed when the VRC is drawn to the screen

Declaration
public void OnDraw(Action<GameTime, SpriteBatch> action)
Parameters
Type Name Description
System.Action<Microsoft.Xna.Framework.GameTime, Microsoft.Xna.Framework.Graphics.SpriteBatch> action
Remarks

Use this to draw to the VRC's canvas

| Improve this Doc View Source

OnDrawBackground(Action<GameTime, SpriteBatch>)

Sets the action performed when the VRC is drawing the background behind its canvas

Declaration
public void OnDrawBackground(Action<GameTime, SpriteBatch> action)
Parameters
Type Name Description
System.Action<Microsoft.Xna.Framework.GameTime, Microsoft.Xna.Framework.Graphics.SpriteBatch> action
Remarks

Use this to set a texture/image for letterboxes

| Improve this Doc View Source

ScreenToCanvasSpace(Vector2)

Converts a Vector2 coordinate from screen space to a location relative to the VRC's canvas

Declaration
public Vector2 ScreenToCanvasSpace(Vector2 position)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 position
Returns
Type Description
Microsoft.Xna.Framework.Vector2