Class: AuthorEngine::View
Constant Summary
Part::Colors::COLORS
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#black, #blue, #brown, #dark_blue, #dark_gray, #dark_green, #dark_purple, #green, #indigo, #light_gray, #orange, #peach, #pink, #red, #rgb, #white, #xml_color, #yellow
Methods included from Support
#code_editor, #mouse_over?, #sprite_editor, #window
Constructor Details
#initialize(x:, y:, width:, height:, background: Gosu::Color::BLACK) ⇒ View
Returns a new instance of View.
15
16
17
18
19
20
21
22
23
|
# File 'lib/author_engine/view.rb', line 15
def initialize(x:, y:, width:, height:, background: Gosu::Color::BLACK)
@x, @y, @width, @height, @background = x, y, width, height, background
@x_padding = Button::PADDING * window.scale_x
@y_padding = Button::PADDING * window.scale_y
self.class.instance = self
setup
end
|
Instance Attribute Details
#background ⇒ Object
Returns the value of attribute background.
14
15
16
|
# File 'lib/author_engine/view.rb', line 14
def background
@background
end
|
#height ⇒ Object
Returns the value of attribute height.
14
15
16
|
# File 'lib/author_engine/view.rb', line 14
def height
@height
end
|
#width ⇒ Object
Returns the value of attribute width.
14
15
16
|
# File 'lib/author_engine/view.rb', line 14
def width
@width
end
|
#x ⇒ Object
Returns the value of attribute x.
14
15
16
|
# File 'lib/author_engine/view.rb', line 14
def x
@x
end
|
#y ⇒ Object
Returns the value of attribute y.
14
15
16
|
# File 'lib/author_engine/view.rb', line 14
def y
@y
end
|
Class Method Details
.instance ⇒ Object
6
7
8
|
# File 'lib/author_engine/view.rb', line 6
def self.instance
@instance
end
|
.instance=(klass) ⇒ Object
10
11
12
|
# File 'lib/author_engine/view.rb', line 10
def self.instance=(klass)
@instance = klass
end
|
Instance Method Details
#blur ⇒ Object
31
32
|
# File 'lib/author_engine/view.rb', line 31
def blur
end
|
49
50
|
# File 'lib/author_engine/view.rb', line 49
def button_down(id)
end
|
52
53
|
# File 'lib/author_engine/view.rb', line 52
def button_up(id)
end
|
#draw ⇒ Object
34
35
36
|
# File 'lib/author_engine/view.rb', line 34
def draw
Gosu.draw_rect(@x, @y, @width, @height, @background)
end
|
#focus ⇒ Object
28
29
|
# File 'lib/author_engine/view.rb', line 28
def focus
end
|
#mouse_inside_view? ⇒ Boolean
38
39
40
41
42
43
44
|
# File 'lib/author_engine/view.rb', line 38
def mouse_inside_view?
if window.mouse_x.between?(@x, @x+@width)
if window.mouse_y.between?(@y, @y+@height)
return true
end
end
end
|
#setup ⇒ Object
25
26
|
# File 'lib/author_engine/view.rb', line 25
def setup
end
|
#update ⇒ Object
46
47
|
# File 'lib/author_engine/view.rb', line 46
def update
end
|