Method: OR2D::Camera#initialize
- Defined in:
- lib/or2d/camera.rb
#initialize(viewport_width = OR2D.game.screen_width, viewport_height = OR2D.game.screen_height, target = OR2D::Entity.new(:square, { size: 1, x: 0, y: 0, show: false }), speed = 1) ⇒ Camera
Constructs a new Camera object.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/or2d/camera.rb', line 16 def initialize( = OR2D.game.screen_width, = OR2D.game.screen_height, target = OR2D::Entity.new(:square, { size: 1, x: 0, y: 0, show: false }), speed = 1) @target = target @speed = speed @viewport = OR2D::Entity.new(:rectangle, { x: (OR2D.game.screen_width / 2) - , y: (OR2D.game.screen_height / 2) + , width: , height: , show: false }) end |