Sha256: 0cf17ab3c041a2879e7f3b07263acdb6f979c14515fbdf0a472ece835860161f

Contents?: true

Size: 1.81 KB

Versions: 4

Compression:

Stored size: 1.81 KB

Contents

//
//  CCNode+CCBRelativePositioning.h
//  CocosBuilderExample
//
//  Created by Viktor Lidholt on 7/6/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "cocos2d.h"

enum
{
    kCCBPositionTypeRelativeBottomLeft,
    kCCBPositionTypeRelativeTopLeft,
    kCCBPositionTypeRelativeTopRight,
    kCCBPositionTypeRelativeBottomRight,
    kCCBPositionTypePercent,
    kCCBPositionTypeMultiplyResolution,
};

enum
{
    kCCBSizeTypeAbsolute,
    kCCBSizeTypePercent,
    kCCBSizeTypeRelativeContainer,
    kCCBSizeTypeHorizontalPercent,
    kCCBSizeTypeVerticalPercent,
    kCCBSizeTypeMultiplyResolution,
};

enum
{
    kCCBScaleTypeAbsolute,
    kCCBScaleTypeMultiplyResolution
};

extern float ccbResolutionScale;

@interface CCNode (CCBRelativePositioning)

- (float) resolutionScale;

#pragma mark Positions

- (CGPoint) absolutePositionFromRelative:(CGPoint)pt type:(int)type parentSize:(CGSize)containerSize propertyName:(NSString*) propertyName;
- (void) setRelativePosition:(CGPoint)pt type:(int)type parentSize:(CGSize)containerSize propertyName:(NSString*) propertyName;
- (void) setRelativePosition:(CGPoint)position type:(int)type parentSize:(CGSize)parentSize;
- (void) setRelativePosition:(CGPoint)position type:(int)type;

#pragma mark Content Size

- (void) setRelativeSize:(CGSize)size type:(int)type parentSize:(CGSize)containerSize propertyName:(NSString*) propertyName;
- (void) setRelativeSize:(CGSize)size type:(int)type parentSize:(CGSize)parentSize;
- (void) setRelativeSize:(CGSize)size type:(int)type;

#pragma mark Scale

- (void) setRelativeScaleX:(float)x Y:(float)y type:(int)type propertyName:(NSString*)propertyName;
- (void) setRelativeScaleX:(float)x Y:(float)y type:(int)type;

#pragma mark Floats

- (void) setRelativeFloat:(float)f type:(int)type propertyName:(NSString*)propertyName;

@end

Version data entries

4 entries across 2 versions & 1 rubygems

Version Path
joybox-1.1.1 vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader_include/CCNode+CCBRelativePositioning.h
joybox-1.1.1 vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader_include/CCNode+CCBRelativePositioning.h
joybox-1.1.0 vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader_include/CCNode+CCBRelativePositioning.h
joybox-1.1.0 vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader_include/CCNode+CCBRelativePositioning.h