Dynamic Movable Pen-Created Windows

Heya! Earlier today, I was bored in English class since we were doing nothing and had eight minutes of class left, so I started a project that aims to create "sprites" (more closely morphs) with only the pen that can be dragged and messed with as you like.
Here is my working prototype:
window managementt system script pic (2)
It is very simple to use, here's an example:

The width and height values are required if you want it to be draggable. The code value is the code that will be ran in a forever loop to render the sprite. Do note that anything that forces the code to wait will halt rendering until it no longer has to wait, meaning that it will render everything up until the waiting point for a frame then disappear until it no longer has to wait.
The points variable is a list that looks like (list (list [10] [10] @delInput@addInput) (list [20] [22] @delInput@addInput) @delInput@addInput), where the first list is the top left and the second is the bottom right (the bottom right is only natively used for the draggable bounding box).

PLEASE MODIFY THIS BLOCK!

This block is still buggy and lacking a lot of things, so feel free to edit it to your needs (and preferably share them here)!

This was mainly inspired by Morphic.js, which was made by Jens and is what Snap! runs off of.

*This block uses two external blocks. set cursor [auto v]::looks by @sathvikrias (not required) and (is @list inside of @list ?::sensing) by myself (required)

clarifier: by the scisnap library, but with modifications by me.

Cool idea !

@bluebaritone21 @coder_07 maybe this could be used for SnapNix visual mode if wrapped into a neat block?

huge script

I made it one block


image

yeah

It has an updated text renderer


giving windows error simulator vibes

You need when flag clicked forever { clear }

yeah. also, is there any way to control the draw order?

I didn't even think about that
There is not, that would have to be added, though I wouldn't know how

i might be able to do that then

I'm going to update the base block to not start dragging unless you hold the mouse down while hovering over the draggable part

I made windows resizeable and the smartwrite block more responsive
Screen-Recording.mp4 [video-to-gif output image]

Epic! super fancy! I think we can use that to make some x-term-like windowed consoles for Snap!nix Neo. Thanks!


Super cool project! A general UI library using pen is a great idea!

My only concern is making responsive windows for things like games. You put the rendering code in and that code is ran every frame, which makes it difficult to do things that are beyond just "hey this app has a button that switches your mouse cursor to the pointer and turns a different color while you hover over it"

True... Perhaps I should rework Snap!nix's process to keep state, along with the script it's running.

Maybe there could be a memory system (that would be theoretically way better than this one)?


So then you could do something like this: