Class: Physicist::Laboratory::View

Inherits:
Dedalus::ApplicationView
  • Object
show all
Defined in:
lib/physicist/laboratory/view.rb

Instance Method Summary collapse

Instance Method Details

#app_screenObject



4
5
6
7
8
9
10
# File 'lib/physicist/laboratory/view.rb', line 4

def app_screen
  Screen.new(
    scientist: scientist_view,
    map_grid: application.workspace_view.grid_map,
    camera: camera_location
  )
end

#camera_locationObject



20
21
22
23
24
# File 'lib/physicist/laboratory/view.rb', line 20

def camera_location
  cx, cy = *scientist_view.current.position
  mx, my = (window.width / 2) / tile_size, (window.height / 2) / tile_size
  [ cx - mx, cy - my ]
end

#scientist_viewObject



12
13
14
# File 'lib/physicist/laboratory/view.rb', line 12

def scientist_view
  application.scientist_view
end

#tile_sizeObject



16
17
18
# File 'lib/physicist/laboratory/view.rb', line 16

def tile_size
  64
end