Graphics Reference
In-Depth Information
//set cone sprite
[ self addSpriteImage :image
withContentRect : CGRectMake ( 0.5 , 0 , 0.5 , 0.5 )
toLayer : self .coneView. layer ];
//set anchor sprite
[ self addSpriteImage :image
withContentRect : CGRectMake ( 0 , 0.5 , 0.5 , 0.5 )
toLayer : self .anchorView. layer ];
//set spaceship sprite
[ self addSpriteImage :image
withContentRect : CGRectMake ( 0.5 , 0.5 , 0.5 , 0.5 )
toLayer : self .shipView. layer ];
}
@end
Figure 2.8 Four sprites, arranged randomly onscreen
Sprite sheets are a neat way of reducing app size and loading performance (a single large
image compresses better and loads quicker than multiple small ones), but they can be
cumbersome to arrange manually, and they create a maintenance burden if you need to add
Search WWH ::




Custom Search