-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathText.hs
40 lines (34 loc) · 850 Bytes
/
Text.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Aztecs
import qualified Aztecs.ECS.Access as A
import qualified Aztecs.SDL as SDL
import Aztecs.SDL.Text (Text (..))
import qualified Aztecs.SDL.Text as T
import Control.Monad
import SDL (V2 (..))
setup :: AccessT IO ()
setup = do
font <- load $ asset "assets/C&C Red Alert [INET].ttf" 24
A.spawn_ $ bundle Window {windowTitle = "Aztecs"}
A.spawn_ $
bundle Camera {cameraViewport = V2 1000 500, cameraScale = 5}
<> bundle transform2d
A.spawn_ $
bundle Text {textFont = font, textContent = "Hello, World!"}
<> bundle transform2d {transformTranslation = V2 10 10}
run :: AccessT IO ()
run = do
T.load
SDL.update
join T.draw
SDL.draw
run
app :: AccessT IO ()
app = do
SDL.setup
T.setup
setup
forever run
main :: IO ()
main = runAccessT_ app