Code Monkey home page Code Monkey logo

nodesnim's Introduction

The Nim GUI/2D framework based on OpenGL and SDL2.

Open Source Love Nim language-plastic License time tracker test

channel icon channel icon

Stable version - 0.4.2

Install

  1. Install Nodesnim
    • Stable:
      nimble install nodesnim@#master
    • Nightly:
      nimble install nodesnim@#nightly
  2. Install dependencies
    • Linux (tested on Ubuntu and Mint):
      • sudo apt install --fix-missing -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev
    • Windows / MacOS:

Features

  • Godot-like node system.
  • Runtime scene loader.
  • Powerful node build system using YML-like syntax.
  • Stylesheets (CSS-like).
  • Android-like drawables.
  • Customizable GUI themes.
  • Simple usage
    import nodesnim
    
    Window("Hello, world!")
    
    
    build:
      - Scene scene:
        - Label hello:
          call:
            setSizeAnchor(1, 1)
            setTextAlign(0.5, 0.5, 0.5, 0.5)
            setText("Hello, world!")
            setBackgroundColor(Color(31, 45, 62))
    
    addMainScene(scene)
    windowLaunch()
    

Now available

This section contains links to documentation for all nodes.

Core Default nodes Control nodes 2D Nodes 3D Nodes Graphics
Anchor Node Control Node2D Node3D Drawable
Color Canvas ColorRect Sprite GeometryInstance GradientDrawable
Font Scene TextureRect AnimatedSprite Camera3D
Enums AudioStreamPlayer Label YSort Sprite3D
Exceptions AnimationPlayer Button CollisionShape2D
Image EditText Camera2D
Input Box TileMap
Rect2 HBox
Vector2 VBox
Circle2 GridBox
Polygon2 Scroll
AudioStream ProgressBar
Animation Slider
Vector3 Popup
SceneBuilder TextureButton
StyleSheet TextureProgressBar
TileSet Counter
ChartData Switch
Scripts SubWindow
Scene loader CheckBox
ToolTip
Chart

Debug mode

For use debug mode you should compile with -d:debug or --define:debug, e.g. nim c -r -d:debug main.nim.

Export

Use the Nim compiler user guide for export to the other OS. Static linking SDL2
Also use niminst tool for generate an installer

  • CrossPlatform export for Windows (tested on Windows 7 x64 and Windows 10 x64)
    • nim c -d:mingw -d:release --opt:speed --noNimblePath file.nim
    • put Runtime binaries in the folder with the program.

Screenshots

Stargazers over time

nodesnim's People

Contributors

ethosa avatar ire4ever1190 avatar jiro4989 avatar uninhm avatar ythosa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nodesnim's Issues

Develop GUI engine

Start developing the GUI engine.

You can advise how to improve it and what to add by leaving your comment here. ๐Ÿ˜„

Improve code quality

Here are some of the things I want to implement:

  • Add documentation to each public method;
  • Make a general code style;
  • Ensure code safe.

Storing Canvas contents

Hey,
Im looking for a library where I can do simple graph visualization and use Gui elements easily. Yours seems like a good fit. However, for me it is important to be able to save the canvas contents to an image file, and reading through your examples and the documentation, that doesn't seem to be possible, right?.
Oh, and it would be important to able to render text in the canvas.

Write more Wiki Pages

In order to make it easier to get acquainted with the project even for those who are new to Nim.

Static Linking

I recently found this project. I like that it seems to follow along the lines of Godot as a Godot user. I got my own little hello world not really much, not at this point anyway. I am wanting to make sure that I can compile it correctly. I seem to be having a time with trying to compile with static linking.

I am running two rigs. One is KDE Neon and the other is Win 10. No cross platform tooling, straight native compilation. Running the same version of Nim on both, 1.4.8 and using nodesnim 0.4.

I am keeping all of the SDL and Freeglut .a files in a folder called lib in my project folder.

I am running the following command on both:
nim c --dynlibOverride:SDL2 --passL: "-L lib/" main.nim

