Log In  

Cart #54761 | 2018-08-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1


In composing scenes made of polygons and shapes, I needed a way to lay out a scene and then retrieve the coordinates of the individual shapes. Now you can retrieve the shapes themselves!

Controls:
mouse: move cursor
click: place line point
up/down: cycle colors/sprites
left/right: cycle through drawn shapes/cursor
X (p1 X): cancel shape/delete selected shape
SEDF (p2 directionals): adjust cursor/shape/point position
Q (p2 X): toggle hud/cursor
tab (p2 O): toggle fg
Z (p1 O): hold for secondary functions:
+drawing line: lock to 90-degree angles
+drawing rect: lock to square
+up/down: cycle shape types
+left/right: cycle through selected shape's points
+tab (p2 O): copy selected shape/cursor coordinates to clipboard
+Q (p2 X): copy all shapes to clipboard

The foreground elements I was using, as they were relevant only to my concurrent project, I commented out. You can add your own foreground draw commands in the labeled segment of the _DRAW() function.

When copying your shapes to the clipboard, the data will be formatted for pico's built-in draw functions. To change the name of the draw functions exported, modify the strings in the PREFIXES table at the top of the _INIT() function. To change the separator between each shape when copying all shapes change the SHAPELISTBREAK string.

Todo:

  • add more complex shapes: polygons, complex sprites, ovals
  • include fill states
  • add layer adjustment

(this previous version is 0.1)

Cart #54543 | 2018-07-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

P#54544 2018-07-31 03:08 ( Edited 2018-08-06 06:09)

Pretty neat. How do you extract/export the shapes? Is that implemented yet?

P#54599 2018-08-02 09:58 ( Edited 2018-08-02 13:58)

@hwd2002 Operating under the impression that i had no way to get data directly from the running cart, i was manually copying data out. Now i see that i can send things to the clipboard so that's going on the todo list. Thanks for the feedback!

P#54632 2018-08-03 02:59 ( Edited 2018-08-03 06:59)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 22:31:05 | 0.014s | Q:19