# UI Based Game

**URL:** <https://forum.defold.com/t/ui-based-game/16974>\
**Category:** Questions\
**Created:** [February 18, 2018, 8:20pm UTC](https://forum.defold.com/t/ui-based-game/16974 "2018-02-18T20:20:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdou23](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/a/b5e925/32.png) [@Abdou23](https://forum.defold.com/u/Abdou23)\
**Post date:** [February 18, 2018, 8:20pm UTC](https://forum.defold.com/t/ui-based-game/16974/1 "2018-02-18T20:20:58Z")

</div>

I’m wondering if it is possible to make an entirely UI based game in defold. The idea I have in mind is some sort of Strategy/Board game where you move pawns around to different tiles and perform different actions based on where you are.  
Each Pawn/Tile will have some sort of UI element that displays information about it(text, texture) so I think that making all objects in my game as UI objects rather than 2D sprites would be much easier than trying to combine the two types together, I could be wrong here I’m not sure.  
What would I like to know is how to get UI objects to interact with each other, for example, when a player moves a pawn to a certain tile, how to detect which tile it is?  
Also, how would that impact the performance especially on mobile devices?

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [February 18, 2018, 8:34pm UTC](https://forum.defold.com/t/ui-based-game/16974/2 "2018-02-18T20:34:41Z")

</div>

Yes, it is possible to use GUI for all of the aspects of your game. Several games already have been made with Defold which do just that.

It should not necessarily hurt performance in any way - it depends on what and how you use features.

> [@Draw calls and Defold](https://forum.defold.com/t/draw-calls-and-defold/4674):
>
> I am by no means an expert in this field, but sometimes I think about performance. Here is some thoughts about draw calls in Defold. Draw Calls What is a draw call? In a one liner: “A command that tells the GPU to render a certain set of vertices as triangles with a certain state (shaders, blend state and so on). A command like this is often more than one object.” A batch is a term that is basically means multiple commands that share the same state. If you are curios of a more in depth explan…

> when a player moves a pawn to a certain tile, how to detect which tile it is?

You an either check cells within a virtual grid (similar to this [Pixcade Cosmos](https://www.pixcade.com/cosmos/web/) ), or have tiles be actual GUI elements which you check if they have been clicked with gui.pick\_node

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [February 18, 2018, 9:16pm UTC](https://forum.defold.com/t/ui-based-game/16974/3 "2018-02-18T21:16:55Z")

</div>

> [@Pkeod](#):
>
> Yes, it is possible to use GUI for all of the aspects of your game. Several games already have been made with Defold which do just that.

Absolutely. It’s easy to forget this and think that the GUI should only be used for user interface elements and nothing more. For certain kinds of games it makes perfect sense to create the entire game that way.
