-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathscreenscale.nim
59 lines (43 loc) · 1.09 KB
/
screenscale.nim
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
47
48
49
50
51
52
53
54
55
56
57
58
59
import nico
import strformat
nico.init("nico","screenscale")
var test: seq[int]
proc gameInit() =
discard
proc gameUpdate(dt: float32) =
if btnp(pcA):
fixedSize(not fixedSize())
if btnp(pcB):
integerScale(not integerScale())
for i in 0..<1000:
test.add(i)
test = @[]
proc gameDraw() =
cls()
setColor(1)
for y in countup(0, screenHeight, 16):
hline(0, y, screenWidth)
for x in countup(0, screenWidth, 16):
vline(x, 0, screenHeight)
setColor(12)
box(0, 0, screenWidth, screenHeight)
setColor(7)
var y = 4
print(&"canvas : {screenWidth}x{screenHeight}", 4, y)
y += 10
print(&"scale : {getScreenScale()}", 4, y)
y += 10
#print(&"display: {displayWidth}x{displayHeight}", 4, y)
y += 10
print(&"fixedSize: {fixedSize()}", 4, y)
y += 10
print(&"integerScale: {integerScale()}", 4, y)
y += 10
print(&"mem: {getOccupiedMem()} / {getTotalMem()}", 4, y)
fixedSize(false)
integerScale(true)
nico.createWindow("screenscale", 128, 128, 3)
addResizeFunc(proc(w,h: int) =
echo &"resized to {w}x{h}"
)
nico.run(gameInit, gameUpdate, gameDraw)