A solution to costumes as cursors

So, most of us know that trying to set a costume to a cursor “doesn’t work well”:

…but they do.

By using the MQTT’s new ([] to base64:: #8f0064) block, we can convert the costume to a Base-64 link that the set cursor block can use (since it supports URL linking).

Combined with the oversight I found a while ago, we can use offsets to set the hotspot of the cursor.

And voila, the costume cursor block was born!

This series of blocks makes the cursor look like this, so you can have a little Sprite as your mouse!.. it doesn’t exactly do anything, though!
download

And yes! It works with other costumes too! And it allows you to make a transparent cursor, which the original block doesn’t let you.

Have fun with this new block!

wowie
using the turtle as a cursor in the editor looks pretty cool, thanks for this!

i’m DEFINITELY gonna use this
also almost accidentslly reported your post oops

I was really disappointed when I realized the ;library block didn’t work with costumes. Thank you!

Using a behavior of leaving the first slot of [ V] of costume [ V] empty, you could simplify the find first item part:

(I accidentally copypasted it sorry)

I’m sorry I sound mildly dumb saying this but how does that last block work?
@tethrarxitet

You don’t sound dumb asking stuff like this! In fact, I always recommend asking how stuff works so you learn about it! :slight_smile: So, it loads both SciSnap!3 and the MQTT extension, then sets the cursor to a malformed text to something along the lines of:

data:image/png;base64,iVBORw0KGgo...") 4 4, url("

inside

'cursor: url("' + link + '")'

so the actual cursor will be parsed as:

cursor: url("data:image/png;base64,iVBORw0KGgo...") 4 4, url("")

which is valid data:

From cursor CSS property on MDN:
[ <url> | <url-set> ] <number>{2}?
where [<url> | <url-set>] is a referent to the cursor image and <number>{2}? is a referent to the image’s offset

[ <url> | <url-set> ] being url("data:image/png;base64,iVBORw0KGgo...") and <number>{2} being 4 4, and another entry is marked with the comma, and url("") is technically a valid entry!

So the stylesheet is accepted and shows up as such.

You can read more about that in Wowee! Another oversight block! and further, Writing and Formatting Library (official²) - this has been an old glitch that was actually extended into a feature.

SQL injection vibes :~)

You’re right, it reminds me of that! :) But it’s way safer, because you can’t do anything like \texttt{\color{white}url("\color{dodgerblue}"); filter: blur(5px); background-image:url("}\texttt{\color{white}")}, which could possibly be unsafe, but I kinda wish was available. Being able to add a filter to the world, I mean.