Top Level Namespace

Defined Under Namespace

Modules: RAGE Classes: Logger, Module

Instance Method Summary collapse

Instance Method Details

#game(args = {}, &block) ⇒ Object

Set attributes on Game w/ specified args and invoke block using Game as an arg. Finally return Game



46
47
48
49
50
# File 'lib/rage/dsl.rb', line 46

def game(args = {}, &block)
   #Game.set_attrs(args)
   block.call RAGE::Game unless block.nil?
   return RAGE::Game
end

#input_handlersObject

Return input handlers manager, which can be used to register/remove user input handlers



40
41
42
# File 'lib/rage/dsl.rb', line 40

def input_handlers
  RAGE::InputHandler
end

#resource(args = {}, &block) ⇒ Object

Load resource w/ specified args and invoke block using resource as an arg. Finally return resource.



24
25
26
27
28
# File 'lib/rage/dsl.rb', line 24

def resource(args = {}, &block)
   resource = RAGE::ResourcesManager.instance.load_resource args
   block.call resource unless block.nil?
   return resource
end

#text(txt, args = {}, &block) ⇒ Object

Create a RAGEi::Text instance to display on screen and invoke block using it as an arg. Finally return Text object



32
33
34
35
36
# File 'lib/rage/dsl.rb', line 32

def text(txt, args = {}, &block)
  rtext = RAGE::Text.new args.merge(:text => txt)
  block.call rtext unless block.nil?
  return rtext
end

#viewport(args = {}, &block) ⇒ Object

Instantiate new viewport w/ specified args and invoke block, using viewport as an arg. Finally return viewport



16
17
18
19
20
# File 'lib/rage/dsl.rb', line 16

def viewport(args = {}, &block)
   vp = RAGE::Viewport.new args
   block.call vp unless block.nil?
   return vp
end

#window(args = {}, &block) ⇒ Object

Sets attributes on the Window w/ any specified arguments and then invokes block w/ the Window class. Finally Window is returned.



8
9
10
11
12
# File 'lib/rage/dsl.rb', line 8

def window(args = {}, &block)
   RAGE::Window.set_attrs args
   block.call RAGE::Window unless block.nil?
   return RAGE::Window
end