Class: Hokusai::Backends::SDLBackend::Config
- Inherits:
-
Object
- Object
- Hokusai::Backends::SDLBackend::Config
- Defined in:
- ui/src/hokusai/backends/sdl2/config.rb
Instance Attribute Summary collapse
-
#after_load_cb ⇒ Object
Returns the value of attribute after_load_cb.
-
#automated ⇒ Object
Returns the value of attribute automated.
-
#automation_driver ⇒ Object
Returns the value of attribute automation_driver.
-
#background ⇒ Object
Returns the value of attribute background.
-
#fps ⇒ Object
Returns the value of attribute fps.
-
#height ⇒ Object
Returns the value of attribute height.
-
#host ⇒ Object
Returns the value of attribute host.
-
#init_flags ⇒ Object
Returns the value of attribute init_flags.
-
#port ⇒ Object
Returns the value of attribute port.
-
#title ⇒ Object
Returns the value of attribute title.
-
#width ⇒ Object
Returns the value of attribute width.
-
#window_config_flags ⇒ Object
Returns the value of attribute window_config_flags.
Instance Method Summary collapse
- #after_load(&block) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'ui/src/hokusai/backends/sdl2/config.rb', line 13 def initialize @width = 500 @height = 500 @fps = 60 @init_flags = ::SDL::INIT_VIDEO | ::SDL::INIT_EVENTS @window_config_flags = SDL::WINDOW_RESIZABLE @title = "(Unknown Title)" @background = SDLBackend.color(255,255,255, 0) after_load do font = Hokusai::Backends::SDLBackend::Font.from "#{__dir__}/Monaco.ttf" Hokusai.fonts.register "default", font Hokusai.fonts.activate "default" end end |
Instance Attribute Details
#after_load_cb ⇒ Object
Returns the value of attribute after_load_cb.
4 5 6 |
# File 'ui/src/hokusai/backends/sdl2/config.rb', line 4 def after_load_cb @after_load_cb end |
#automated ⇒ Object
Returns the value of attribute automated.
4 5 6 |
# File 'ui/src/hokusai/backends/sdl2/config.rb', line 4 def automated @automated end |
#automation_driver ⇒ Object
Returns the value of attribute automation_driver.
4 5 6 |
# File 'ui/src/hokusai/backends/sdl2/config.rb', line 4 def automation_driver @automation_driver end |
#background ⇒ Object
Returns the value of attribute background.
4 5 6 |
# File 'ui/src/hokusai/backends/sdl2/config.rb', line 4 def background @background end |
#fps ⇒ Object
Returns the value of attribute fps.
4 5 6 |
# File 'ui/src/hokusai/backends/sdl2/config.rb', line 4 def fps @fps end |
#height ⇒ Object
Returns the value of attribute height.
4 5 6 |
# File 'ui/src/hokusai/backends/sdl2/config.rb', line 4 def height @height end |
#host ⇒ Object
Returns the value of attribute host.
4 5 6 |
# File 'ui/src/hokusai/backends/sdl2/config.rb', line 4 def host @host end |
#init_flags ⇒ Object
Returns the value of attribute init_flags.
4 5 6 |
# File 'ui/src/hokusai/backends/sdl2/config.rb', line 4 def init_flags @init_flags end |
#port ⇒ Object
Returns the value of attribute port.
4 5 6 |
# File 'ui/src/hokusai/backends/sdl2/config.rb', line 4 def port @port end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'ui/src/hokusai/backends/sdl2/config.rb', line 4 def title @title end |
#width ⇒ Object
Returns the value of attribute width.
4 5 6 |
# File 'ui/src/hokusai/backends/sdl2/config.rb', line 4 def width @width end |
#window_config_flags ⇒ Object
Returns the value of attribute window_config_flags.
4 5 6 |
# File 'ui/src/hokusai/backends/sdl2/config.rb', line 4 def window_config_flags @window_config_flags end |
Instance Method Details
#after_load(&block) ⇒ Object
9 10 11 |
# File 'ui/src/hokusai/backends/sdl2/config.rb', line 9 def after_load(&block) self.after_load_cb = block end |