Hello! I want to share with you something I found to make creating custom menus easier. This piece of code uses the menu button. scene.systemMenu.addEntry(() => string, () => handler, image)
How to use:
Replace string with the name
Replace handler with the code
Replace image with the icon
Here is how you can use it as an extension:
//% color="#e6ac00" icon="ο" block="Menu"
namespace menu {
//% block="Add system menu option $name icon $image function:"
//% handlerStatement=1
//% image.shadow=screen_image_picker
export function addmenuoption(name: string, image: Image, handler: () => void): void {
scene.systemMenu.addEntry(() => name, handler, image);
}
}
Yeah! All you have to do to create an extention is to go to javascript, then press the plus button:
Name your extention whatever you want, then import the code below.
To export it so you can turn it into a sharable extension is to press the github icon in the bottom of the screen next to the project title, then follow the directions it gives you.
Wow amazing, I thought making extensions was much more complicated :0 I could totally use the samples you gave, learn a bit, and make my text to speech into an extension !!
Have you considered putting this on GitHub so people can import it easier into their projects? If you donβt know how, I can show you- but anyways very good extension, I can see myself using this