Skip to content

Commit

Permalink
Add ctx documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel committed May 20, 2024
1 parent 65a2f4e commit b5236b4
Show file tree
Hide file tree
Showing 16 changed files with 466 additions and 15 deletions.
6 changes: 5 additions & 1 deletion docs/hexpansions/creating-hexpansions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Hexpansion Creation

Hexpansions are accessories that plug into the badge's expansion connectors. Almost anything can be a hexpansion - the simplest hexpansion is just a piece of 1 mm card cut into the right hexagonal shape. Here are some community examples:
{%
include-markdown "../index.md"
start="<!--hexpansions-definition-start-->"
end="<!--hexpansions-definition-end-->"
%}

<div class="scroll-container">
{%
Expand Down
Binary file added docs/images/ctx-examples/2circles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ctx-examples/2circles_opacity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ctx-examples/2lines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ctx-examples/2lines_2colors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ctx-examples/bezier.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ctx-examples/empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ctx-examples/state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ctx-examples/text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ctx-examples/text_long.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ctx-examples/triangle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ Unlike in previous years, [Electromagnetic Field](https://www.emfcamp.org/) is t

## Hexpansions

Hexpansions are accessories that plug into the badge's expansion connectors. Almost anything can be a hexpansion - the simplest hexpansion is just a piece of 1 mm card cut into the right hexagonal shape. Here are some community examples:
<!--hexpansions-definition-start-->
Hexpansions are accessories that plug into the badge's expansion connectors. Almost anything can be a hexpansion - the simplest hexpansion is just a piece of 1 mm card cut into the right hexagonal shape. Here are some community examples: (1)
{ .annotate }

1. If you want to add your hexpansion to this gallery, you can [file a PR](https://github.com/emfcamp/badge-2024-documentation/blob/main/docs/index.md) or let us know on the irc! We'd love to feature all of your creations!
<!--hexpansions-definition-end-->

<div class="scroll-container">
<!--hexpansions-start-->
Expand Down Expand Up @@ -118,8 +123,6 @@ Hexpansions are accessories that plug into the badge's expansion connectors. Alm
<!--hexpansions-end-->
</div>

!!! info "If you want to add your hexpansion to this gallery, you can [file a PR](https://github.com/emfcamp/badge-2024-documentation/blob/main/docs/index.md) or post it on the irc!"

??? tip "Expand to show a list of variously realistic hexpansion ideas"

- GPS / compass / IMU (for joust)
Expand Down Expand Up @@ -150,7 +153,7 @@ Hexpansions are accessories that plug into the badge's expansion connectors. Alm

For more information, see:

- [Hexpansion hardware developer guide](hexpansions/creating-hexpansions.md)
- [Hexpansion Creation](hexpansions/creating-hexpansions.md)
- [Technical documentation, pinout, and paper and PCB templates][badge-2024-hardware]

## A reusable platform with an interchangeable part
Expand Down
6 changes: 3 additions & 3 deletions docs/tildagon-apps/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,10 @@ You can use the following methods on an `App` object:
| Method | Description | Arguments | Returns |
| ------ | ----------- | --------- | ------- |
| `__init__()` | Initializes the app. You can overwrite this method to add additional properties or perform tasks. | None | None |
| `run(render_update)` | _Asynchronous_. By default, the `run()` method calls `render_update` repeatedly. You can overwrite the `run()` method which allows you to call asynchronous methods, enabling you, for example, to wait for user input with the [`Dialog`](./widgets-and-hardware/ui-elements.md#dialog) ui element. | `render_update`: method that triggers a `draw()` call when updates are complete. | None |
| `run(render_update)` | _Asynchronous_. By default, the `run()` method calls `render_update` repeatedly. You can overwrite the `run()` method which allows you to call asynchronous methods, enabling you, for example, to wait for user input with the [`Dialog`](./widgets-and-hardware/ui-elements.md#dialog) ui element. | `render_update`: The method that triggers a `draw()` call when updates are complete. | None |
| `update(delta)` | By default, This method is called by the `run()` method every 0.05 seconds. By default, it has _no implementation_. You can overwrite this method to perform updates. | `delta`: Time difference between the last update call and the current update call. | None |
| `draw(ctx)` | By default, this method calls `draw_operlays()`. To add UI elements or other visual elements to your app, you need to overwrite this method. | `ctx`: context that let's you add graphics or texts. See [`ctx` library](#the-ctx-library). | None |
| `draw_overlays(ctx)` | Draw each overlay stored in `self.overlays` on the screen. If you overwrite your `draw()` method and have any overlays, you need to call this method manually. | `ctx`: context that let's you add graphics or texts. See [`ctx` library](#the-ctx-library). | None |
| `draw(ctx)` | By default, this method calls `draw_operlays()`. To add UI elements or other visual elements to your app, you need to overwrite this method. | `ctx`: The canvas that let's you add graphics or texts. See [`ctx` library](./widgets-and-hardware/ctx.md). | None |
| `draw_overlays(ctx)` | Draw each overlay stored in `self.overlays` on the screen. If you overwrite your `draw()` method and have any overlays, you need to call this method manually. | `ctx`: The canvas that let's you add graphics or texts. See [`ctx` library](./widgets-and-hardware/ctx.md). | None |
| `background_task()` | _Asynchronous_. A loop for all applications, regardless of focused status. By default, it will call `background_update()` every 0.05 seconds. You can overwrite this behaviour. | None | None |
| `background_update(delta)` | This method is called by `background_task()` every 0.05 seconds. By default, it has _no implementation_. You can overwrite this method to perform updates in the background, that means even if your app is not in the foreground. | `delta`: Time difference between the last update call and the current update call. | None |
| `minimise()` | Minimise the app. | None | None |
Expand Down
Loading

0 comments on commit b5236b4

Please sign in to comment.