pastebin get wJQ7jav0 pain
wget https://github.com/LDDestroier/CC/raw/master/pain.lua
std pb wJQ7jav0 pain
std ld pain pain
Syntax:
pain <filename> [view (displays the picture and exits)] [x] [y] [frameNo]
pain [-n] --no argument will also create new image
pain -h/--help
PAIN is an advanced, yet simple-to-use paint program that can be used to make artwork in ComputerCraft better and faster than ever!
PAIN automatically converts images from NFP (used by paint), NFT (used by npaintpro), BLT (used with the BLittle API), GIF (used with real paint programs), and UCG (used by silica). You can export to these formats too!
It also supports frames, which allows you to save multiple images in the native format and BLT as one file.
Controls:
Spoiler
Arrow keys: scroll canvas up/down/left/right
- +LeftShift: translate picture up/down/left/right
- +Tab: Hold while using arrow keys to guarantee that you'll only move one character at a time
F3: Show all connected monitors.
Mousewheel: change background color
- +LeftShift: change text color
- +LeftShift: also change text color
Middle click or 'T': Place text with a prompt (cancel with X)
'Z': Undo. The buffer allows for, by default, a total of five undos.
- +LeftAlt: Redo.
leftclick: Put down background color below cursor
- +LeftShift: Drag and draw a line
- +LeftAlt: Replaces the current frame with the next or previous one respectively.
- +LeftShift: Merges the current frame atop the next or previous one respectively.
- +RightShift: If using '+', will duplicate the current frame IF it's the last one.
'A': Resets scrolling to (0,0)
'C': Quickly scroll to a certain set of coordinates.
'F': Activate fill tool - left click on a spot to fill with the current color/character. Right click deletes the region instead.
- +LeftShift: Fills all empty pixels on the screen with your current text/background color.
'M': Changes the metadata attribute to each pixel. It's not terribly useful, unless you want to make a game map in PAIN or whatever.
Ctrl: Opens the menu.
'B': Toggle BLittle preview mode (if possible)
'N': Opens up the block character selection screen.
- +Shift: Opens up the special character selection screen (all characters from byte 0 to 255)
File:
- Save: Saves the picture. If no filename was given, it will ask for one.
- Save As: Same as save, but it cuts straight to the chase and asks for a filename.
- Export: Saves the picture in one of six formats, being tabular PAIN format, NFP, NFT, BLT, UCG, or GIF.
- Open: Opens another image.
- Delete frame: Deletes the current frame.
- Clear frame: Removes all dots in a frame.
- Crop frame: Removes all dots that are outside the screen.
- Choose Box Character: Opens up the box character selection.
- Choose Special Character: Opens up the special character selection.
- BLittle Shrink: Shrinks image with the BLittle API.
- BLittle Grow: Reverses the effects of BLittle Shrink.
- Cut: Select a rectangular area, and cut it to a clipboard.
- Copy: Select a rectangular area, and copy it to a clipboard.
- Paste: Paste a specified clipboard onto the canvas.
- Config options are self-explanatory and I'm tired, get off my case
- Set Screen Size: Sets the size of the "@" references of the size of the screen. Can be set to an XY value, or to that of a connected monitor.
- Set Scroll XY: Set the X and Y coordinates that you scroll to.
- Set Grid Colors: Sets the backdrop colors to your currently selected color configuration.
- Duhhh, I dunno
Screenshots:
Spoiler
Picture in PAIN.
The very same picture in Paint (rom/programs/paint)
You can make lines! And text! If middle click is impossible (say you're on one of those laptops), pressing 'T' will work the same.
Move the canvas with arrow keys!
In addition to showing screen limits, also shows block character limit! (2*x, 3*y). It even can open/save to/from the native BLittle format, BLT!
The bad stuff…
Spoiler
Bugs inherent in CC:Spoiler
- Scrolling function might not catch "key_up" event, and keep scrolling until you press and release that direction again. This is probably not a problem on CC emulators like CCEmuX though.
Bugs inherent in PAIN (that are technically solvable):
Spoiler
- Default saving format is really inefficient. Since launch, I've mitigated a bit it by removing whitespace and newlines and stuff, but it's still pretty gnarly. That's why I recommend exporting to NFT most often, especially if you don't need to take advantage of multilayer images. You can set a variable at the top of the code to set the default save format.
Demonstration video:
[media]http://www.youtube.com/watch?v=h-ofuCraKYk[/media]