1.6 KiB
1.6 KiB
description
| description |
|---|
| Create a new MonaOS app with proper structure, template code, and icon |
Create Badge App
Create a complete MonaOS application structure with all required files.
What to do
- Ask the user for the app name if not provided
- Validate the app name (lowercase, no spaces, alphanumeric with underscores/hyphens)
- Create the following directory structure:
{app_name}/
├── __init__.py # Main app file from template
├── icon.png # 24x24 icon
└── assets/ # Optional assets directory
- Use the app template from
badger-marketplace/badger-2350-dev/templates/app_template.py - Replace
{{APP_NAME}}placeholders with the actual app name - Copy the icon template from
badger-marketplace/badger-2350-dev/templates/icon_template.png - Create an empty
assets/directory
After creation
Tell the user:
Next Steps:
-
Test your app locally:
mpremote run {app_name}/__init__.py -
Edit the code:
- Open
{app_name}/__init__.pyin your editor - Replace TODO comments with your app logic
- Add button handlers, animations, and content
- Open
-
Deploy to badge when ready:
/deploy-to-badge {app_name} -
Customize the icon:
- Edit
{app_name}/icon.png(must be 24x24 pixels) - Use any image editor or pixel art tool
- Edit
Your app structure is ready! The template includes examples of:
- Button handling for all 5 buttons
- Simple animation with frame counter
- Text and shape drawing
- State management pattern
Check the examples/ directory in this plugin for working examples like hello_world and meditation_timer.