# Possible to bound an action to a region?

**URL:** <https://forum.defold.com/t/possible-to-bound-an-action-to-a-region/71858>\
**Category:** Questions\
**Created:** [October 13, 2022, 6:39am UTC](https://forum.defold.com/t/possible-to-bound-an-action-to-a-region/71858 "2022-10-13T06:39:26Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Alex\_8BitSkull](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/alex_8bitskull/32/5424_2.png) [@Alex\_8BitSkull](https://forum.defold.com/u/Alex_8BitSkull)\
**Post date:** [October 13, 2022, 7:19am UTC](https://forum.defold.com/t/possible-to-bound-an-action-to-a-region/71858/2 "2022-10-13T07:19:54Z")

</div>

Certainly possible, there are all kinds of ways to achieve it. Here is a very simple example.

```lua
	if action.released and action_id == hash("touch") then
		if action.x > 0 and action.x < 100 and action.y > 0 and action.y < 100 then
			--do stuff
		end
	end

```

For GUI, I recommend you read up on [gui.pick\_node()](https://defold.com/ref/gui/#gui.pick_node:node-x-y).

See [this thread](https://forum.defold.com/t/what-is-the-difference-between-action-xy-and-action-screen-xy-solved/68711) to understand the different types of coordinates returned in an input action.

---

_[View the full topic](https://forum.defold.com/t/possible-to-bound-an-action-to-a-region/71858)._
