# Trying to Rotate and Flip Image

**URL:** <https://forum.code.org/t/trying-to-rotate-and-flip-image/32412>\
**Category:** CS Principles\
**Tags:** applab\
**Created:** [March 8, 2020, 10:26pm UTC](https://forum.code.org/t/trying-to-rotate-and-flip-image/32412 "2020-03-08T22:26:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![blutke](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/blutke/32/5497_2.png) [@blutke](https://forum.code.org/u/blutke)\
**Post date:** [March 8, 2020, 10:26pm UTC](https://forum.code.org/t/trying-to-rotate-and-flip-image/32412/1 "2020-03-08T22:26:24Z")

</div>

I am trying to make it so what when my image hits the side or when it hits the top of the screen the image is going to flip along its X or Y axis, I am not exactly sure how to make it happen, but was wondering if anyone could help me out, below is a link to my code.

> **[Check out what I made](https://studio.code.org/projects/applab/vCywiEAH33WfbOcX-LYODd17jA0bg8QaLGY5jbHeTyc)**
>
> I wrote the code myself with Code.org

---

<div class="post-metadata">

**Author:** ![infinitestasis](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/infinitestasis/32/5047_2.png) [@infinitestasis](https://forum.code.org/u/infinitestasis)\
**Post date:** [March 9, 2020, 3:18am UTC](https://forum.code.org/t/trying-to-rotate-and-flip-image/32412/2 "2020-03-09T03:18:20Z")

</div>

You will probably need 4 different images to make this work.

---

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [March 9, 2020, 5:29am UTC](https://forum.code.org/t/trying-to-rotate-and-flip-image/32412/3 "2020-03-09T05:29:24Z")

</div>

Not an expert in App Lab, but did find this old posting. Would this work?

> [@SetStyle Advanced Help](https://forum.code.org/t/setstyle-advanced-help/25770/3):
>
> You can use the CSS transforms scaleX and scaleY to flip horizontally and vertically, respectively. Eg: setStyle("image1", "transform: scaleX(-1);");

Mike
