Microsoft MakeCode

Sprite editor: extra functions

In the sprite editor, it would be great if you could rotate an image. I’d probably only be interested in rotating it a 90 degree angle, so if flipping it horizontally/vertically were possible, that would also be fine. I think that would aid in making frames for an animation, or separate images for in a game.

2 Likes

You might need to put the pictures in an array. There is no block for rotating a sprite

No, he wants the ability to rotate an image in the image editor. So you could have a sideways coin or an upside-down tree. I also agree and would definitely like a 90-degree angle flipper.

1 Like

Ohhhhh in the editor…

agreed

2 Likes

That why I came up with this vscode extension:
Textmatrix: A Visual Studio Code extension to manipulate images in text form :wink:

1 Like

Yes! We’ve talked about a lot of features to add, and I think image flipping/rotation is high up on the list. I know I also would really like to add layers at some point (if I can figure out a kid-friendly way to do it) and maybe color replace. The main blocker is that we need to figure out a good UI that keeps the basic experience of drawing images easy and uncluttered.

If you have any specific requests, please file them on GitHub or if you don’t have a GitHub account just post them on this thread and I’ll collect them.

5 Likes

I would totally love to have layers in the sprite editor! That would be amazing!!

2 Likes

For rotating, what I would think to be the easiest is you select what you want to rotate with the marquee tool and then press a button to rotate 90 degrees in either direction. If nothing is selected, just rotate the entire image. Flipping goes the same. But the problem is when the image isn’t an exact square…

You could just have a button that says advanced or something like that and when you press on it, more buttons appear like the image flipper and layers manipulation. Press the advanced button again, and the buttons would disappear.

1 Like

Well, here’s a Python script that I wrote that will horizontally flip the image.

old_matrix = []

while True:
    line = input("Please enter matrix data: ")
    if line == "":
        break
    else:
        old_matrix.append(line)

width = len(old_matrix[0])

new_matrix = old_matrix

for count, row in enumerate(old_matrix):
    new_matrix[count] = row[::-1]

print("img`")
for row in new_matrix:
    print(row)
print("`")

Gosh, that looks ugly. Just copy the entire image by pressing ctrl + a to select everything and ctrl + c to copy. Then paste it in the console. Then press enter and out comes the flipped image. Copy that, and you should get something like this:
So you would have this:

img`
 . . . . . . c c c c c c . . . .
 . . . . . c 6 7 7 7 7 6 c . . .
 . . . . c 7 7 7 7 7 7 7 7 c . .
 . . . c 6 7 7 7 7 7 7 7 7 6 c .
 . . . c 7 7 7 c 6 6 6 6 c 7 c .
 . . . f 7 7 7 6 f 6 6 f 6 7 f .
 . . . f 7 7 7 7 7 7 7 7 7 7 f .
 . . c f 6 7 7 c 6 7 7 7 7 f . .
 . c 7 7 f 6 7 7 c c c c f . . .
 c 7 7 7 7 f c 6 7 7 7 2 7 c . .
 c c 6 7 7 6 c f c 7 7 2 7 7 c .
 . . c 6 6 6 c c f 6 7 1 1 1 1 c
 . . f 6 6 6 6 c 6 6 1 1 1 1 1 f
 . . f c 6 6 6 6 6 1 1 1 1 1 6 f
 . . . f 6 6 6 1 1 1 1 1 1 6 f .
 . . . . f c c c c c c c c c . .
`

Then paste (ctrl + v) into the image editor.

1 Like