-
Notifications
You must be signed in to change notification settings - Fork 0
/
customHud.lua
46 lines (42 loc) · 1.32 KB
/
customHud.lua
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
41
42
43
44
45
46
local hud = require("hudCreator")
local data = {}
local font = "textplus/font/1.ini" -- only supports numbers and "/"
local LevelName = Level.filename()
data.playerOneScore = 0
data.playerTwoScore = 0
hud.addElement("timer", {
img = Graphics.sprites.hardcoded["52"].img,
font = font,
x = 784,
y = 16,
leastAlpha = 0.5,
hideOverlap = true,
pivot = Sprite.align.TOPRIGHT,
hideType = hud.TYPE_FADE,
direction = hud.DIR_RIGHT,
condition = Timer.isActive,
getFunc = Timer.getValue
})
hud.addElement("p1-score", {
img = Graphics.sprites.hardcoded["33-3"].img,
drawCross = false,
font = font,
x = 380,
y = 565,
pivot = Sprite.align.BOTTOMRIGHT,
hideOverlap = true,
direction = hud.DIR_RIGHT,
getFunc = function() return string.format("%.7d", data.playerOneScore) end,
})
hud.addElement("p2-score", {
img = Graphics.sprites.hardcoded["33-7"].img,
drawCross = false,
font = font,
x = 420,
y = 565,
pivot = Sprite.align.BOTTOMLEFT,
hideOverlap = true,
direction = hud.DIR_RIGHT,
getFunc = function() return string.format("%.7d", data.playerTwoScore) end,
})
return data