Class: RGSS::Rect

Inherits:
Object
  • Object
show all
Defined in:
lib/rgss/stubs/rect.rb

Overview

Note:

All relevant methods implemented in Object (i.e. #dup, #clone, Marshalling, equality) have also been properly implemented/overridden, but have been omitted from the documentation for brevity.

Stores a set of four integers that represent the location and size of a rectangle, with the top-left at 0, 0.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRect #initialize(location, size) ⇒ Rect #initialize(x, y, width, height) ⇒ Rect

Creates a new instance of the RGSS::Rect class.

Overloads:

  • #initializeRect

    Creates a new empty rectangle.

  • #initialize(location, size) ⇒ Rect

    Creates a new rectangle with the specified location and size.

  • #initialize(x, y, width, height) ⇒ Rect

    Creates a new rectangle with the specified dimensions.



175
176
# File 'lib/rgss/stubs/rect.rb', line 175

def initialize(*args)
end

Instance Attribute Details

#bottomInteger (readonly)



149
150
151
# File 'lib/rgss/stubs/rect.rb', line 149

def bottom
  @bottom
end

#heightInteger



125
126
127
# File 'lib/rgss/stubs/rect.rb', line 125

def height
  @height
end

#leftInteger (readonly)



137
138
139
# File 'lib/rgss/stubs/rect.rb', line 137

def left
  @left
end

#locationPoint



129
130
131
# File 'lib/rgss/stubs/rect.rb', line 129

def location
  @location
end

#rightInteger (readonly)



145
146
147
# File 'lib/rgss/stubs/rect.rb', line 145

def right
  @right
end

#sizeSize



133
134
135
# File 'lib/rgss/stubs/rect.rb', line 133

def size
  @size
end

#topInteger (readonly)



141
142
143
# File 'lib/rgss/stubs/rect.rb', line 141

def top
  @top
end

#widthInteger



121
122
123
# File 'lib/rgss/stubs/rect.rb', line 121

def width
  @width
end

#xInteger



113
114
115
# File 'lib/rgss/stubs/rect.rb', line 113

def x
  @x
end

#yInteger



117
118
119
# File 'lib/rgss/stubs/rect.rb', line 117

def y
  @y
end

Class Method Details

.emptyRect

Creates and returns a new RGSS::Rect with all values defaulted to 0.



155
156
# File 'lib/rgss/stubs/rect.rb', line 155

def self.empty
end

.ltrb(left, right, top, bottom) ⇒ Rect

Creates a new RGSS::Rect by the specified edges.



187
188
# File 'lib/rgss/stubs/rect.rb', line 187

def self.ltrb(left, right, top, bottom)
end

Instance Method Details

#[](index) ⇒ Integer

Provides access to the rectangle components by index.

Raises:

  • (IndexError)

    if index is less than 0 or greater than 3.



195
196
# File 'lib/rgss/stubs/rect.rb', line 195

def [](index)
end

#[]=(index, value) ⇒ Integer

Provides access to the rectangle components by index.

Raises:

  • (IndexError)

    if index is less than 0 or greater than 3.



203
204
# File 'lib/rgss/stubs/rect.rb', line 203

def []=(index, value)
end

#contains?(x, y) ⇒ Boolean #contains?(point) ⇒ Boolean #contains?(rect) ⇒ Boolean Also known as: include?



227
228
# File 'lib/rgss/stubs/rect.rb', line 227

def contains?(*args)
end

#empty?Boolean



212
213
# File 'lib/rgss/stubs/rect.rb', line 212

def empty?
end

#inflate(x, y) ⇒ Rect #inflate(amount) ⇒ Rect



239
240
# File 'lib/rgss/stubs/rect.rb', line 239

def inflate(*args)
end

#inflate!(x, y) ⇒ self #inflate!(amount) ⇒ self



251
252
# File 'lib/rgss/stubs/rect.rb', line 251

def inflate!(*args)
end

#intersect(other) ⇒ Rect



259
260
# File 'lib/rgss/stubs/rect.rb', line 259

def intersect(other)
end

#intersect!(other) ⇒ self



267
268
# File 'lib/rgss/stubs/rect.rb', line 267

def intersect!(other)
end

#intersects?(other) ⇒ Boolean



274
275
# File 'lib/rgss/stubs/rect.rb', line 274

def intersects?(other)
end

#offset(x, y) ⇒ Rect #offset(amount) ⇒ Rect



286
287
# File 'lib/rgss/stubs/rect.rb', line 286

def offset(*args)
end

#offset(x, y) ⇒ self #offset(amount) ⇒ self



298
299
# File 'lib/rgss/stubs/rect.rb', line 298

def offset!(*args)
end

#set(x, y, width, height) ⇒ Object



206
207
# File 'lib/rgss/stubs/rect.rb', line 206

def set(x, y, width, height)
end

#to_aArray(Integer, Integer, Integer, Integer)

Creates an array instance that represents this object.



304
305
# File 'lib/rgss/stubs/rect.rb', line 304

def to_a
end

#to_hHash{Symbol => Integer}

Creates a hash instance that represents this object.



310
311
# File 'lib/rgss/stubs/rect.rb', line 310

def to_h
end