// // CCSize.h // CCFC // // Created by xichen on 11-12-28. // Copyright 2011 ccteam. All rights reserved. // #import <Foundation/Foundation.h> @interface CCSize : NSObject { @public CGFloat width; CGFloat height; } - (id)initWithWidth:(CGFloat)width withHeight:(CGFloat)height; + (id)sizeWithCCSize:(CCSize *)size; - (id)initWithCGSize:(CGSize)size; + (id)sizeWithCGSize:(CGSize)size; - (void)dealloc; - (BOOL)isEqualTo:(CCSize *)anotherSize; - (BOOL)isEqualToCGSize:(CGSize)size; - (BOOL)isZero; - (void)setWidth:(CGFloat)width withHeight:(CGFloat)height; - (CGSize)toCGSize; @end
可能有更新:
googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCSize.h
github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCSize.h
本文介绍了CCSize类的设计与实现,该类主要用于定义二维尺寸,包括宽度和高度,并提供了初始化、比较等方法。适用于游戏开发中对尺寸进行操作的场景。
106

被折叠的 条评论
为什么被折叠?



