# Coordinates within Defold

**URL:** <https://forum.defold.com/t/coordinates-within-defold/41827>\
**Category:** Questions\
**Created:** [January 28, 2019, 3:04pm UTC](https://forum.defold.com/t/coordinates-within-defold/41827 "2019-01-28T15:04:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [January 28, 2019, 3:04pm UTC](https://forum.defold.com/t/coordinates-within-defold/41827/1 "2019-01-28T15:04:34Z")

</div>

I create a game object with a factory and plan to map it to HardonCollider, an external collision library with a very bad name.

The reason I can’t use Box2D is the way it behaves in HTML5 when on an external monitor (70fps) or iOS low power mode (30fps). Vsync off and frame cap 0 is very stuttery.

Now, the dilemma I have is how to map the polygon coordinates to the sprite. Game objects manually distributed along the edges of the shape would work, but I can’t use game objects in a game object file (loaded by a factory). Sprites could work, but there is no way to get their position.

I would prefer to define the collision polygon coordinates within Defold, to avoid the external software dance. Any ideas how to tackle this?

---

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [January 28, 2019, 3:20pm UTC](https://forum.defold.com/t/coordinates-within-defold/41827/2 "2019-01-28T15:20:07Z")

</div>

I use Sketch App for the art. Maybe loading .svg files could work? If so, is there an XML parser in Defold?

---

<div class="post-metadata">

**Author:** ![sicher](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sicher/32/8_2.png) [@sicher](https://forum.defold.com/u/sicher)\
**Post date:** [January 28, 2019, 5:36pm UTC](https://forum.defold.com/t/coordinates-within-defold/41827/3 "2019-01-28T17:36:05Z")

</div>

No, the files are human readable protobuf. If you create a collision object with a few shapes you can open it in a text editor and see how it is constructed.

---

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [January 28, 2019, 5:38pm UTC](https://forum.defold.com/t/coordinates-within-defold/41827/4 "2019-01-28T17:38:56Z")

</div>

> [@sicher](#):
>
> the files are human readable protobuf

That’s cool! I don’t think it helps me in this case, though, because the shape I’m making for HC is a convex polygon.

---

<div class="post-metadata">

**Author:** ![sicher](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sicher/32/8_2.png) [@sicher](https://forum.defold.com/u/sicher)\
**Post date:** [January 29, 2019, 7:37am UTC](https://forum.defold.com/t/coordinates-within-defold/41827/5 "2019-01-29T07:37:00Z")

</div>

Aha. Check out this thread: [Defold Polygon Editor](https://forum.defold.com/t/defold-polygon-editor/6342)
