- C++ 100%
| ColorFile | fixed stamp bug where is fails to stamp chars from the middle of files | |
| learning | adding gitignore | |
| Stamp | Linux tutorial works now | |
| .gitignore | adding gitignore | |
| README.md | Update README.md | |
Cursed Tools
Enhancing the graphical capabilities of ncurses
This repo contains multiple programs to make complicated ncurses graphics easier to implement.
Stamp
stamp() is a recreation of the pygame blit() function but rewritten for ncurses. The stamp() fuction provides a simple way to display text art from a seperate text file to the ncurses screen. This enables users to make much more complicated TUIs for their ncurses programs while keeping the implementation simple.
Install Ncurses
This should already be installed on most computers. On Debian-based Linux, you may need to run sudo apt install libncurses-dev
How To:
- clone repo
- copy
stamp.cppto yourCPATH - complile and run
StampTutorial.cpp(StampTutorialMac.cppfor Mac) and link-lncursesw(-lncursesfor Mac) to learn how to use thestamp()function
stamp() allows for easy desplay of text art from separate files to keep the graphics separate from the program.
stamp(y, x, height, length, ypos, xpos, file)
or
stamp(y, x, height, length, ypos, xpos, file, win)
y - the number of the first row in the art file to be stamped
x - the number of the first column in the art file to be stamped
height - the number of rows in the art file to be stamped
length - the number of columns in the art file to be stamped
ypos - the y postition for the top left corner of the art to be stamped
xpos - the x postition for the top left corner of the art to be stamped
win - (OPTIONAL) the window you would like to stamp into
additional info about stamp():
stamp() works on its own for basic ASCII charicters.
UTF-8 chars have to be enabled by #include <locale> and declaring setlocale(LC_ALL, "") at the top of the main function.
Additionaly, Capital Letter Thorn Þ is used for transparent space in the art file. This is becuase is the smallest sized chariter in UTF-8 that doent seem that important.
ColorFile - Incomplete
Art program for coloring text art and creating colorfiles for the colorstamp() function to stamp with color.