2017-03-05 15:39:37 +00:00
|
|
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
|
|
|
|
|
|
|
module Affection.MouseInteractable where
|
|
|
|
|
|
|
|
import Affection.Types
|
|
|
|
|
2017-03-05 15:41:18 +00:00
|
|
|
import qualified SDL
|
|
|
|
|
2017-03-05 15:39:37 +00:00
|
|
|
-- class MouseHoverable a us where
|
|
|
|
-- onHover :: a -> Affection us ()
|
|
|
|
|
|
|
|
-- | Define a mouse clickable object
|
|
|
|
class MouseClickable a us where
|
|
|
|
onClick
|
|
|
|
:: a -- The object
|
|
|
|
-> SDL.MouseButton -- The clicked button
|
|
|
|
-> (Int, Int) -- The coordinates of the click
|
|
|
|
-> SDL.InputMotion -- The 'SDL.InputMotion' of the click
|
|
|
|
-> Int -- The number of clicks
|
|
|
|
-> Affection us ()
|