开发者

Saving Transforms into NSUserDefaults?

I am making a game, and want to save the states of the game scene. I know we can save CGPoints into NSUSerDefaults, but is there any way to save "Transform" into it?

If not, is there any function to "开发者_开发知识库read" a transform (for eg, the scale/angle of a view)?

Thanks in advance for your help.


Simple, wrap it in an NSValue:

CGAffineTransform t;

[userDefaults setObject:[NSValue valueWithCGAffineTransform:t] forKey:@"Transform"];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