class AuthorEngine::View
Attributes
background[R]
height[R]
width[R]
x[R]
y[R]
Public Class Methods
instance()
click to toggle source
# File lib/author_engine/view.rb, line 6 def self.instance @instance end
instance=(klass)
click to toggle source
# File lib/author_engine/view.rb, line 10 def self.instance=(klass) @instance = klass end
new(x:, y:, width:, height:, background: Gosu::Color::BLACK)
click to toggle source
# 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
Public Instance Methods
blur()
click to toggle source
# File lib/author_engine/view.rb, line 31 def blur end
draw()
click to toggle source
# File lib/author_engine/view.rb, line 34 def draw Gosu.draw_rect(@x, @y, @width, @height, @background) end
focus()
click to toggle source
# File lib/author_engine/view.rb, line 28 def focus end
mouse_inside_view?()
click to toggle source
# 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()
click to toggle source
# File lib/author_engine/view.rb, line 25 def setup end
update()
click to toggle source
# File lib/author_engine/view.rb, line 46 def update end