Jump to content

As manually add several polygon-shapes to body (without loadPolygon)


Vivern
 Share

Recommended Posts

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.

if

loadPolygon ({}, 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

  • 2 months later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...