comparison tests/test_mesh.nim @ 302:da0bd61abe91

did: change API for ECS
author Sam <sam@basx.dev>
date Tue, 27 Jun 2023 00:17:40 +0700
parents b5fb27b0f7a4
children b145a05c2459
comparison
equal deleted inserted replaced
301:bf5982802e2c 302:da0bd61abe91
1 import semicongine 1 import semicongine
2 2
3 proc main() = 3 proc main() =
4 var ent1 = newEntity("hoho", rect()) 4 var ent1 = newEntity("hoho", {"mesh": Component(rect())})
5 var ent2 = newEntity("hehe", ent1) 5 var ent2 = newEntity("hehe", [], ent1)
6 var myScene = newScene("hi", ent2) 6 var myScene = newScene("hi", ent2)
7 myScene.root.transform = translate3d(0.2'f32, 0'f32, 0'f32) 7 myScene.root.transform = translate3d(0.2'f32, 0'f32, 0'f32)
8 myScene.root.children[0].transform = translate3d(0'f32, 0.2'f32, 0'f32) 8 myScene.root.children[0].transform = translate3d(0'f32, 0.2'f32, 0'f32)
9 var scenes = [ 9 var scenes = [
10 # loadScene("default_cube.glb", "1"), 10 # loadScene("default_cube.glb", "1"),