Sha256: 0a8e0e1145b9489ba71be5a9e470001d4f877df218eb33af21844a7ab1203513

Contents?: true

Size: 376 Bytes

Versions: 2

Compression:

Stored size: 376 Bytes

Contents

module Joybox
  module TMX
    
    include Joybox::Common

    def center_at(position)
      x = [position.x, Screen.half_width].max
      y = [position.y, Screen.half_height].max
      x = [x, @tile_map.size.width - Screen.half_width].min
      y = [y, @tile_map.size.height - Screen.half_height].min

      self.position = Screen.center - [x, y].to_point
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
joybox-1.1.1 motion/joybox/tmx/tmx.rb
joybox-1.1.0 motion/joybox/tmx/tmx.rb