parent
becd305e01
commit
5cc96cbdba
10 changed files with 53 additions and 21 deletions
|
@ -4,7 +4,7 @@ module RPGEngine.Render.LevelSelection
|
|||
|
||||
import RPGEngine.Render.Core (Renderer)
|
||||
|
||||
import RPGEngine.Config (resolution, zoom, uizoom)
|
||||
import RPGEngine.Config (resolution, zoom, uizoom, textColor, selectionColor )
|
||||
import RPGEngine.Data (State (..))
|
||||
|
||||
import Graphics.Gloss ( pictures, color, text, translate, blank )
|
||||
|
@ -25,7 +25,8 @@ renderLevelList LevelSelection{ levelList = list, selector = selector } = everyt
|
|||
where everything = pictures $ map render entries
|
||||
sel = selection selector
|
||||
entries = zip [0::Int .. ] list
|
||||
render (i, path) | i == sel = color red $ scale uizoom uizoom $ translate 0 (offset i) $ text path
|
||||
| otherwise = scale uizoom uizoom $ translate 0 (offset i) $ text path
|
||||
render (i, path) | i == sel = color selectionColor $ make (i, path)
|
||||
| otherwise = color textColor $ make (i, path)
|
||||
make (i, path) = scale uizoom uizoom $ translate 0 (offset i) $ text path
|
||||
offset i = negate (250 * uizoom * fromIntegral i)
|
||||
renderLevelList _ = blank
|
Reference in a new issue