Browse Source

add examples folder.

SakiKawasaki 5 years ago
parent
commit
35d9473ea6

+ 1 - 1
README.md

@@ -20,7 +20,7 @@
 
 # F.A.Q
 *Q*: Where I can see examples?  
-*A*: You can see this in the [`tests`](https://github.com/Ethosa/nodesnim/blob/master/tests) folder
+*A*: You can see this in the [`tests`](https://github.com/Ethosa/nodesnim/blob/master/tests) or [`examples`](https://github.com/Ethosa/nodesnim/blob/master/examples) folder.
 
 
 <div align="center">

+ 22 - 0
examples/hello_world/main.nim

@@ -0,0 +1,22 @@
+import nodesnim
+
+
+Window("Hello world")
+
+var
+  main_obj: SceneObj
+  main = Scene("Main", main_obj)
+
+  label_obj: LabelObj
+  label = Label("HelloWorld", label_obj)
+
+main.addChild(label)
+
+
+label.text = "Hello, world!"
+label.setTextAlign(0.5, 0.5, 0.5, 0.5)
+label.setSizeAnchor(1, 1)
+
+addScene(main)
+setMainScene("Main")
+windowLaunch()

+ 1 - 0
examples/hello_world/nim.cfg

@@ -0,0 +1 @@
+--path:"../../src"

BIN
examples/hello_world/one.gif


+ 5 - 0
examples/hello_world/readme.md

@@ -0,0 +1,5 @@
+# Hello, world!
+
+See [`main.nim`](https://github.com/Ethosa/nodesnim/blob/master/examples/hello_world/main.nim) file.
+
+[![gif here]](https://github.com/Ethosa/nodesnim/blob/master/examples/hello_world/one.gif)

+ 3 - 0
examples/readme.md

@@ -0,0 +1,3 @@
+# Examples
+
+1. [Hello world](https://github.com/Ethosa/nodesnim/blob/master/examples/hello_world)