Class: Hokusai::Backends::RaylibBackend::Config
- Inherits:
-
Object
- Object
- Hokusai::Backends::RaylibBackend::Config
- Defined in:
- ui/src/hokusai/backends/raylib/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.
-
#config_flags ⇒ Object
Returns the value of attribute config_flags.
-
#event_waiting ⇒ Object
Returns the value of attribute event_waiting.
-
#fps ⇒ Object
Returns the value of attribute fps.
-
#height ⇒ Object
Returns the value of attribute height.
-
#host ⇒ Object
Returns the value of attribute host.
-
#on_reload(&block) ⇒ Object
Returns the value of attribute on_reload.
-
#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_state_flags ⇒ Object
Returns the value of attribute window_state_flags.
Instance Method Summary collapse
- #after_load(&block) ⇒ Object
- #automate(host, port) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #start_automation_driver ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 10 def initialize @width = 500 @height = 500 @fps = 60 @title = "(Unknown Title)" @config_flags = Raylib::FLAG_WINDOW_RESIZABLE | Raylib::FLAG_VSYNC_HINT @window_state_flags = Raylib::FLAG_WINDOW_RESIZABLE @automation_driver = nil @background = Raylib::WHITE @after_load_cb = nil @host = "127.0.0.1" @port = 4333 @automated = false @on_reload = ->(_){} @event_waiting = false end |
Instance Attribute Details
#after_load_cb ⇒ Object
Returns the value of attribute after_load_cb.
5 6 7 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 5 def after_load_cb @after_load_cb end |
#automated ⇒ Object
Returns the value of attribute automated.
5 6 7 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 5 def automated @automated end |
#automation_driver ⇒ Object
Returns the value of attribute automation_driver.
5 6 7 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 5 def automation_driver @automation_driver end |
#background ⇒ Object
Returns the value of attribute background.
5 6 7 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 5 def background @background end |
#config_flags ⇒ Object
Returns the value of attribute config_flags.
5 6 7 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 5 def config_flags @config_flags end |
#event_waiting ⇒ Object
Returns the value of attribute event_waiting.
5 6 7 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 5 def event_waiting @event_waiting end |
#fps ⇒ Object
Returns the value of attribute fps.
5 6 7 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 5 def fps @fps end |
#height ⇒ Object
Returns the value of attribute height.
5 6 7 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 5 def height @height end |
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 5 def host @host end |
#on_reload(&block) ⇒ Object
Returns the value of attribute on_reload.
5 6 7 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 5 def on_reload @on_reload end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 5 def port @port end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 5 def title @title end |
#width ⇒ Object
Returns the value of attribute width.
5 6 7 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 5 def width @width end |
#window_state_flags ⇒ Object
Returns the value of attribute window_state_flags.
5 6 7 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 5 def window_state_flags @window_state_flags end |
Instance Method Details
#after_load(&block) ⇒ Object
39 40 41 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 39 def after_load(&block) self.after_load_cb = block end |
#automate(host, port) ⇒ Object
33 34 35 36 37 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 33 def automate(host, port) self.host = host self.port = port self.automated = true end |
#start_automation_driver ⇒ Object
27 28 29 30 31 |
# File 'ui/src/hokusai/backends/raylib/config.rb', line 27 def start_automation_driver raise ConfigError.new("Need a Hokusai::Driver in order to automate") if automation_driver.nil? automation_driver.serve(host, port) end |