Vivern Posted April 21, 2014 Share Posted April 21, 2014 Using Phaser 2.0.3 loadPolygon (key, object, options) → {boolean} - loads several/multi polygon-shapes, it is good.But I need to manually add several -polygon-shapes to the body.addPolygon (options, points) → {boolean} - add only One polygon-shape to body.As manually add several polygon-shapes to body (without loadPolygon) ------- P.S.loadPolygon ({}, object, [ [22, 0], [31, 9], [31, 22], [23, 31], [9, 31], [0, 22], [0, 9], [9, 0] ]) - good, shape displayed.ifloadPolygon ({}, object, [ 22, 0, 31, 9, 31, 22, 23, 31, 9, 31, 0, 22, 0, 9, 9, 0 ]) - fault, shape is not displayed? from docs: "An array of 2d vectors that form the convex or concave polygon. Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be flat x,y values e.g. setPolygon(options, x,y, x,y, x,y, ...) where x and y are numbers.": Link to comment Share on other sites More sharing options...
Taufpate Posted July 7, 2014 Share Posted July 7, 2014 Same here.... any solutions? Link to comment Share on other sites More sharing options...
wayfinder Posted July 7, 2014 Share Posted July 7, 2014 Convert your array, it just doesn't work with a flat array right now. Link to comment Share on other sites More sharing options...
Recommended Posts