Sha256: 0f670697c47a14b80f329fac758233b5d12366c5cb29d11e075cdb6f544c9bde

Contents?: true

Size: 682 Bytes

Versions: 2

Compression:

Stored size: 682 Bytes

Contents

# We need this class to help the framework recognize 
# CGPointMake
class CGPoint; end

class ATSPoint

  def to_opengl_coordinates

    Joybox.director.convertToGL(self)
  end


  def from_opengl_coordinates

    Joybox.director.convertToUI(self)
  end


  def to_pixel_coordinates

    CGPointMake(self.x.to_pixels, self.y.to_pixels)
  end


  def from_pixel_coordinates

    CGPointMake(self.x.from_pixels, self.y.from_pixels)
  end


  def == (point)

    point.is_a?(CGPoint) && CGPointEqualToPoint(self, point)
  end 


  def + (point)

    CGPointMake(self.x + point.x, self.y + point.y)
  end


  def - (point)

    CGPointMake(self.x - point.x, self.y - point.y)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
joybox-1.0.0 motion/joybox-osx/common/ats_point.rb
joybox-0.0.6 motion/joybox-osx/common/ats_point.rb