* Detect the shape type from the TMX object settings. * Shape markers are mutually exclusive; the first match wins. * @param {object} settings - TMX object settings * @returns {string} one of "ellipse", "capsule", "point", "polygon", "polyline", "rectangle" * @ignore
(settings)
| 16 | * @ignore |
| 17 | */ |
| 18 | function detectShape(settings) { |
| 19 | if (typeof settings.ellipse !== "undefined") { |
| 20 | return "ellipse"; |
| 21 | } |
| 22 | if (typeof settings.capsule !== "undefined") { |
| 23 | return "capsule"; |
| 24 | } |
| 25 | if (typeof settings.point !== "undefined") { |
| 26 | return "point"; |
| 27 | } |
| 28 | if (typeof settings.polygon !== "undefined") { |
| 29 | return "polygon"; |
| 30 | } |
| 31 | if (typeof settings.polyline !== "undefined") { |
| 32 | return "polyline"; |
| 33 | } |
| 34 | return "rectangle"; |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * a TMX Object defintion, as defined in Tiled |