Class: TCOD::Console
- Inherits:
-
Object
- Object
- TCOD::Console
- Defined in:
- lib/libtcod/console.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
Class Method Summary collapse
- .init_root(width, height, title, fullscreen = false, renderer = RENDERER_SDL) ⇒ Object
- .root ⇒ Object
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(w, h, root = False) ⇒ Console
constructor
A new instance of Console.
- #put_char(x, y, c, flag = BKGND_DEFAULT) ⇒ Object
- #set_default_foreground(color) ⇒ Object
- #wait_for_keypress(flush = false) ⇒ Object
- #window_closed? ⇒ Boolean
Constructor Details
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
3 4 5 |
# File 'lib/libtcod/console.rb', line 3 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
3 4 5 |
# File 'lib/libtcod/console.rb', line 3 def width @width end |
Class Method Details
.init_root(width, height, title, fullscreen = false, renderer = RENDERER_SDL) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/libtcod/console.rb', line 19 def self.init_root(width, height, title, fullscreen=false, renderer=RENDERER_SDL) TCOD.console_init_root(width, height, title, fullscreen, renderer) root.width = width root.height = height root end |
Instance Method Details
#flush ⇒ Object
38 39 40 |
# File 'lib/libtcod/console.rb', line 38 def flush TCOD.console_flush end |
#put_char(x, y, c, flag = BKGND_DEFAULT) ⇒ Object
34 35 36 |
# File 'lib/libtcod/console.rb', line 34 def put_char(x, y, c, flag=BKGND_DEFAULT) TCOD.console_put_char(@ptr, x, y, c.ord, flag) end |
#set_default_foreground(color) ⇒ Object
30 31 32 |
# File 'lib/libtcod/console.rb', line 30 def set_default_foreground(color) TCOD.console_set_default_foreground(@ptr, color) end |
#wait_for_keypress(flush = false) ⇒ Object
42 43 44 |
# File 'lib/libtcod/console.rb', line 42 def wait_for_keypress(flush=false) TCOD.console_wait_for_keypress(flush) end |
#window_closed? ⇒ Boolean
26 27 28 |
# File 'lib/libtcod/console.rb', line 26 def window_closed? TCOD.console_is_window_closed end |