Hello, everyone, im trying to embed this element into my main.elm file but i just get white canvas with black borders.
module App.Canvas exposing (..)
import Canvas exposing (..)
import Color
import Html exposing (Html)
import Html.Attributes exposing (style)
view : Float -> Float -> Html msg
view x y =
let
width = 500
height = 300
debug = Debug.log (String.fromFloat x)
in
Canvas.toHtml (width, height)
[ style "border" "1px solid black" ]
[ shapes [ fill Color.red ] [ rect (x*10, y*10) width height ]
, renderSquare
]
renderSquare =
shapes [ fill (Color.rgba 0 0 0 1) ]
[ rect (0, 0) 100 50 ]
main = view 1.0 1.0
here’s part of my View in main
,div []
[(App.Canvas.view model.position.x model.position.y)]
is there any tutorials besides 10 lines of 3 words in joakin/elm-canvas docs?