Mercurial > games > semicongine
comparison examples/E04_input.nim @ 67:31ccaeee09c9
add: nicer keyboard demo
author | Sam <sam@basx.dev> |
---|---|
date | Sun, 05 Feb 2023 00:20:07 +0700 |
parents | 44bae6c72834 |
children | d830a1c0f86e |
comparison
equal
deleted
inserted
replaced
66:44bae6c72834 | 67:31ccaeee09c9 |
---|---|
45 [2.6, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.8, -1.3, 1.0], | 45 [2.6, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.8, -1.3, 1.0], |
46 [1.5, 1.5, 1.5, 6, 1.5, 1.5, -1.2, 1.5, -0.1, 1.0, 1.0, 1.0], | 46 [1.5, 1.5, 1.5, 6, 1.5, 1.5, -1.2, 1.5, -0.1, 1.0, 1.0, 1.0], |
47 ) | 47 ) |
48 keyDimension = 50'f32 | 48 keyDimension = 50'f32 |
49 keyGap = 10'f32 | 49 keyGap = 10'f32 |
50 backgroundColor = Vec4([1'f32, 0.3'f32, 0.3'f32, 0'f32]) | |
50 baseColor = Vec4([1'f32, 0'f32, 0'f32, 0'f32]) | 51 baseColor = Vec4([1'f32, 0'f32, 0'f32, 0'f32]) |
51 activeColor = Vec4([1'f32, 1'f32, 1'f32, 0'f32]) | 52 activeColor = Vec4([1'f32, 1'f32, 1'f32, 0'f32]) |
52 keyIndices = [ | 53 keyIndices = [ |
53 Escape, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PrintScreen, | 54 Escape, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PrintScreen, |
54 ScrollLock, Pause, | 55 ScrollLock, Pause, |
188 Vec3([1'f32, 0'f32, 0'f32]), | 189 Vec3([1'f32, 0'f32, 0'f32]), |
189 Vec3([1'f32, 1'f32, 0'f32]), | 190 Vec3([1'f32, 1'f32, 0'f32]), |
190 Vec3([0'f32, 1'f32, 0'f32]), | 191 Vec3([0'f32, 1'f32, 0'f32]), |
191 ], useOnDeviceMemory: true), | 192 ], useOnDeviceMemory: true), |
192 color: ColorAttribute[Vec4](data: @[ | 193 color: ColorAttribute[Vec4](data: @[ |
193 baseColor * 0.5'f32, | 194 backgroundColor, |
194 baseColor * 0.5'f32, | 195 backgroundColor, |
195 baseColor * 0.5'f32, | 196 backgroundColor, |
196 baseColor * 0.5'f32, | 197 backgroundColor, |
197 ]), | 198 ]), |
198 transform: ModelTransformAttribute(data: @[Unit44]), | 199 transform: ModelTransformAttribute(data: @[Unit44]), |
199 ) | 200 ) |
200 | 201 |
201 scene = newThing("scene") | 202 scene = newThing("scene") |