I seem to be getting compilation errors related to undefined reference of SDL_SetCursor and SDL_CreateSystemCursor with several files within nodesnim. However, just compiling without dynlibOvveride and passL, everything runs fine on both OSs. Am I missing something with the linker flag for both of them? Or is statically linking not possible?

Appreciate the project and looking forward to working with it.

Thanks for the help.

Add Standard Themes

It may be a good feature to add standard customizable themes, as in the same Android.
image

Rewrite GUI rendering

There is no point in the current implementation of the GUI part. Plus it isn't even optimized.

Android example

Write an example of a program that can be compiled on Android.

(Before that, understand how to do it at all._.)

Blurry text

Describe the bug
Text is blurry and difficult to read

To Reproduce
To reproduce just run this code

import nodesnim

Window("Hello, world!")

build:
  - Scene scene:
    - Label hello:
      call:
        setSizeAnchor(1, 1)
        setTextAlign(0.5, 0.5, 0.5, 0.5)
        setText("Hello, world!")
        setBackgroundColor(Color(31, 45, 62))

addMainScene(scene)
windowLaunch()

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
https://imgur.com/CGVkdMj.png

Desktop

  • OS: Linux
  • DE: xfce
  • Nim: 1.6.0

Additional context
Ran using latest commit on nightly branch (#398858c)

Add scripting support

Maybe it will be a good feature to use Python as a scripting language for scenes. ๐Ÿค”

Error: Attempting to call routine : 'Color'

Describe the bug
Compile time error , trying to compile a nodesnim sample "hello, world".
Compile time error:

"unifont.ttf"; this will become a compile time error in the future [CStringConv]
/Users/aaronm/.nimble/pkgs/nodesnim-0.3.2/nodesnim/core/font.nim(31, 47) Error: attempting to call routine: 'Color'
found sdl2.Color [type declared in /Users/.nimble/pkgs/nodesnim-0.3.2/nodesnim/thirdparty/sdl2.nim(545, 3)]

To Reproduce
Steps to reproduce the behavior:

  1. compile hello.nim nim c -r hello.nim

Expected behavior
File should compile and show output (gui)

Desktop (please complete the following information):

  • Device: osx
  • OS: 11.6 BigSurr

Additional context
Source Code:
`import nodesnim

Window("Hello, World")

build:

  • Scene scene
  • Label hello:
    call setSizeAnchor(1, 1)
    call setTextAlign(0.5, 0.5, 0.5, 0.5)
    call setText("Hello, World")
    call setBackgroundColor(Color(31, 45, 62))

addMainScene(scene)
windowLaunch()`

Tree of nimble/bin*************
tree ~/.nimble/bin [17:04:37]
/Users/.nimble/bin
โ”œโ”€โ”€ SDL2
โ”œโ”€โ”€ SDL2_image
โ”œโ”€โ”€ SDL2_mixer
โ”œโ”€โ”€ SDL2_ttf
โ”œโ”€โ”€ biblioteca_guarrilla -> ../pkgs/biblioteca_guarrilla-#head/biblioteca_guarrilla
โ”œโ”€โ”€ choosenim
โ”œโ”€โ”€ ducere -> ../pkgs/basolato-0.10.0/basolato/cli/ducere
โ”œโ”€โ”€ faker -> ../pkgs/faker-0.14.0/faker/cli/faker
โ”œโ”€โ”€ inim -> ../pkgs/inim-0.6.1/inim
โ”œโ”€โ”€ nim
โ”œโ”€โ”€ nim-gdb
โ”œโ”€โ”€ nimble
โ”œโ”€โ”€ nimgrep
โ”œโ”€โ”€ nimpretty
โ”œโ”€โ”€ nimsuggest
โ””โ”€โ”€ testament

Snake game doesn't work

libglut.so.3: cannot open shared object file: No such file or directory
could not load: libglut.so.3

I get that error when running the examples

Peppermint 10 x64 -- Nim 1.2.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.