# Who knows, how can I rotate a spirit?

**URL:** <https://forum.makecode.com/t/who-knows-how-can-i-rotate-a-spirit/1955>\
**Category:** Help\
**Created:** [May 5, 2020, 7:48am UTC](https://forum.makecode.com/t/who-knows-how-can-i-rotate-a-spirit/1955 "2020-05-05T07:48:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mouseart](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mouseart/32/925_2.png) [@mouseart](https://forum.makecode.com/u/mouseart)\
**Post date:** [May 5, 2020, 7:48am UTC](https://forum.makecode.com/t/who-knows-how-can-i-rotate-a-spirit/1955/1 "2020-05-05T07:48:19Z")

</div>

I’ve looked at all the blocks carefully, but I still haven’t seen the block that can let me rotate an spirit. Does anyone know how to do it?

---

<div class="post-metadata">

**Author:** ![ractive](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ractive/32/928_2.png) [@ractive](https://forum.makecode.com/u/ractive)\
**Post date:** [May 5, 2020, 8:32am UTC](https://forum.makecode.com/t/who-knows-how-can-i-rotate-a-spirit/1955/2 "2020-05-05T08:32:43Z")

</div>

There really seems to be no way to rotate an image using blocks only, but it can be easily done in Javascript like this: [https://makecode.com/\_HedcEAPDhLqy](https://makecode.com/_HedcEAPDhLqy)

---

<div class="post-metadata">

**Author:** ![mouseart](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mouseart/32/925_2.png) [@mouseart](https://forum.makecode.com/u/mouseart)\
**Post date:** [May 5, 2020, 8:36am UTC](https://forum.makecode.com/t/who-knows-how-can-i-rotate-a-spirit/1955/3 "2020-05-05T08:36:54Z")

</div>

Thank you very much, this really solves the problem.

---

<div class="post-metadata">

**Author:** ![ractive](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ractive/32/928_2.png) [@ractive](https://forum.makecode.com/u/ractive)\
**Post date:** [May 5, 2020, 8:38am UTC](https://forum.makecode.com/t/who-knows-how-can-i-rotate-a-spirit/1955/4 "2020-05-05T08:38:40Z")

</div>

BTW: On the PyGamer I faced crashes, when rotating an image and needed to add a wordaround:  
See also [https://forums.adafruit.com/viewtopic.php?f=64&t=164807&p=810471](https://forums.adafruit.com/viewtopic.php?f=64&t=164807&p=810471)

---

<div class="post-metadata">

**Author:** ![otorp2](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/otorp2/32/940_2.png) [@otorp2](https://forum.makecode.com/u/otorp2)\
**Post date:** [May 5, 2020, 12:02pm UTC](https://forum.makecode.com/t/who-knows-how-can-i-rotate-a-spirit/1955/5 "2020-05-05T12:02:16Z")

</div>

Thanks for this - I love it!  
For some reason it complains about a width property of null when the angle is anything but 90,180, or 270?

How do you do this with 91 degree angle etc?

---

<div class="post-metadata">

**Author:** ![otorp2](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/otorp2/32/940_2.png) [@otorp2](https://forum.makecode.com/u/otorp2)\
**Post date:** [May 5, 2020, 12:16pm UTC](https://forum.makecode.com/t/who-knows-how-can-i-rotate-a-spirit/1955/6 "2020-05-05T12:16:15Z")

</div>

Also look at all this cool stuff! - what is doubledX? blitRow?

 ![Screenshot 2020-05-05 at 8.14.35 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/7c7d50a8c9950d060f3967273ec040518b711278.png)

---

<div class="post-metadata">

**Author:** ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)\
**Post date:** [May 5, 2020, 3:01pm UTC](https://forum.makecode.com/t/who-knows-how-can-i-rotate-a-spirit/1955/7 "2020-05-05T15:01:20Z")

</div>

Image literals (img``) need to be cloned before any mutation operation. You can maybe try again on a clone() of the image.

---

<div class="post-metadata">

**Author:** ![ractive](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ractive/32/928_2.png) [@ractive](https://forum.makecode.com/u/ractive)\
**Post date:** [May 6, 2020, 10:18pm UTC](https://forum.makecode.com/t/who-knows-how-can-i-rotate-a-spirit/1955/8 "2020-05-06T22:18:22Z")

</div>

You only can rotate the image in 90° steps. That’s by design.

---

<div class="post-metadata">

**Author:** ![otorp2](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/otorp2/32/940_2.png) [@otorp2](https://forum.makecode.com/u/otorp2)\
**Post date:** [May 7, 2020, 2:48am UTC](https://forum.makecode.com/t/who-knows-how-can-i-rotate-a-spirit/1955/9 "2020-05-07T02:48:47Z")

</div>

well…If you load this extention by @AlexK

> **[robo-technical-group/pxt-arcade-image-transform](https://github.com/robo-technical-group/pxt-arcade-image-transform)**
>
> Extension to transform (scale and rotate) images in MakeCode Arcade - robo-technical-group/pxt-arcade-image-transform

and run this i simplified by jacob\_c

> **[rotate srite](https://arcade.makecode.com/05143-29328-22260-87057)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

It doesn’t have to be realistic, just believable - I believe it’s rotating!
