Can someone help me to make a makecode extension?

Is there anyone out there who can help me and is willing to help me by making an extension? It isn’t for any project in particular, but this would be generally helpful.

My idea for the extension is an extension that lets you scale images seperate from a sprite. I know that there’s already an extension that lets you scale images, but what I’m asking for is one that does the same style of scaling as the built-in sprite scaling, where it lets you scale each dimension to any size you want, whether or not you aren’t scaling it by an integer. Also, it should be pixelated when enlarged, mostly so that it hopefully isn’t too heavy on the emulator or hardware. These blocks can either be an inline block in which it snaps right into the script and goes alongside all the other scripts, or it could be a reporter in which it will return a modified version of the original image.

Basically, what I’m asking for is an extension that makes it so that you can scale any image, whether or not it’s on a sprite, and scale it to any size you want, regardless of if it is a different aspect ratio (ratio between height and width, in case you didn’t know). Can anyone help me with this?

3 Likes

I have two replies pending, so since I’m writing the third one I’m gonna delete those two pending ones and put them here…

  1. I could probably just expose the built in sprite scaling as blocks, right? I don’t think it would be too hard. Let me find the actual code in the Explorer before I make any promises though

  2. The built in sprite scaling is just the “blit” function, so there’s probably already an extension out there that exposes it. I am making one myself now because it’s so easy! Should be out by the end of the day.

And yeah, it’s done. WoofWoofCodes/pxt-image-scaling
There are two blocks added to the Images tab, and here is a small example project:

Also yeah Riknoll/arcade-advanced-blocks is an extension that adds Blit too, but I figured that out a bit late into making the extension lol

5 Likes

Another thing, could there possibly be an extension made that mimics the SNES Mode-7? Here’s a link to an article talking about it, in case you don’t know what it is:

I’m only asking so that there can be come sort of Super Mario Kart clone for Makecode, or something along the lines of that.

Thanks! This will certainly come in handy!

1 Like

Also, could there be an extension that modifies the image block handlers to make it so that the out-of-bounds “colors” can be accessed in an easier method? This would help out a lot with changing all colors on the screen, because better access lets you shuffle all the colors out of the palette and then back in, in a different order.

PS, the out-of-bounds colors actually appear as transparent but actually render as if it were a solid color, so they can also be useful to squeeze out an extra color, even if it’s just black.

Huh?? Wdym? Ae you talking about, like, setting a color in an image to be, say, “23”? Cause I believe that is not possible. Each number in an image is stored in 4 byes of space, so larger numbers are sort of truncated before stored. Is that what you mean by out of bounds colors?

1 Like

I had noticed at one point that if you try to set the color to a value greater than 15, it’ll set it to a transparent color that will override whatever pixel is behind it to transparent. If you want to see an example, here’s a project that I had made a while back when I had discovered it:

You will have to look inside to see how it sets it to the invalid color, showing the empty black.

Hey, could you possibly try to modify Riknoll/arcade-advanced-blocks to make a way to run code while you’re in the pause menu? Also, if you do that, could you also possibly make it so that you can make sure that you are running code for specifically the pause menu and not just any screen that pauses the code? I’m thinking that you could possibly make it detect this by somehow detecting whether or not it is loading/running the pause screen scene, and then running the code if and only if it is the pause screen. Also, the second one can be done either just for the already made blocks, or it could be made for both the premade loading/unloading and the one that runs while you are on the pause screen (or other pausing screens).

1 Like

I think you just need to think with portals:

(Made this using WoofWoofCodes/pxt-javascript-extras so idk if you can do this with Richar’s extension. If not, just use mine at the same time!)

2 Likes