We have two procedures – ChangeImage and BounceOffEdge. Now let’s look at the magic behind the app. If you have downloaded the source file as mentioned above and got it into an emulator or on a device, you should see they look like they are having fun while moving like crazy. If you are not sure what each property means, take a look at this reference.ĭon’t worry. For sprite movement, specify different Heading, Interval, and Speed properties for all of your image sprites. You can get two pictures of your choice or download the source SpriteMagic of this app and extract it. We also used two images, one named cat.png and the other one is dog.png. Just drag a Canvas to Screen1 and then drag as many ImageSprite components you like on top of Canvas component. Also we want all of our image sprites to move on the screen with different speed in different directions. If current picture is cat, we’ll change it to dog and vice versa. Our goal is when an image sprite is tapped/touched, we will change its picture. Here we will create a simple app with one canvas and 10 image sprites. If you have gone through Advanced Components tutorial, you already know that now we can manipulate a component via reference.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |