Class: CGRectArray

Inherits:
Array
  • Object
show all
Defined in:
lib/sugarcube/core_graphics.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ CGRectArray

Returns a new instance of CGRectArray.



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/sugarcube/core_graphics.rb', line 4

def initialize args
  if args.length == 4
    super [CGPointArray.new([args[0], args[1]]), CGSizeArray.new([args[2], args[3]])]
  else
    unless CGPointArray === args[0]
      args[0] = Point(args[0])
    end
    unless CGSizeArray === args[1]
      args[1] = Size(args[1])
    end
    super [args[0], args[1]]
  end
end

Instance Method Details

#originObject



18
19
20
# File 'lib/sugarcube/core_graphics.rb', line 18

def origin
  return self[0]
end

#origin=(val) ⇒ Object



22
23
24
# File 'lib/sugarcube/core_graphics.rb', line 22

def origin= val
  self[0] = Point(val)
end

#sizeObject



26
27
28
# File 'lib/sugarcube/core_graphics.rb', line 26

def size
  return self[1]
end

#size=(val) ⇒ Object



30
31
32
# File 'lib/sugarcube/core_graphics.rb', line 30

def size= val
  self[1] = Size(val)
end