This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
/// SKUIViewWrapper.swift | |
/// | |
/// Created by Peter Easdown on 23/11/20. | |
/// | |
/// This is an attempt to port the class CCUIViewWrapper from Cocos2D to Swift and SpriteKit for use | |
/// in my apps as I move them from the excellent Cocos2D (OpenGL based) to SpriteKit (Metal based). | |
/// | |
/// Note that owing to the way the class manages the auto-adding and removal of the UIView, the wrapper | |
/// object should only be used once. If it is removed from the node tree, then you will need another instance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface Cocosutil : NSObject | |
typedef struct { | |
float overlapSize; | |
BOOL intersects; | |
} ccIntersection; | |
+ (ccIntersection) intersectionOfCircleWithRadius:(float)radius | |
atPoint:(CGPoint)circlePt | |
andRectangle:(CGRect)rect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface NSManagedObject (Serialization) | |
- (NSDictionary*) toDictionary; | |
- (void) populateFromDictionary:(NSDictionary*)dict; | |
+ (NSManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict | |
inContext:(NSManagedObjectContext*)context; | |
@end |