Pebble.Game.Sprite
Lightweight sprite helpers built on top of Pebble.Ui.
Sprites
Sprite
type alias Sprite =
{ bitmap : Ui.Bitmap
, x : Int
, y : Int
, w : Int
, h : Int
}Bitmap sprite with integer bounds.
sprite
sprite : Ui.Bitmap -> Ui.Rect -> SpriteConstruct a sprite from a bitmap and rectangle.
view
view : Sprite -> Ui.RenderOpRender a sprite as a bitmap draw operation.
Helpers
parallaxBitmap
parallaxBitmap : Ui.Bitmap -> { x : Int, y : Int, w : Int, h : Int } -> Int -> List Ui.RenderOpDraw a horizontally wrapping bitmap strip for parallax backgrounds.
tileMap
tileMap : { tileSize : Int
, cameraX : Int
, cameraY : Int
, tiles : List ( Int, Int, Ui.Bitmap )
}
-> List Ui.RenderOpDraw a tile map from tile coordinates, a camera offset, and bitmap resources.