Class: RIView

Inherits:
Object
  • Object
show all
Defined in:
lib/RIUI/RIView.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#background_colorObject

Returns the value of attribute background_color.



3
4
5
# File 'lib/RIUI/RIView.rb', line 3

def background_color
  @background_color
end

#heightObject

Returns the value of attribute height.



3
4
5
# File 'lib/RIUI/RIView.rb', line 3

def height
  @height
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/RIUI/RIView.rb', line 3

def title
  @title
end

#widthObject

Returns the value of attribute width.



3
4
5
# File 'lib/RIUI/RIView.rb', line 3

def width
  @width
end

Class Method Details

.exitObject



15
16
17
18
# File 'lib/RIUI/RIView.rb', line 15

def self.exit
  extend Ruby2D::DSL
  close
end

.initialize(opts = {}) ⇒ Object



4
5
6
7
8
9
# File 'lib/RIUI/RIView.rb', line 4

def self.initialize(opts = {})
  @width = opts[:width] || 250
  @height = opts[:height] || 300
  @background_color = opts[:background_color] || 'white'
  @title = opts[:title] || "RIUI View"
end

.showObject



10
11
12
13
14
# File 'lib/RIUI/RIView.rb', line 10

def self.show
  extend Ruby2D::DSL
  set width: @width, height: @height, background: @background_color, title: @title
  show
end