> For the complete documentation index, see [llms.txt](https://akulla-pro.gitbook.io/aphone/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://akulla-pro.gitbook.io/aphone/how-you-make-your-own-apps/app-functions.md).

# App functions

There are the most useful functions you will use in the apps.

## APP:Open(PANEL main, int main\_x, int main\_y)

| Parameters | Purposes                                                              |
| ---------- | --------------------------------------------------------------------- |
| main       | This is the panel you need to parent everything on. You can paint it. |
| main\_x    | Wide of the main                                                      |
| main\_h    | Height of the main                                                    |

This function will be called when someone opens your app

## APP:OnClose()

This function will be called when someone closes your app or switch weapon

## APP:ShowCondition()

Return false to hide the app

```
// From weather app
function APP:ShowCondition()
	return tobool(StormFox or StormFox2)
end
```

## APP:Open2D(PANEL main, int main\_x, int main\_y)

This function will be called when someone puts the phone horizontally. Parameters are the same as Open

{% hint style="info" %}
If this function is available, the player will be able to put his phone horizontal in your app. Else, he can't.
{% endhint %}
