Time for another extension inspired by the Zelda-like game we’ve been working on for stream. I present: riknoll/arcade-drawing-utils
This extension has some notable improvements over the base drawing blocks in the image category:
All x/y coordinates in the drawing functions are represented by points rather than two numbers. You can also use sprites or tilemap locations wherever a point is accepted
All of the target image shadow blocks are replaced with the screen by default
The fill and outline blocks are combined with a dropdown to switch between
Adds circles, triangles, and four sided polygons
Adds a block for drawing a thick line in addition to the usual 1-pixel wide lines
Adds a block for copying part of an image to another image
Adds a block for drawing tilemaps to the screen (great for games with multiple tilemaps)
In addition to drawing, there are some other new transform blocks for some nifty image effects:
Lots of blocks for swapping colors in images
A new block for scrolling images by an x/y value
A block for rotating images in 90 degree increments
Finally, this extension also provides lots of way for you to make custom render functions that draw to the screen:
Render on z (just like the similar block in jwunderl/arcade-sprite-utils)
A dockable version of render on z that you can place inside a function
Renderables that can be assigned to variables and destroyed (great for drawing temporary things like effects or menus)
This has been such a fun series to watch! I’m looking forward to watching live on Friday! I have Fridays off now, so I’m hoping to catch y’all every week. I missed last week because I got distracted.
do whatever you’re comfortable with! there are lots of ways to do similar things. this extension gives you a lot more flexibility in how you draw things, but i’d also say it’s at the expense of being much more complicated/advanced
hmm, yeah looks like there may be a bug. i’ll take a look when i have a sec
but, i think i should also point out you’re using the “render above sprite” block incorrectly:
you never want to call “render above sprite” inside of an on game update, you only need to register the handler once (i.e. when you create the sprite)
that block is for rendering to the screen, but you’re drawing to a sprite’s image (which you don’t need a special block to do). try changing the image to the screen block from the images category and see if that’s closer to what you want
if the “remove all renderables” block was working, your code would result in nothing being drawn to the screen because you’re immediately removing the renderable after registering it. renderables don’t run immediately, they only run when the screen is rendered