Making an extension for every JavaScript exclusive feature I can think of!

well ive mad a extension for this https://github.com/neverstopthecoder/screen-brightness but the screenBrightness command for hardware

1 Like

Are you saying I can add this block to my extension?

do you want to? because

You can!! I don’t care

1 Like

How do I do those cuz I tried in javascript and it didn;t work for me

1 Like

I have already implemented these in the extension this topic is for. The code is in here:

lines 407 - 433:

    /**
     * Draws text on an image
     */
    //% block="Print text $text on $target at x $x y $y color $c font $font"
    //% blockId="extras_print_text"
    //% target.shadow=variables_get
    //% target.defl="picture"
    //% font.shadow="extras_font_selector"
    //% group="Text"
    export function print_block(text: string, target: Image, x: number, y: number, c: number = 1, font: image.Font) {
        target.print(text, x, y, c, font)
    }

    /**
     * Draws centered text on an image
     */
    //% block="Print centered (x) text $text on $target at y $y color $c font $font"
    //% blockId="extras_print_center_text"
    //% target.shadow=variables_get
    //% target.defl="picture"
    //% font.shadow="extras_font_selector"
    //% group="Text"
    //% weight=1
    export function printCenter_block(text: string, target: Image, y: number, c: number = 1, font: image.Font) {
        target.printCenter(text, y, c, font)
    }

You can copy this if you wish.

3 Likes

Classes in blocks add it I dare you

2 Likes

It is not possible with the tools I have available, but you could try out the Block Objects extension for a similar effect.

2 Likes

maybe the public and the private commands I don’t really know if its possible I don’t use them maybe also const or var maybe even let but maybe those two wolud be dumb maybe the Buffer command like image.Buffer if theses ones help

1 Like

oh also what about the fonts like font8,font5,font12 you can include scaledfont

Add

setTimeout(Function, 1000)

1 Like

I may be missing something but the demo game doesn’t load, and even when I try to edit it, it doesn’t show the shaders

1 Like

Yep! I can see that too. I’ll look into it.

Welcome to the forums, Pixel-Fish! I like your profile picture!

1 Like

Hi, and thanks! I’ve been using makecode for a bit longer but just joined the forums some days ago, and I’ve already seen some really cool stuff here

3 Likes

Do you mean image.ofBuffer? That would be the only one on this list that is possible to add.

Ok, looks like this one should work:

Mods could you replace the seemingly broken link with this one? Thanks! <3

Roger that.

2 Likes

yeah because I think its pretty powerful with what I know it can do I think

1 Like

It does! Given the ability to change the shadow colors I see a lot of potential in this

1 Like

Is there a reverse image to buffer function somewhere? Because I went as far as to look at @Sarge’s Better Settings extension to see how he stores images and he does it manually and doesn’t use ofBuffer at all…
I will definitely have to investigate how it works because the few uses I tried didn’t quite work.

3 Likes