8- SpriteAnimation

8- SpriteAnimation - Sprite Animation CSE to Fall 2010...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Click to edit Master subtitle style 5/7/11 “Sprite” Animation CSE 390 Fall 2010
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
5/7/11 Getting started The goal of this demo is to show you how to create an animation loop inside of an image object, and to then animate that image object across the screen. To do this we’ll need to learn how to create and then populate an array of images. We’ll also learn how to force an iPhone app to display in
Background image of page 2
5/7/11 Develop resources For this demo I created an animation of a walk cycle for a character using Poser, a 3D character animation software package. The animation was rendered as 15 still images at 320 X 240 resolution (.png format) with an alpha (transparent) background. I also chose a background that was 640 X 480.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
5/7/11 Create the project 1. In Xcode create a View-Based Application, name it and save it (I named my project boneyard). 2. Drag and drop your images to the resources folder, remembering to check that they should be copied to the destination folder. I had to rename the animation frames b01.png, b02.png, b03.png … for a
Background image of page 4
5/7/11 Define a method header In the ViewController.h file (from the Classes folder) I defined an image object ( walk ) and an array ( anim ), and established their properties. I also defined a method for moving the object called move . The NSMutableArray class simply means the dimensions of the array can change. The code looks like this: #import <UIKit/UIKit.h> @interface boneyardViewController : UIViewController { // These 2 methods create the UIImage object and the array of images that will display inside of it IBOutlet UIImageView * walk ; NSMutableArray * anim ; }
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 18

8- SpriteAnimation - Sprite Animation CSE to Fall 2010...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online