Problems with the text sprite extension flying up

I am doing a PYPx project about literacy for impoverished people, and as an action me and my partner are hosting a video game tournament about UNICEF Thailand’s mobile library. the competition is with an entry fee. I am having some problems with text that tells you what to do which I was inspired to do by Rockstar’s game GTA5.

i have arcade scroll on and for some reason when i turn it on the second time my text sprite flys up and is gone.

here is the link to the program:

1 Like

Ah, I see exactly what’s happening here. This is a classic “text sprite moving with camera” issue in MakeCode Arcade. Here’s the breakdown:

  1. When you first create a text sprite and turn on scene.scrollView, it behaves as expected because it’s positioned relative to the camera.
  2. When you toggle scroll again or re-enable scrolling, the camera updates, but your text sprite isn’t “locked” to the screen—it’s still using its original world coordinates. That’s why it looks like it “flies up” or disappears—it’s now off-screen relative to the new camera position.

How to fix it:

  • You need to pin the text sprite to the camera instead of the world. In MakeCode Arcade, you can do this using sprite.setFlag(SpriteFlag.StayInScreen, true) or by updating its position every frame relative to the camera.

Example :

Uploading: image.png…

  • If you have multiple scroll toggles, just make sure you don’t recreate the sprite or reset its Y position relative to the camera every time. Keep it pinned.

Basically: text sprites are world objects by default—once the camera moves or scroll toggling happens, their world coordinates don’t automatically follow. Pinning them fixes that.

1 Like