scenic_fuel_gauge v0.1.0 Scenic.FuelGauge

A stateless function for drawing a fuel gauge in a Scenic.Scene

Example:

Scenic.Graph.build(font: :roboto, font_size: @text_size)
|> Scenic.FuelGauge.draw(%{fuel: 0.7}, [scale: {3.0, 3.0}, translate: {80, 40}])

That will draw something like this:

Example Gauge

Link to this section Summary

Functions

Draw a fuel gauge on your scene graph

Link to this section Functions

Link to this function

draw(graph, data, opts \\ [])

draw(Scenic.Graph.t(), %{fuel: float()}, keyword()) :: Scenic.Graph.t()

Draw a fuel gauge on your scene graph

This function takes in a graph and draws a fuel gauge on that graph. The second argument is map where you can provide a fuel float between 0.0 .. 1.0. This third argument is a standard set of scenic options that you can pass to a group, this is a convenience for doing scaling, rotating, etc