Method: MiniGL::Map#move_camera

Defined in:
lib/minigl/map.rb

#move_camera(x, y) ⇒ Object

Moves the viewport by the given amount of pixels.

Parameters:

x

The amount of pixels to move horizontally. Negative values will cause the camera to move to the left.

y

The amount of pixels to move vertically. Negative values will cause the camera to move up.



130
131
132
133
134
# File 'lib/minigl/map.rb', line 130

def move_camera(x, y)
  @cam.x += x
  @cam.y += y
  set_bounds
end