Module: Ruby2D::Renderable

Included in:
Image, Line, Quad, Text, Triangle
Defined in:
lib/ruby2d/renderable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#zObject

Returns the value of attribute z.



3
4
5
# File 'lib/ruby2d/renderable.rb', line 3

def z
  @z
end

Instance Method Details

#addObject



11
12
13
14
15
# File 'lib/ruby2d/renderable.rb', line 11

def add
  if Module.const_defined? :DSL
    Application.add(self)
  end
end

#contains?(x, y) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/ruby2d/renderable.rb', line 31

def contains?(x, y)
  raise "Not implemented yet"
end

#opacityObject



23
24
25
# File 'lib/ruby2d/renderable.rb', line 23

def opacity
  self.color.opacity
end

#opacity=(val) ⇒ Object



27
28
29
# File 'lib/ruby2d/renderable.rb', line 27

def opacity=(val)
  self.color.opacity = val
end

#removeObject



17
18
19
20
21
# File 'lib/ruby2d/renderable.rb', line 17

def remove
  if Module.const_defined? :DSL
    Application.remove(self)
  end
end