This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.

Random.Mouse

List of Mouse Generators

Generators

mousePosition : Int -> Int -> Generator (Int, Int)

Generate a random mouse position given a screen width and a screen height

mouseX : Int -> Generator Int

Generate a random mouseX value given a screen width

mouseY : Int -> Generator Int

Generate a random mouseY value given a screen height

leftMouseDown : Generator Bool

Generate a random instance of left mouse down (alias for bool)

module Random.Mouse where
{-| List of Mouse Generators

# Generators
@docs mousePosition, mouseX, mouseY, leftMouseDown

-}

import Random       exposing (Generator, int)
import Random.Extra exposing (zip)
import Random.Bool  exposing (bool)

{-| Generate a random mouse position given a screen width and a screen height
-}
mousePosition : Int -> Int -> Generator (Int, Int)
mousePosition screenWidth screenHeight =
  zip (int 0 screenWidth) (int 0 screenHeight)

{-| Generate a random mouseX value given a screen width
-}
mouseX : Int -> Generator Int
mouseX screenWidth =
  int 0 screenWidth

{-| Generate a random mouseY value given a screen height
-}
mouseY : Int -> Generator Int
mouseY screenHeight =
  int 0 screenHeight

{-| Generate a random instance of left mouse down (alias for `bool`)
-}
leftMouseDown : Generator Bool
leftMouseDown = bool