class Joyce::ApplicationWindow

Attributes

app[R]
height[RW]
width[RW]

Public Class Methods

new(app, width:, height:, fullscreen: true) click to toggle source
Calls superclass method
# File lib/joyce.rb, line 24
def initialize(app, width:, height:, fullscreen: true)
  @app = app
  self.width  = width
  self.height = height

  super(self.width, self.height, fullscreen)
end

Public Instance Methods

button_down(id) click to toggle source
# File lib/joyce.rb, line 40
def button_down(id)
  if id == Gosu::MsLeft
    app.click
  elsif id == Gosu::KbEscape
    close
  else
    app.press(id)
  end
end
draw() click to toggle source
# File lib/joyce.rb, line 32
def draw
  app.view.render
end
mouse_position() click to toggle source
# File lib/joyce.rb, line 50
def mouse_position
  [ mouse_x, mouse_y ]
end
update() click to toggle source
# File lib/joyce.rb, line 36
def update
  app.tick
end