Method: MiniGL::Map#set_camera

Defined in:
lib/minigl/map.rb

#set_camera(cam_x, cam_y) ⇒ Object

Sets the top left corner of the viewport to the given position of the map. Note that this is not the position in the screen.

Parameters:

cam_x

The x-coordinate inside the map, in pixels (not a tile index).

cam_y

The y-coordinate inside the map, in pixels (not a tile index).



117
118
119
120
121
# File 'lib/minigl/map.rb', line 117

def set_camera(cam_x, cam_y)
  @cam.x = cam_x
  @cam.y = cam_y
  set_bounds
end