# Sprites on Canvas show on Live Test but not on Android Mobile

**URL:** <https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990>\
**Category:** Questions about Thunkable X\
**Created:** [June 3, 2020, 1:07pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990 "2020-06-03T13:07:49Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![sagart8379](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@sagart8379](https://community.thunkable.com/u/sagart8379)\
**Post date:** [June 3, 2020, 1:07pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/1 "2020-06-03T13:07:49Z")

</div>

I have designed a simple game of Hangman. I have used Canvas and few Sprites.  
In the beginning, the Sprites do not show up but as the user tries to guess alphabets, different Sprites show up.

This works perfectly in Live Test - please refer “Hangman Screenshot 1” file. However, when I see the same game on Thunkable App on my Android phone, the Canvas is not visible at all. I waited for few minutes (just in case images take time to load), it still doesn’t show. – please refer “Hangman Screenshot 2” file.

The same issue comes when I download and install Android APK.

I searched documentation and found that there may be issue with PNG images. So I chanegd to JPG, no success. I tried GIF also, but no success.

Can you please guide me?

 ![Hangman screenshot 1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/5/c533d801f08cb38967c8d3ea39d094db64396712.png) ![Hangman screenshot 2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/5/056c7a7c8f816589e1aae7ea7505e05da05d0e06.jpeg)

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 3, 2020, 1:47pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/2 "2020-06-03T13:47:15Z")

</div>

Check the use of the when loads Canvas block

---

<div class="post-metadata">

**Author:** ![sagart8379](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@sagart8379](https://community.thunkable.com/u/sagart8379)\
**Post date:** [June 3, 2020, 1:55pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/3 "2020-06-03T13:55:39Z")

</div>

Dear @actech, Thanks for your quick reply.

In the “when Canvas loads” block, I have moved my Sprites out of Canvas. When the user presses an alphabet (which are displayed on screen), these Sprites start showing up on Canvas. I move them back to Canvas if the guessed alphabet is wrong.

As I have mentioned earlier, this functionality works perfect on Live Test. But not on android mobile.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 3, 2020, 1:57pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/4 "2020-06-03T13:57:04Z")

</div>

If you give me a link to your project, I can determine the reason.

---

<div class="post-metadata">

**Author:** ![sagart8379](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@sagart8379](https://community.thunkable.com/u/sagart8379)\
**Post date:** [June 3, 2020, 2:04pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/5 "2020-06-03T14:04:58Z")

</div>

Here is the link of my project:  
[https://x.thunkable.com/copy/23174adc0c96e00887dcc704931fff34](https://x.thunkable.com/copy/23174adc0c96e00887dcc704931fff34)

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 3, 2020, 2:33pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/6 "2020-06-03T14:33:45Z")

</div>

My God! How many duplicate blocks! You probably did this app for at least one month!

But I see a problem with the canvas.

---

<div class="post-metadata">

**Author:** ![sagart8379](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@sagart8379](https://community.thunkable.com/u/sagart8379)\
**Post date:** [June 3, 2020, 2:35pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/7 "2020-06-03T14:35:00Z")

</div>

This is based on my understanding of how to use Thunkable… 😃

Please help me fix the Canvas issue.  
Also, if you could help with how to optimize it - that will be cherry on the cake.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 3, 2020, 2:42pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/8 "2020-06-03T14:42:39Z")

</div>

I added a blank canvas and it works. So there’s a problem with the main canvas.

When you created sprites, you tested the app on your device and it worked. When did you notice that the canvas stopped working on your device?

I deleted all the blocks, but the canvas doesn’t work either.

I think there is a problem with overloading the canvas with sprites. When I deleted a few sprites, the canvas started working on Android.

---

<div class="post-metadata">

**Author:** ![sagart8379](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@sagart8379](https://community.thunkable.com/u/sagart8379)\
**Post date:** [June 3, 2020, 3:26pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/9 "2020-06-03T15:26:07Z")

</div>

When I completed the program to my satisfaction, I downloaded it for Android and installed on my phone. There I noticed that Sprites are not loading (after initial screen). Later I checked Live Companion app of Thunkable and faced the same issue.

Since I have to show alphabets, I need 26 Sprites. Plus 5 spaces (= 5 more Sprites) and 4 Sprites for Hangman. Is there any better way to achieve / optimize this?

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 3, 2020, 3:31pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/10 "2020-06-03T15:31:31Z")

</div>

I created 200 sprites programmatically and don’t see a problem with that number. Also uploaded a large image - also no problem. Apparently, the problem is that sprites are added on the panel, or there is a bad sprite that causes a crash. I can’t understand it yet.

---

<div class="post-metadata">

**Author:** ![sagart8379](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@sagart8379](https://community.thunkable.com/u/sagart8379)\
**Post date:** [June 3, 2020, 3:39pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/11 "2020-06-03T15:39:02Z")

</div>

Oh okay!!

I am also trying to recreate the Sprites and will experiment. Appreciate if you could help resolve it.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 3, 2020, 3:56pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/12 "2020-06-03T15:56:35Z")

</div>

I started deleting sprites from the top and after deleting Type\_Sprite 8 the canvas started working.

I’m afraid re-creating it won’t solve the problem

---

<div class="post-metadata">

**Author:** ![sagart8379](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@sagart8379](https://community.thunkable.com/u/sagart8379)\
**Post date:** [June 3, 2020, 4:38pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/13 "2020-06-03T16:38:37Z")

</div>

Thanks for your assistance. I am wondering why that Sprite and the Canvas is not functioning correctly… ☹

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 4, 2020, 8:03am UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/14 "2020-06-04T08:03:50Z")

</div>

I checked your project again and see that the problem is not with sprite. This time I started deleting all the sprites from the beginning and the canvas only started working when I got to the letter sprites. After that, I added 5-6 sprites and the canvas still worked.

Unfortunately, I can’t answer your question. There is a workaround, but it is only available to programmers who know how to work with HTML canvas and JavaScript

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 4, 2020, 8:06am UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/15 "2020-06-04T08:06:16Z")

</div>

About optimization.

1. I recommend that you study all the blocks for working with the list and use the block for creating a list from a line of text with separators to get the list.

2. also look at any blocks - this will allow you to reduce the processing blocks for clicking on buttons

3. you have a very long condition. See how it can be shortened. To do this, study the concept of functions

---

<div class="post-metadata">

**Author:** ![sagart8379](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@sagart8379](https://community.thunkable.com/u/sagart8379)\
**Post date:** [June 12, 2020, 5:13am UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/16 "2020-06-12T05:13:12Z")

</div>

Thanks @actech for spending time to help me. I will build this app once again by keeping in mind your suggestions.

Thanks.

---

<div class="post-metadata">

**Author:** ![kodingbean9y](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kodingbean9y/32/138673_2.png) [@kodingbean9y](https://community.thunkable.com/u/kodingbean9y)\
**Post date:** [September 1, 2022, 5:57am UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/17 "2022-09-01T05:57:39Z")

</div>

Hi have you find a solution for this issue, because I found the problem like you as well  
No matter I rebuild and keep changing sprite, it still be the same doesn’t work

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [September 1, 2022, 12:04pm UTC](https://community.thunkable.com/t/sprites-on-canvas-show-on-live-test-but-not-on-android-mobile/590990/18 "2022-09-01T12:04:01Z")

</div>


