89754

所属分类:图形图像处理
开发工具:Objective-C
文件大小:892KB
下载次数:1
上传日期:2013-12-08 10:45:07
上 传 者uihhhfff
说明:  对于iOS UI图像,精选ios编程学习,很好的参考资料。
(For the iOS UI image, select learning IOS programming, a good reference.)

文件列表:
SpriteAnimationDemo (0, 2011-11-19)
SpriteAnimationDemo\.DS_Store (6148, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo (0, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj (0, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj\project.pbxproj (13668, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj\project.xcworkspace (0, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj\project.xcworkspace\contents.xcworkspacedata (164, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj\project.xcworkspace\xcuserdata (0, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj\project.xcworkspace\xcuserdata\rafalsroka.xcuserdatad (0, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj\project.xcworkspace\xcuserdata\rafalsroka.xcuserdatad\UserInterfaceState.xcuserstate (23378, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj\project.xcworkspace\xcuserdata\rafalsroka.xcuserdatad\WorkspaceSettings.xcsettings (383, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj\xcuserdata (0, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj\xcuserdata\rafalsroka.xcuserdatad (0, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj\xcuserdata\rafalsroka.xcuserdatad\xcdebugger (0, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj\xcuserdata\rafalsroka.xcuserdatad\xcdebugger\Breakpoints.xcbkptlist (91, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj\xcuserdata\rafalsroka.xcuserdatad\xcschemes (0, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj\xcuserdata\rafalsroka.xcuserdatad\xcschemes\SpriteAnimationDemo.xcscheme (3200, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo.xcodeproj\xcuserdata\rafalsroka.xcuserdatad\xcschemes\xcschememanagement.plist (491, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\.DS_Store (6148, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\AppDelegate.h (366, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\AppDelegate.m (2827, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\en.lproj (0, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\en.lproj\InfoPlist.strings (45, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\en.lproj\MasterViewController.xib (25084, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\explosion_4_39_128.png (437270, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\explosion_4_39_128_debug.png (449666, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\main.m (355, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\MasterViewController.h (598, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\MasterViewController.m (3350, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\SpriteAnimationDemo-Info.plist (1212, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\SpriteAnimationDemo-Prefix.pch (341, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\UIImage+Sprite (0, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\UIImage+Sprite\UIImage+Sprite.h (2708, 2011-11-19)
SpriteAnimationDemo\SpriteAnimationDemo\UIImage+Sprite\UIImage+Sprite.m (3562, 2011-11-19)
UIImage+Sprite.h (2708, 2011-11-19)
UIImage+Sprite.m (3562, 2011-11-19)

UIImage Sprite Additions ============= Useful UIImage category for handling sprite sheets. This add-on smoothes the way of extracting images from a sprite sheet (texture atlas). This can be useful in UIImageView animations where animationImages array has to be filled with a set of images representing frames. UIImage-Sprite category makes this process trivial by introducing two methods: -(NSArray *)spritesWithSpriteSheetImage:(UIImage *)image spriteSize:(CGSize)size; -(NSArray *)spritesWithSpriteSheetImage:(UIImage *)image inRange:(NSRange)range spriteSize:(CGSize)size; How to ======= There are two methods in UIImage+Sprite category. First one: -(NSArray *)spritesWithSpriteSheetImage:(UIImage *)image spriteSize:(CGSize)size; The method returns an array with UIImages. Original sprite sheet (image) is sliced into smaller chunks, each of the specified size. Second method is very similar: -(NSArray *)spritesWithSpriteSheetImage:(UIImage *)image inRange:(NSRange)range spriteSize:(CGSize)size; This method does exactly the same thing as the latter. However, this time we can specify the range of the chunks we want to get. Note that for performance reasons you should not fire these methods every time you want to get the array of animation frames. You should rather fire it once and store the output array somewhere. This is because the Core Graphics image manipulation operations (especially on large images) are not so fast and your application may slow down. I wrote this add-on to facilitate the setup of short animations using UIImageView. For more complex animations I recommend using OpenGLES. Demo ======= SpriteAnimationDemo project presents the usage of the UIImage+Sprite methods. The example shows how to create an animated UIImageView. This cool explosion sprite sheet which I included in the demo can be found at http://gushh.net/blog/free-game-sprites-explosion-3/. I added some numbers to this image to make testing and debugging easier. [![](http://dl.dropbox.com/u/7121070/github/UIImage-Sprite-Additions/t1.png)](http://dl.dropbox.com/u/7121070/github/UIImage-Sprite-Additions/1.png) License ======= This code is distributed under the terms and conditions of the MIT license. Copyright (c) 2011 Rafal Sroka Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

近期下载者

相关文件


收藏者