Files
loop/src/Dodge/Item/Draw.hs
T
2021-05-20 21:25:42 +02:00

34 lines
978 B
Haskell

module Dodge.Item.Draw
where
import Dodge.Data
import Dodge.Picture.Layer
import Dodge.Creature.Stance.Data
import Picture
{- |
Places an item picture onto a creature when the item is selected. -}
pictureWeaponOnAim
:: Picture
-> Creature
-> Int -- ^ Position of item in inventory
-> Picture
pictureWeaponOnAim p cr posInInv
| _crInvSel cr == posInInv && _posture (_crStance cr) == Aiming
= onLayer PtLayer drawnWep
| _crInvSel cr == posInInv
= onLayer PtLayer holsteredWep
| otherwise = blank
where
drawnWep = uncurry translate (_crRad cr,0) p
holsteredWep = uncurry translate (_crRad cr,0) (scale 0.1 1 p)
pictureItem
:: Picture
-> Creature
-> Int -- ^ Position of item in inventory
-> Picture
pictureItem p cr posInInv
| _crInvSel cr == posInInv = onLayer PtLayer drawnWep
| otherwise = blank
where
drawnWep = uncurry translate (_crRad cr,0) p