How do I clone image sprites?

Hi! I'm new to App Inventor. I came from Scratch, so I'm used to having the ability to clone sprites. I'm currently making a coding program on App Inventor, but I need the clone block in order to show the blocks. Could someone help me?

Hi

  1. Select (click) the Sprite to be cloned
  2. Keyboard Ctrl + C (copy)
  3. Keyboard Ctrl + V (paste)

The Clone is on top of the original as it's attributes are identical, until you change them.

Thanks, but I didn't mean that. I'm trying to look for a block that can make a copy of an image sprite

Ah - can you tell us the context of your requirement? Is that identical sprites can appear at different times during App run time?

You might want to look at:

Yes. You might want to look at this Scratch wiki page

It's a very clever Extension, delivers what you are used to in Scratch.

I'm a little confused. How do I use that extension to get clones?

There are a number of Projects on that page. Download the one by TimAI2, that should help your understanding.

See: https://ai2.metricrat.co.uk/guides/dynamic-card-style-listview

If you want to view the other projects, use Kodular (Kodular projects are not compatible with App Inventor, even though most extensions are).

We will take this under consideration. App Inventor was developed at a time when smartphone resources were very restrictive (app were allowed 8 MB of RAM, max, and loading a couple images could exhaust that) and so memory usage was a big consideration for design decisions. Now that apps can have hundreds of megabytes available, it's more feasible to let apps dynamically create components. The Map component already allows this either through the CreateMarker method or via loading feature collections. Extending the logic to other components seems reasonable.

2 Likes

You never actually told us the context of your requirement. If the number of Sprite copies is huge, then the extension is the way to go - but if there will only be a few copies, then making pre-copies and hiding them is a good method.

Has there been any update with the possibility of cloning sprites?

In my project, I shoot laser sprites from a spaceship sprite. I don't see how to get clones of the laser sprite to fire.

Thank you.

You can keep sprites in a pool and reuse them in a separate list as needed.

Here is an example using Balls ...

2 Likes

Hello, I'm trying to make a game and I need the sprite that chases another to duplicate after some time.
Can someone tell me how to do it?

You cannot clone sprites. read the post by ABG above for a workaround.