Log In  


Cart #pickapoint-0 | 2022-11-17 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

(v00 11-17-22)
TO LOAD THIS PICO-8 CART, in immediate mode, type: load #pickapoint
^^ This version is for examining and learning from. The way I will mostly code from now on.

Cart #pickapoint_shr-2 | 2022-11-17 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

TO LOAD THIS PICO-8 CART, in immediate mode, type: load #pickapoint_shr
^^ This version is for use in your own code. It's a lot smaller in size. If you use CLIPBOARD to copy and paste, be sure to press CTRL+P prior to pressing CTRL+V to paste and after CTRL+V as well.

Hello.

Too often I have needed a tool to align elements on the screen. While years ago I wrote a quick & dirty program to do this, I felt it was time to make a good and proper one. PickAPoint !

And while the code above is quite large with lots of information on what is happening and what the code does, the one beneath has been Shrinko-8ed and is quite small, using less than 2% of your total character space and less than 7% of your total token space for your program.

Call it as a function either in immediate mode or your own code.

Hold down the SHIFT key + arrows to change the size of your grid.
Hold down the CTRL key + arrows to jump around the grid.

Use the arrow keys normally to navigate the area.

Press QUOTE key by itself to enter TEXT MODE where you can type text and it adjusts that centered on the cursor.

Press "\" by itself to jump to the center. If you are in TEXT MODE then the text will be centered on the 64x64 coordinates and you can see in the information panel below precisely how to code that.

If you are in not and instead in pixel mode, the cursor will jump to 64x64 exactly.

Press CTRL+A to flip between using a resolution of 128x128 matching most grid divisions or to see the grid entirely on the screen with 127x127.

Press CTRL+K to change the grid-color (Kolor). By default it chooses color #1, dark blue. However when you call it as a function, the single argument used there changes the grid color to this.

Press TAB key to exit out and return back to your program. There are no worries about losing your screen data, that is all saved prior to the main code and recovered at the end.

Be aware if you call it as a function in immediate mode instead of from your own code, the key repeat will be faster than normal. Something for @zep to look into possibly.

And there you have it ! A useful utility to help you align text and graphics, PickAPoint !

2



[Please log in to post a comment]