You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

2.1 KiB

Nasu6

A minimal chr editor, written in ANSI C.

Build

To build Nasu6, you must have SDL2.

sudo apt-get install libsdl1.2-dev

Controls

I/O

  • E Export

Select

  • 1 Color1
  • 2 Color2
  • 3 Color3
  • 4 Color4

Paint

  • mouse1 Paint
  • mouse2 Toggle Erase

TODO

  • Export png
  • Cleanup option[space]
  • Brush size[zx]
  • Patterns[1234567890]
  • Zoom options[~]
  • Move canvas[wasd]
  • Add canvas size argument
  • Add import image argument

Optimization

  • Don't update pixels unless something changed.

Notes

You can do scaling if you are getting sprites from a texture with SDL_RenderCopy() but i cannot guarantee you antialiasing.

With function SDL_RenderCopy() you pass 4 params:

    a pointer to a renderer (where you are going to renderize).
    a pointer to a texture (where you are going to get the sprite).
    pointer to source rect(the area and position where you get the sprite on the texture).
    and pointer to dest rect(the area and position on the renderer you are going to draw).

You should only modify your dest rect like for example, if you are going to render an image 300 x 300 and you want it scaled, your dest rect should be like 150 x 150 or 72 x 72 or whatever value you wanted to scale.

Noodle's classic halftone

(x % 3 == 0 && y % 6 == 0) || (x % 3 == 2 && y % 6 == 3)

Cleanup routine

function _jagged (x, y, w, h, pixel, data) {
    const neighs = neighbors(x, y, w, h, data)
    if (abs(pixel) && abs(neighs.n) && abs(neighs.e) && !abs(neighs.ne) && (!abs(neighs.s) || !abs(neighs.w))) { return 'red' }
    if (abs(pixel) && abs(neighs.n) && abs(neighs.w) && !abs(neighs.nw) && (!abs(neighs.s) || !abs(neighs.e))) { return 'red' }
    if (abs(pixel) && abs(neighs.s) && abs(neighs.e) && !abs(neighs.se) && (!abs(neighs.n) || !abs(neighs.w))) { return 'red' }
    if (abs(pixel) && abs(neighs.s) && abs(neighs.w) && !abs(neighs.sw) && (!abs(neighs.n) || !abs(neighs.e))) { return 'red' }
    return abs(pixel) ? 'black' : 'white'
  }