struct Godot::Rect2i

Overview

2D axis-aligned bounding box using integer coordinates.

Defined in:

libgodot/types/rect2.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(x : Number, y : Number, width : Number, height : Number) #

def self.new(position : Vector2i = Vector2i.new, size : Vector2i = Vector2i.new) #

def self.new(pointer : Pointer(Void)) #

Instance Method Detail

def !=(other : Rect2i) : Bool #

def ==(other : Rect2i) : Bool #

def abs : Rect2i #

def area : Int32 #

def encloses(b : Rect2i) : Bool #

def encloses?(b : Rect2i) : Bool #

def end : Vector2i #

def end=(value : Vector2i) #

def expand(to : Vector2i) : Rect2i #

def grow(by : Int) : Rect2i #

def has_area? : Bool #

def has_point(point : Vector2i) : Bool #

def has_point?(point : Vector2i) : Bool #

def intersection(b : Rect2i) : Rect2i #

def intersects(b : Rect2i) : Bool #

def intersects?(b : Rect2i) : Bool #

def merge(b : Rect2i) : Rect2i #

def position : Vector2i #

def position=(position : Vector2i) #

def size : Vector2i #

def size=(size : Vector2i) #

def to_r2 : Rect2 #

def to_s(io : IO) : Void #
Description copied from struct Struct

Same as #inspect(io).