Module: Ruby2D

Defined in:
lib/ruby2d/font.rb,
lib/ruby2d.rb,
lib/ruby2d/line.rb,
lib/ruby2d/quad.rb,
lib/ruby2d/text.rb,
lib/ruby2d/color.rb,
lib/ruby2d/image.rb,
lib/ruby2d/music.rb,
lib/ruby2d/pixel.rb,
lib/ruby2d/sound.rb,
lib/ruby2d/circle.rb,
lib/ruby2d/entity.rb,
lib/ruby2d/sprite.rb,
lib/ruby2d/square.rb,
lib/ruby2d/window.rb,
lib/ruby2d/tileset.rb,
lib/ruby2d/version.rb,
lib/ruby2d/triangle.rb,
lib/ruby2d/rectangle.rb,
lib/ruby2d/exceptions.rb,
lib/ruby2d/renderable.rb

Overview

Ruby2D::Renderable

Defined Under Namespace

Modules: DSL, Renderable Classes: Circle, Color, Entity, Error, Font, Image, Line, Music, Pixel, Quad, Rectangle, Sound, Sprite, Square, Text, Tileset, Triangle, Window

Constant Summary collapse

Colour =

Allow British English spelling of color

Color
VERSION =
'0.10.0'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.assetsObject



40
41
42
43
44
45
46
47
48
49
# File 'lib/ruby2d.rb', line 40

def assets
  unless @assets
    if RUBY_ENGINE == 'mruby'
      @assets = Ruby2D.ext_base_path + 'assets'
    else
      @assets = './assets'
    end
  end
  @assets
end

.assets=(path) ⇒ Object



51
# File 'lib/ruby2d.rb', line 51

def assets=(path); @assets = path end

Instance Method Details

#draw(opts = {}) ⇒ Object



48
49
50
# File 'lib/ruby2d/tileset.rb', line 48

def draw(opts = {})
  render(opts)
end