Method: Ruby2D::Window#set

Defined in:
lib/ruby2d/window.rb

#set(opts) ⇒ Object

Set a window attribute

Parameters:

  • opts (Hash)

    The attributes to set

Options Hash (opts):

  • :background (Color)
  • :title (String)
  • :width (Numeric)
  • :height (Numeric)
  • :viewport_width (Numeric)
  • :viewport_height (Numeric)
  • :highdpi (Boolean)
  • :resizable (Boolean)
  • :borderless (Boolean)
  • :fullscreen (Boolean)
  • :fps_cap (Numeric)
  • :diagnostics (Numeric)


258
259
260
261
262
263
264
265
266
267
268
# File 'lib/ruby2d/window.rb', line 258

def set(opts)
  # Store new window attributes, or ignore if nil
  _set_any_window_properties opts
  _set_any_window_dimensions opts

  @fps_cap = opts[:fps_cap] if opts[:fps_cap]
  return if opts[:diagnostics].nil?

  @diagnostics = opts[:diagnostics]
  ext_diagnostics(@diagnostics)
end