firefly-elixir
The official SDK for writing apps and games for Firefly Zero in Elixir using Orb.
Warning This SDK is highly experimental! The Orb project is in its early alpha testing stage and has a lot of rough edges and missed features. As a consequence, the SDK itself also doesn't implement some of the functions available in other SDKs.
Usage
Create a new Elixir project:
mix new helloAdd the SDK into
mix.exs:defp deps do [ {:firefly_elixir, "~> 0.1.0"} ] endFetch dependencies:
mix deps.getWrite some code:
defmodule Hello do use Firefly defw boot() do draw_triangle( %Point{x: 60, y: 10}, %Point{x: 40, y: 40}, %Point{x: 80, y: 40}, %Style{fill_color: :light_gray, stroke_color: :dark_blue, stroke_width: 1} ) end endCreate
firefly.toml:author_id = "demo" app_id = "hello" author_name = "Demo" app_name = "Hello" [files] _bin = { path = "main.wasm", copy = true }Build wat:
mix wasm Hello > main.watBuild wasm:
wat2wasm main.wat -o main.wasmBuild the Firefly Zero app:
firefly_cli build