Table of Contents

Struct Rectanglei

Namespace
Vintagestory.API.MathTools
Assembly
VintagestoryAPI.dll
public struct Rectanglei
Inherited Members

Constructors

Rectanglei(int, int, int, int)

public Rectanglei(int X, int Y, int width, int height)

Parameters

X int
Y int
width int
height int

Properties

X1

Same as X

public int X1 { get; }

Property Value

int

X2

Same as X + Width

public int X2 { get; }

Property Value

int

Y1

Same as Y

public int Y1 { get; }

Property Value

int

Y2

Same as Y + Height

public int Y2 { get; }

Property Value

int

Methods

Bottom()

public int Bottom()

Returns

int

Clone()

[Obsolete("Rectanglei is a struct and there is no point cloning a struct")]
public Rectanglei Clone()

Returns

Rectanglei

Contains(int, int)

Returns if the given point is inside the cuboid

public bool Contains(int x, int y)

Parameters

x int
y int

Returns

bool

Contains(Vec2i)

Returns if the given point is inside the cuboid

public bool Contains(Vec2i pos)

Parameters

pos Vec2i

Returns

bool

GrowBy(int)

public Rectanglei GrowBy(int size)

Parameters

size int

Returns

Rectanglei

Intersects(Rectanglei)

If the given cuboid intersects with this cubiod

public bool Intersects(Rectanglei with)

Parameters

with Rectanglei

Returns

bool

IntersectsOrTouches(int, int, int, int)

public bool IntersectsOrTouches(int withX1, int withY1, int withX2, int withY2)

Parameters

withX1 int
withY1 int
withX2 int
withY2 int

Returns

bool

IntersectsOrTouches(Rectanglei)

If the given cuboid intersects with or is adjacent to this cubiod

public bool IntersectsOrTouches(Rectanglei with)

Parameters

with Rectanglei

Returns

bool

PointInside(int, int)

public bool PointInside(int x, int y)

Parameters

x int
y int

Returns

bool

PointInside(Vec2i)

public bool PointInside(Vec2i pos)

Parameters

pos Vec2i

Returns

bool