Log In  

Hi guys:

With the knowledge of "one-off" graphics made via the, ?"\^. and ?"\^: I thought it might be interesting to have a few more features in P8SCII. What do you think, @zep ?

One of which is true raw-pixel graphics, for instance this picture here:
[8x8]
could be done via P8SCII with:

?"\^,0808855555b05000005050000050500000505000005050000050c55555a000000000"

and if you check that carefully you will see that the contents are exactly the same as pasting a clip of graphics in here via CTRL+C from your spritesheet and CTRL+V in here. If "." is chosen instead of 0-F, that pixel is skipped, it is not drawn. If "y" is chosen, then the foreground color is plotted instead. If "z" is chosen, then the background color is plotted instead. If "*" is chosen, then the last color cls() used will be plotted. If "/" is chosen then an invert of the current pixel there will be chosen.

An invert for instance is if the color beneath it previously is black, then it will be 15. 1 yields 14, 2 yields 13, 13 yields 2, 14 yields 1, 15 yields back to zero. The advantage of invert plotting is you can call the image once to plot it and plot directly over it again with the same image to recover the background beneath it.

The other one is a little fancier and you do not have to define its size:

?"\^[855555110^50000050^50000050^50000050^50000050^50000050^1255555100^00000000]

You can see that for every digit the cursor moves one space to the right. If it is a ^ however, it resets its current "print" position x, increases y by one pixel, and continues - until the "]" key is reached. Also if "." is chosen instead of 0-F, that pixel is skipped, it is not drawn. If "y" is chosen, then the foreground color is plotted instead. If "z" is chosen, then the background color is plotted instead. If "*" is chosen, then the last color cls() used will be plotted. "/" for invert.

For less characters in the graphic you can have:

?"\^;⁶;0408XUUᵇ⁵\0\0⁵⁵\0\0⁵⁵\0\0⁵⁵\0\0⁵⁵\0\0⁵U\10\0\0\0\0"

Where a true 8-bit character is used to store 2-pixels at a time. And there is no way to skip a pixel in this procedure.

Thus you could have a single string with 32-characters in it, each character representing 2-pixel colors, and it would draw a full-color 8x8 tile thus:

print("\^;0408"..strtile[n],x,y)

. . .

So what do you think ?

Would these be good additions to have especially regarding Tweets and 1K Jams ?

P#118241 2022-09-30 21:24 ( Edited 2022-10-01 20:37)


[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2022-12-01 22:20:00 | 0.006s | Q:6