-
-
Notifications
You must be signed in to change notification settings - Fork 6
Hello world!
First, we have to import nodesnim
. I hope you don't need help installing the library? 👀
if you still need - https://github.com/Ethosa/nodesnim#install
import nodesnim
Then we create a window with specific params, for example:
Window("Hello, world!", 640, 360)
"Hello, world"
- window title.
640, 360
- window size.
👀
Now we can build our scene! 👺
For this, the library uses a specific syntax:
build:
- Scene my_first_scene:
- Label hello_world:
call:
setText("Hello, world!")
setTextAlign(0.5, 0.5, 0.5, 0.5)
setSizeAnchor(1, 1)
setBackgroundColor(Color(31, 45, 62))
Let's get straights now.
build
- is a macro for AST processing with YML-like syntax.
- Scene my_first_scene
-here we create a new node with type Scene
named my_first_scene
.
- Label hello_world
- similar to the previous one.
call setText("Hello, world!")
- same as hello_world.setText("Hello, world!")
.
And in the end, to make it work ...
addMainScene(my_first_scene)
windowLaunch()
Full code here: https://github.com/Ethosa/nodesnim/tree/master/examples/hello_world