Skip to content

Commit

Permalink
Merge pull request #14 from npentrel/more-app
Browse files Browse the repository at this point in the history
Add more app content
  • Loading branch information
hughrawlinson authored May 18, 2024
2 parents 4cee38e + a50af97 commit 7ec3bc6
Show file tree
Hide file tree
Showing 7 changed files with 400 additions and 35 deletions.
365 changes: 353 additions & 12 deletions docs/tildagon-apps/development.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/tildagon-apps/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ To publish your Tildagon App, you need to create a GitHub repository with:

def update(self, delta):
if self.button_states.get(BUTTON_TYPES["CANCEL"]):
# The button_states do not update while you are in the background.
# Calling clear() ensures the next time you open the app, it stays open.
# Without it the app would close again immediately.
self.button_states.clear()
self.minimise()

def draw(self, ctx):
Expand Down
5 changes: 4 additions & 1 deletion docs/tildagon-apps/simulate.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ The badge simulator simulates all apps in the [`sim/apps/`](https://github.com/e
2. In the new folder (for example `sim/apps/MyApp/`), copy your app's python file. For example, this is `app.py` for an example app:

```python
import asyncio
import app

from events.input import Buttons, BUTTON_TYPES
Expand All @@ -31,6 +30,10 @@ The badge simulator simulates all apps in the [`sim/apps/`](https://github.com/e

def update(self, delta):
if self.button_states.get(BUTTON_TYPES["CANCEL"]):
# The button_states do not update while you are in the background.
# Calling clear() ensures the next time you open the app, it stays open.
# Without it the app would close again immediately.
self.button_states.clear()
self.minimise()

def draw(self, ctx):
Expand Down
4 changes: 4 additions & 0 deletions docs/tildagon-apps/widgets-and-hardware/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ title: Programming Interface Overview
weight: -3
---

## `App` class

For a detailed overview of the `App` class, see [The `App` class](../development.md#the-app-class).

## Premade UI elements

You can use the following premade [`app_components`](./ui-elements.md) to create user interfaces:
Expand Down
42 changes: 21 additions & 21 deletions docs/tildagon-apps/widgets-and-hardware/ui-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ To use a menu:

You can use the following methods on a `Menu` object:

| Method | Description | Returns |
| ------ | ----------- | ------- |
| `up_handler()` | Manually moves you up one position in the menu. | None |
| `down_handler()` | Manually moves you down one position in the menu. | None |
| `update(delta)` | Update the menu as animations are happening. You need to call this method in your app's `update()` method. | None |
| `draw(ctx)` | Add the menu to the screen. You need to call this method in your app's `draw()` method. | None |
| Method | Description | Parameter | Returns |
| ------ | ----------- | --------- | ------- |
| `up_handler()` | Manually moves you up one position in the menu. | None | None |
| `down_handler()` | Manually moves you down one position in the menu. | None | None |
| `update(delta)` | Update the menu as animations are happening. You need to call this method in your app's `update()` method. | `delta`: Time difference between the last update call and the current update call. | None |
| `draw(ctx)` | Add the menu to the screen. You need to call this method in your app's `draw()` method. | `ctx`: context that let's you add graphics or texts. See [`ctx` library](../development.md#the-ctx-library). | None |

## Notification

Expand Down Expand Up @@ -223,12 +223,12 @@ To use a notification:

You can use the following methods on a `Notification` object:

| Method | Description | Returns |
| ------ | ----------- | ------- |
| `open()` | Manually open the notification. | None |
| `close()` | Manually close the notification. | None |
| `update(delta)` | Automatically display the notification for a period of 5 seconds. You need to call this method in your app's `update()` method. | None |
| `draw(ctx)` | Add the notification to the screen. You need to call this method in your app's `draw()` method. | None |
| Method | Description | Arguments | Returns |
| ------ | ----------- | --------- | ------- |
| `open()` | Manually open the notification. | None | None |
| `close()` | Manually close the notification. | None | None |
| `update(delta)` | Automatically display the notification for a period of 5 seconds. You need to call this method in your app's `update()` method. | `delta`: Time difference between the last update call and the current update call. | None |
| `draw(ctx)` | Add the notification to the screen. You need to call this method in your app's `draw()` method. | `ctx`: context that let's you add graphics or texts. See [`ctx` library](../development.md#the-ctx-library). | None |

## Dialog

Expand Down Expand Up @@ -341,11 +341,11 @@ To use a dialog:

You can use the following methods on a `Notification` object:

| Method | Description | Returns |
| ------ | ----------- | ------- |
| `run(render_update)` | Asynchronous. Open the dialog. You need to call this method to display the dialog. | `True` or `False` |
| `draw_message(ctx)` | Helper method to add your message to the screen. This method is called by the `draw()` method. | None |
| `draw(ctx)` | Add the dialog to the screen. You need to call this method in your app's `draw()` method. | None |
| Method | Description | Arguments | Returns |
| ------ | ----------- | --------- | ------- |
| `run(render_update)` | Asynchronous. Open the dialog. You need to call this method to display the dialog. | `render_update`: method that triggers a `draw()` call when updates are complete. | `True` or `False` |
| `draw_message(ctx)` | Helper method to add your message to the screen. This method is called by the `draw()` method. | `ctx`: context that let's you add graphics or texts. See [`ctx` library](../development.md#the-ctx-library). | None |
| `draw(ctx)` | Add the dialog to the screen. You need to call this method in your app's `draw()` method. | `ctx`: context that let's you add graphics or texts. See [`ctx` library](../development.md#the-ctx-library). | None |

## Tokens

Expand All @@ -355,10 +355,10 @@ The [`Tokens`](https://github.com/emfcamp/badge-2024-software/blob/main/modules/

### Functions

| Method | Description | Returns |
| ------ | ----------- | ------- |
| `clear_background(ctx)` | Clear the badge background. | None |
| `set_color(ctx, color)` | Set the color for the context. The color must be provided as a string from the following options: `pale_green`, `mid_green`, `dark_green`, `colors.yellow`, `colors.orange`, `colors.pink`, `colors.blue`, `ui_colors.background`, `ui_colors.label`. | None |
| Method | Description | Arguments | Returns |
| ------ | ----------- | --------- | ------- |
| `clear_background(ctx)` | Clear the badge background. | `ctx`: context that let's you add graphics or texts. See [`ctx` library](../development.md#the-ctx-library). | None |
| `set_color(ctx, color)` | Set the color for the context. The color must be provided as a string from the following options: `pale_green`, `mid_green`, `dark_green`, `colors.yellow`, `colors.orange`, `colors.pink`, `colors.blue`, `ui_colors.background`, `ui_colors.label`. | - `ctx`: context that let's you add graphics or texts. See [`ctx` library](../development.md#the-ctx-library). | None |



Expand Down
10 changes: 10 additions & 0 deletions docs/using-the-badge/accessory-ideas.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Accessories
weight: 5
---

## Accessory Hexpansions

## General Accessories

- [A glowing charging cable](https://www.amazon.co.uk/Charger-Charging-iPhone-Samsung-MacBook/dp/B0CSS8YZDZ/ref=sr_1_6): Note, that we do not recommend metal-shrouded usb cables as they can short circuits if they touch hexpansions.
5 changes: 4 additions & 1 deletion docs/using-the-badge/end-user-manual.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Tildagon End User Manual
---
title: Tildagon End User Manual
weight: 1
---

![A hexagonal camp badge, with three smaller hexagonal PCBs containing breakout
pins peaking out from the edges, and a screen showing
Expand Down

0 comments on commit 7ec3bc6

Please sign in to comment.