Module: Tmx::ObjectShape

Extended by:
ObjectShape
Included in:
ObjectShape
Defined in:
lib/tmx_ext/object_shape.rb

Defined Under Namespace

Modules: ShapeDefaults Classes: CircularShape, PolyShape, UnknownShape

Instance Method Summary collapse

Instance Method Details

#create_from_tmx_object(object) ⇒ Object



87
88
89
# File 'lib/tmx_ext/object_shape.rb', line 87

def create_from_tmx_object(object)
  shapes.find { |shape| shape.match?(object) }.shape(object)
end

#shapesObject



83
84
85
# File 'lib/tmx_ext/object_shape.rb', line 83

def shapes
  [ PolyShape.new, CircularShape.new, UnknownShape.new ]
end