• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Inferno
    • CollisionMode
    • DrawMode
    • Game
    • Game.OnResizeEventArgs
    • GameState
    • GameState.StateOnDrawEventArgs
    • GameWindow
    • Instance
    • MathHelper
    • Matrix
    • Point
    • Rectangle
    • Settings
    • SpatialMode
    • UpdateMode
    • Vector2
    • Vector3
    • Vector4
  • Inferno.Audio
    • AudioDevice
    • Sound
  • Inferno.Content
    • ContentLoader
  • Inferno.Formats.Audio
    • WaveFormat
  • Inferno.Formats.Graphics.Text
    • FontFormat
  • Inferno.Graphics
    • Camera
    • Color
    • GraphicsDevice
    • PlatformType
    • Renderable
    • RenderableType
    • Renderer
    • RenderSortMode
    • RenderTarget
    • Shader
    • ShaderLanguage
    • ShaderType
    • Sprite
    • Texture2D
    • Tileset
  • Inferno.Graphics.Text
    • Font
    • FontBuilder
  • Inferno.Input
    • ButtonState
    • Key
    • Keyboard
    • Keyboard.KeyEventArgs
    • KeyboardState
    • KeyState
    • Mouse
    • MouseState
  • Inferno.Tiled
    • RenderOrder
    • TiledLayer
    • TiledLayerChunk
    • TiledLoader
    • TiledMap
    • TiledMapOrientation
    • TiledObject
    • TiledObjectLayer
    • TiledVersion
  • Inferno.UI
    • MessageBox
    • MessageBoxType
    • UserInterface
  • Inferno.UI.Controls
    • Button
    • Control
    • Control.ControlClickedEvent
    • Control.ControlHoveredEvent
    • Control.TextChangedEventArgs
    • ControlState
    • Cursor
    • Label

Struct Rectangle

Implements
System.IEquatable<Rectangle>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: Inferno
Assembly: Inferno.Desktop.dll
Syntax
public struct Rectangle : IEquatable<Rectangle>

Constructors

| Improve this Doc View Source

Rectangle(Int32, Int32, Int32, Int32)

Create a new rectangle

Declaration
public Rectangle(int x, int y, int width, int height)
Parameters
Type Name Description
System.Int32 x

X coordinate

System.Int32 y

Y coordinate

System.Int32 width

Width

System.Int32 height

Height

Fields

| Improve this Doc View Source

Height

The height of the rectangle

Declaration
public int Height
Field Value
Type Description
System.Int32
| Improve this Doc View Source

Width

The width of the rectangle.

Declaration
public int Width
Field Value
Type Description
System.Int32
| Improve this Doc View Source

X

The X coordinate of the rectangle.

Declaration
public int X
Field Value
Type Description
System.Int32
| Improve this Doc View Source

Y

The Y coordinate of the rectangle

Declaration
public int Y
Field Value
Type Description
System.Int32

Properties

| Improve this Doc View Source

Bottom

The coordinate of the bottommost side

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

Center

The center point of the rectanlge

Declaration
public Point Center { get; }
Property Value
Type Description
Point
| Improve this Doc View Source

Left

The coordinate of the leftmost side

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

Location

The rectangle location expressed as a point

Declaration
public Point Location { get; set; }
Property Value
Type Description
Point
| Improve this Doc View Source

Right

The coordinate of the rightmost side

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

Size

The size of the rectangle expressed as a point

Declaration
public Point Size { get; set; }
Property Value
Type Description
Point
| Improve this Doc View Source

Top

The coordinate of the topmost side

Declaration
public int Top { get; }
Property Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

Contains(Point)

Declaration
public bool Contains(Point value)
Parameters
Type Name Description
Point value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Contains(Vector2)

Declaration
public bool Contains(Vector2 value)
Parameters
Type Name Description
Vector2 value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Contains(Int32, Int32)

Declaration
public bool Contains(int x, int y)
Parameters
Type Name Description
System.Int32 x
System.Int32 y
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Contains(Single, Single)

Declaration
public bool Contains(float x, float y)
Parameters
Type Name Description
System.Single x
System.Single y
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Equals(Rectangle)

Declaration
public bool Equals(Rectangle other)
Parameters
Type Name Description
Rectangle other
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean
Overrides
System.ValueType.Equals(System.Object)
| Improve this Doc View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.ValueType.GetHashCode()
| Improve this Doc View Source

Intersects(Rectangle)

Declaration
public bool Intersects(Rectangle value)
Parameters
Type Name Description
Rectangle value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Offset(Point)

Declaration
public void Offset(Point offset)
Parameters
Type Name Description
Point offset
| Improve this Doc View Source

Offset(Int32, Int32)

Declaration
public void Offset(int x, int y)
Parameters
Type Name Description
System.Int32 x
System.Int32 y
| Improve this Doc View Source

Offset(Single, Single)

Declaration
public void Offset(float x, float y)
Parameters
Type Name Description
System.Single x
System.Single y
| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.ValueType.ToString()
| Improve this Doc View Source

Touching(Rectangle)

Declaration
public bool Touching(Rectangle b)
Parameters
Type Name Description
Rectangle b
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TouchingBottom(Rectangle)

Declaration
public bool TouchingBottom(Rectangle b)
Parameters
Type Name Description
Rectangle b
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TouchingBottom(Rectangle, Rectangle)

Declaration
public static bool TouchingBottom(Rectangle a, Rectangle b)
Parameters
Type Name Description
Rectangle a
Rectangle b
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TouchingLeft(Rectangle)

Declaration
public bool TouchingLeft(Rectangle b)
Parameters
Type Name Description
Rectangle b
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TouchingLeft(Rectangle, Rectangle)

Declaration
public static bool TouchingLeft(Rectangle a, Rectangle b)
Parameters
Type Name Description
Rectangle a
Rectangle b
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TouchingRight(Rectangle)

Declaration
public bool TouchingRight(Rectangle b)
Parameters
Type Name Description
Rectangle b
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TouchingRight(Rectangle, Rectangle)

Declaration
public static bool TouchingRight(Rectangle a, Rectangle b)
Parameters
Type Name Description
Rectangle a
Rectangle b
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TouchingTop(Rectangle)

Declaration
public bool TouchingTop(Rectangle b)
Parameters
Type Name Description
Rectangle b
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TouchingTop(Rectangle, Rectangle)

Declaration
public static bool TouchingTop(Rectangle a, Rectangle b)
Parameters
Type Name Description
Rectangle a
Rectangle b
Returns
Type Description
System.Boolean

Operators

| Improve this Doc View Source

Equality(Rectangle, Rectangle)

Declaration
public static bool operator ==(Rectangle a, Rectangle b)
Parameters
Type Name Description
Rectangle a
Rectangle b
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Inequality(Rectangle, Rectangle)

Declaration
public static bool operator !=(Rectangle a, Rectangle b)
Parameters
Type Name Description
Rectangle a
Rectangle b
Returns
Type Description
System.Boolean

Implements

System.IEquatable<T>
  • Improve this Doc
  • View Source
Back to top Generated by DocFX