Skip to content
Browse files

Removed support for CCLayerPanZoom

  • Loading branch information...
1 parent f6a660b commit e6970a07ecab990f54f808809f18add4d0f74385 Viktor Lidholt committed
View
180 CocosBuilder/CCLayerPanZoom/CCBPProperties.plist
@@ -1,180 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>inheritsFrom</key>
- <string>CCLayer</string>
- <key>positionProperty</key>
- <string>panBoundsOrigin</string>
- <key>canHaveChildren</key>
- <false/>
- <key>className</key>
- <string>CCLayerPanZoom</string>
- <key>properties</key>
- <array>
- <dict>
- <key>displayName</key>
- <string>CCLayerPanZoom</string>
- <key>type</key>
- <string>Separator</string>
- </dict>
- <dict>
- <key>affectsProperties</key>
- <array>
- <string>contentSize</string>
- </array>
- <key>displayName</key>
- <string>Content</string>
- <key>type</key>
- <string>CCBFile</string>
- <key>name</key>
- <string>content</string>
- </dict>
- <dict>
- <key>displayName</key>
- <string>Pan origin</string>
- <key>type</key>
- <string>Position</string>
- <key>name</key>
- <string>panBoundsOrigin</string>
- </dict>
- <dict>
- <key>displayName</key>
- <string>Pan bounds</string>
- <key>type</key>
- <string>Size</string>
- <key>name</key>
- <string>panBoundsSize</string>
- </dict>
- <dict>
- <key>affectsProperties</key>
- <array>
- <string>maxScale</string>
- <string>scale</string>
- </array>
- <key>displayName</key>
- <string>Min scale</string>
- <key>type</key>
- <string>Float</string>
- <key>name</key>
- <string>minScale</string>
- </dict>
- <dict>
- <key>affectsProperties</key>
- <array>
- <string>scale</string>
- <string>minScale</string>
- </array>
- <key>displayName</key>
- <string>Max scale</string>
- <key>type</key>
- <string>Float</string>
- <key>name</key>
- <string>maxScale</string>
- </dict>
- <dict>
- <key>affectsProperties</key>
- <array>
- <string>position</string>
- </array>
- <key>displayName</key>
- <string>Snap to top</string>
- <key>type</key>
- <string>Check</string>
- <key>name</key>
- <string>snapToTop</string>
- </dict>
- <dict>
- <key>extra</key>
- <string>Sheet mode|0|Frame mode|1</string>
- <key>displayName</key>
- <string>Mode</string>
- <key>type</key>
- <string>IntegerLabeled</string>
- <key>name</key>
- <string>mode</string>
- </dict>
- <dict>
- <key>displayName</key>
- <string>Recovery time</string>
- <key>type</key>
- <string>Float</string>
- <key>name</key>
- <string>rubberEffectRecoveryTime</string>
- </dict>
- <dict>
- <key>displayName</key>
- <string>Rubber ratio</string>
- <key>type</key>
- <string>Float</string>
- <key>name</key>
- <string>rubberEffectRatio</string>
- </dict>
- </array>
- <key>editorClassName</key>
- <string>CCLayerPanZoom</string>
- <key>propertiesOverridden</key>
- <array>
- <dict>
- <key>readOnly</key>
- <true/>
- <key>type</key>
- <string>Check</string>
- <key>name</key>
- <string>isRelativeAnchorPoint</string>
- <key>displayName</key>
- <string>Is relative anchor point</string>
- </dict>
- <dict>
- <key>readOnly</key>
- <true/>
- <key>type</key>
- <string>Point</string>
- <key>name</key>
- <string>anchorPoint</string>
- <key>displayName</key>
- <string>Anchor point</string>
- </dict>
- <dict>
- <key>readOnly</key>
- <true/>
- <key>type</key>
- <string>ScaleLock</string>
- <key>name</key>
- <string>scale</string>
- <key>displayName</key>
- <string>Scale</string>
- </dict>
- <dict>
- <key>readOnly</key>
- <true/>
- <key>type</key>
- <string>Degrees</string>
- <key>name</key>
- <string>rotation</string>
- <key>displayName</key>
- <string>Rotation</string>
- </dict>
- <dict>
- <key>readOnly</key>
- <true/>
- <key>displayName</key>
- <string>Position</string>
- <key>type</key>
- <string>Position</string>
- <key>name</key>
- <string>position</string>
- </dict>
- <dict>
- <key>readOnly</key>
- <true/>
- <key>type</key>
- <string>Size</string>
- <key>name</key>
- <string>contentSize</string>
- <key>displayName</key>
- <string>Content size</string>
- </dict>
- </array>
-</dict>
-</plist>
View
30 CocosBuilder/CCLayerPanZoom/CCLayerPanZoom-Info.plist
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string>com.cocosbuilder.plug.node.${PRODUCT_NAME:rfc1034identifier}</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>BNDL</string>
- <key>CFBundleShortVersionString</key>
- <string>1.0</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1</string>
- <key>NSHumanReadableCopyright</key>
- <string>Copyright © 2012 __MyCompanyName__. All rights reserved.</string>
- <key>NSPrincipalClass</key>
- <string></string>
-</dict>
-</plist>
View
7 CocosBuilder/CCLayerPanZoom/CCLayerPanZoom-Prefix.pch
@@ -1,7 +0,0 @@
-//
-// Prefix header for all source files of the 'CCLayerPanZoom' target in the 'CCLayerPanZoom' project
-//
-
-#ifdef __OBJC__
- #import <Cocoa/Cocoa.h>
-#endif
View
2 CocosBuilder/CCLayerPanZoom/en.lproj/InfoPlist.strings
@@ -1,2 +0,0 @@
-/* Localized versions of Info.plist keys */
-
View
5 CocosBuilder/CCScrollView/CCBPProperties.plist
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict/>
+</plist>
View
186 CocosBuilder/libs/CCLayerPanZoom/CCLayerPanZoom.h
@@ -1,186 +0,0 @@
-/*
- * CCLayerPanZoom Tests
- *
- * cocos2d-extensions
- * https://github.com/cocos2d/cocos2d-iphone-extensions
- *
- * Copyright (c) 2011 Alexey Lang
- *
- * 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.
- *
- */
-
-
-#import "cocos2d.h"
-
-#define kCCLayerPanZoomMultitouchGesturesDetectionDelay 0.05
-
-
-typedef enum
-{
- /** Standard mode: swipe to scroll */
- kCCLayerPanZoomModeSheet,
- /** Frame mode (i.e. drag inside objects): hold finger at edge of the screen to the sroll in this direction */
- kCCLayerPanZoomModeFrame
-} CCLayerPanZoomMode;
-
-
-@class CCLayerPanZoom;
-@protocol CCLayerPanZoomClickDelegate <NSObject>
-
-/** Sent to delegate each time, when click event was obtained.
- * Only for mode = kCCLayerPanZoomModeSheet. */
-- (void) layerPanZoom: (CCLayerPanZoom *) sender
- clickedAtPoint: (CGPoint) aPoint
- tapCount: (NSUInteger) tapCount;
-
-/** Sent to delegate each time, when touch position was updated. */
-- (void) layerPanZoom: (CCLayerPanZoom *) sender
- touchPositionUpdated: (CGPoint) newPos;
-
-/** Sent to delegate each time, when users drags finger on the screen.
- * This means that click event is not possible with that touch from now. */
-- (void) layerPanZoom: (CCLayerPanZoom *) sender touchMoveBeganAtPosition: (CGPoint) aPoint;
-
-@end
-
-
-/** @class CCLayerPanZoom Class that represents the layer that can be scrolled
- * and zoomed with one or two fingers. */
-@interface CCLayerPanZoom : CCLayer
-{
- CGFloat _maxScale;
- CGFloat _minScale;
- NSMutableArray *_touches;
- CGRect _panBoundsRect;
- CGFloat _touchDistance;
- CGFloat _maxTouchDistanceToClick;
- id<CCLayerPanZoomClickDelegate> _delegate;
-
- CCLayerPanZoomMode _mode;
- CGFloat _minSpeed;
- CGFloat _maxSpeed;
- CGFloat _topFrameMargin;
- CGFloat _bottomFrameMargin;
- CGFloat _leftFrameMargin;
- CGFloat _rightFrameMargin;
-
- CGPoint _prevSingleTouchPositionInLayer;
- //< previous position in layer if single touch was moved.
-
- // Time when single touch has began, used to wait for possible multitouch
- // gestures before reacting to single touch.
- NSTimeInterval _singleTouchTimestamp;
-
- // Flag used to call touchMoveBeganAtPosition: only once for each single touch event.
- BOOL _touchMoveBegan;
-
- ccTime _rubberEffectRecoveryTime;
- CGFloat _rubberEffectRatio;
- BOOL _rubberEffectRecovering;
- BOOL _rubberEffectZooming;
-
- BOOL _snapToTop;
-
- CCNode* _content;
-}
-
-#pragma mark Zoom Options
-
-/** The maximum scale level, will change scale if needed automatically.
- * Default is 3.0f */
-@property (readwrite, assign) CGFloat maxScale;
-
-/** The minimum scale level, will change scale if needed automatically.
- * Default is 0.5f */
-@property (readwrite, assign) CGFloat minScale;
-
-#pragma mark Common Options
-
-/** Rectangle that is used to determine bounds of scrolling area in parent coordinates.
- * Set it to CGRectNull to enable infinite scrolling.
- * Default is CGRectNull */
-@property (nonatomic, assign) CGRect panBoundsRect;
-
-@property (nonatomic, assign) CGSize panBoundsSize;
-@property (nonatomic, assign) CGPoint panBoundsOrigin;
-@property (nonatomic, assign) BOOL snapToTop;
-
-/** The max distance in points that touch can be dragged before click.
- * If traveled distance is greater then click message will not be sent to the delegate.
- * Default is 15.0f */
-@property (nonatomic, assign) CGFloat maxTouchDistanceToClick;
-
-/** Delegate for callbacks. */
-@property (nonatomic, assign) id<CCLayerPanZoomClickDelegate> delegate;
-
-/** Describes layer's mode. Defult is kCCLayerPanZoomModeSheet */
-@property (nonatomic, assign) CCLayerPanZoomMode mode;
-
-#pragma mark Frame Mode Options
-
-/** Maximum speed for autosrolling in frame mode
- * Default is 1000.0f */
-@property (nonatomic, assign) CGFloat maxSpeed;
-
-/** Minimum speed for autosrolling in frame mode
- * Default is 100.0f */
-@property (nonatomic, assign) CGFloat minSpeed;
-
-/** Distance from top edge of panBoundsRect that defines top autoscrolling zone
- * in frame mode.
- * Default is 100.0f */
-@property (nonatomic, assign) CGFloat topFrameMargin;
-
-/** Distance from bottom edge of panBoundsRect that defines bottom
- * autoscrolling zone in frame mode.
- * Default is 100.0f */
-@property (nonatomic, assign) CGFloat bottomFrameMargin;
-
-/** Distance from left edge of panBoundsRect that defines left autoscrolling zone
- * in frame mode.
- * Default is 100.0f */
-@property (nonatomic, assign) CGFloat leftFrameMargin;
-
-/** Distance from right edge of panBoundsRect that defines right autoscrolling
- * zone in frame mode.
- * Default is 100.0f */
-@property (nonatomic, assign) CGFloat rightFrameMargin;
-
-#pragma mark Rubber Effect Options
-
-/** Time (in seconds) to recover layer position and scale after moving out from
- * panBoundsRect due to rubber effect.
- * Default is 0.2f.
- */
-@property (nonatomic, assign) ccTime rubberEffectRecoveryTime;
-
-/** Ratio for rubber effect. Describes the proportion of the panBoundsRect size,
- * that layer can be moved outside from panBoundsRect border.
- * So 0.0f means that layer can't be moved outside from bounds (rubber effect is Off)
- * and 1.0f means that layer can be moved panBoundsRect.size.width far from
- * left/right borders & panBoundsRect.size.height from top/bottom borders.
- * Default is 0.5f.
- * Limitations: only sheet mode is supported.
- */
-@property (nonatomic, assign) CGFloat rubberEffectRatio;
-
-@property (nonatomic,retain) CCNode* content;
-
-@end
View
859 CocosBuilder/libs/CCLayerPanZoom/CCLayerPanZoom.m
@@ -1,859 +0,0 @@
-/*
- * CCLayerPanZoom Tests
- *
- * cocos2d-extensions
- * https://github.com/cocos2d/cocos2d-iphone-extensions
- *
- * Copyright (c) 2011 Alexey Lang
- *
- * 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.
- *
- */
-
-
-#import "CCLayerPanZoom.h"
-
-
-#ifdef DEBUG
-
-/** @class CCLayerPanZoomDebugLines Class that represents lines over the CCLayerPanZoom
- * for debug frame mode */
-@interface CCLayerPanZoomDebugLines: CCNode
-{
- CGFloat _topFrameMargin;
- CGFloat _bottomFrameMargin;
- CGFloat _leftFrameMargin;
- CGFloat _rightFrameMargin;
-}
-/** Distance from top edge of contenSize */
-@property (readwrite, assign) CGFloat topFrameMargin;
-/** Distance from bottom edge of contenSize */
-@property (readwrite, assign) CGFloat bottomFrameMargin;
-/** Distance from left edge of contenSize */
-@property (readwrite, assign) CGFloat leftFrameMargin;
-/** Distance from right edge of contenSize */
-@property (readwrite, assign) CGFloat rightFrameMargin;
-
-@end
-
-enum nodeTags
-{
- kDebugLinesTag,
-};
-
-@implementation CCLayerPanZoomDebugLines
-
-@synthesize topFrameMargin = _topFrameMargin, bottomFrameMargin = _bottomFrameMargin,
- leftFrameMargin = _leftFrameMargin, rightFrameMargin = _rightFrameMargin;
-
-- (void) draw
-{
- ccDrawColor4F(1.0f, 0.0f, 0.0f, 1.0);
- glLineWidth(2.0f);
- ccDrawLine(ccp(self.leftFrameMargin, 0.0f),
- ccp(self.leftFrameMargin, self.contentSize.height));
- ccDrawLine(ccp(self.contentSize.width - self.rightFrameMargin, 0.0f),
- ccp(self.contentSize.width - self.rightFrameMargin, self.contentSize.height));
- ccDrawLine(ccp(0.0f, self.bottomFrameMargin),
- ccp(self.contentSize.width, self.bottomFrameMargin));
- ccDrawLine(ccp(0.0f, self.contentSize.height - self.topFrameMargin),
- ccp(self.contentSize.width, self.contentSize.height - self.topFrameMargin));
-}
-
-@end
-
-#endif
-
-
-typedef enum
-{
- kCCLayerPanZoomFrameEdgeNone,
- kCCLayerPanZoomFrameEdgeTop,
- kCCLayerPanZoomFrameEdgeBottom,
- kCCLayerPanZoomFrameEdgeLeft,
- kCCLayerPanZoomFrameEdgeRight,
- kCCLayerPanZoomFrameEdgeTopLeft,
- kCCLayerPanZoomFrameEdgeBottomLeft,
- kCCLayerPanZoomFrameEdgeTopRight,
- kCCLayerPanZoomFrameEdgeBottomRight
-} CCLayerPanZoomFrameEdge;
-
-
-@interface CCLayerPanZoom ()
-
-@property (readwrite, retain) NSMutableArray *touches;
-@property (readwrite, assign) CGFloat touchDistance;
-@property (readwrite, retain) CCScheduler *scheduler;
-// Return minimum possible scale for the layer considering panBoundsRect and enablePanBounds
-- (CGFloat) minPossibleScale;
-// Return edge in which current point located
-- (CCLayerPanZoomFrameEdge) frameEdgeWithPoint: (CGPoint) point;
-// Return horizontal speed in order with current position
-- (CGFloat) horSpeedWithPosition: (CGPoint) pos;
-// Return vertical speed in order with current position
-- (CGFloat) vertSpeedWithPosition: (CGPoint) pos;
-// Return distance to top edge of screen
-- (CGFloat) topEdgeDistance;
-// Return distance to left edge of screen
-- (CGFloat) leftEdgeDistance;
-// Return distance to bottom edge of screen
-- (CGFloat) bottomEdgeDistance;
-// Return distance to right edge of screen
-- (CGFloat) rightEdgeDistance;
-// Recover position if it's need for emulate rubber edges
-- (void) recoverPositionAndScale;
-
-@end
-
-
-@implementation CCLayerPanZoom
-
-@synthesize maxTouchDistanceToClick = _maxTouchDistanceToClick,
- delegate = _delegate, touches = _touches, touchDistance = _touchDistance,
- minSpeed = _minSpeed, maxSpeed = _maxSpeed, topFrameMargin = _topFrameMargin,
- bottomFrameMargin = _bottomFrameMargin, leftFrameMargin = _leftFrameMargin,
- rightFrameMargin = _rightFrameMargin, scheduler = _scheduler, rubberEffectRecoveryTime = _rubberEffectRecoveryTime,
- content = content_, snapToTop = _snapToTop;
-
-@dynamic maxScale;
-- (void) setMaxScale:(CGFloat)maxScale
-{
- _maxScale = maxScale;
- self.scale = MIN(self.scale, _maxScale);
-}
-
-- (CGFloat) maxScale
-{
- return _maxScale;
-}
-
-@dynamic minScale;
-- (void) setMinScale:(CGFloat)minScale
-{
- _minScale = minScale;
- self.scale = MAX(self.scale, minScale);
-}
-
-- (CGFloat) minScale
-{
- return _minScale;
-}
-
-@dynamic rubberEffectRatio;
-- (void) setRubberEffectRatio:(CGFloat)rubberEffectRatio
-{
- _rubberEffectRatio = rubberEffectRatio;
-
- // Avoid turning rubber effect On in frame mode.
- if (self.mode == kCCLayerPanZoomModeFrame)
- {
- CCLOGERROR(@"CCLayerPanZoom#setRubberEffectRatio: rubber effect is not supported in frame mode.");
- _rubberEffectRatio = 0.0f;
- }
-
-}
-
-- (CGFloat) rubberEffectRatio
-{
- return _rubberEffectRatio;
-}
-
-
-#pragma mark Init
-
-- (id) init
-{
- if ((self = [super init]))
- {
- self.isRelativeAnchorPoint = YES;
- self.isTouchEnabled = YES;
-
- self.maxScale = 3.0f;
- self.minScale = 0.5f;
- self.touches = [NSMutableArray arrayWithCapacity: 10];
- self.panBoundsRect = CGRectNull;
- self.touchDistance = 0.0F;
- self.maxTouchDistanceToClick = 15.0f;
-
- self.mode = kCCLayerPanZoomModeSheet;
- self.minSpeed = 100.0f;
- self.maxSpeed = 1000.0f;
- self.topFrameMargin = 100.0f;
- self.bottomFrameMargin = 100.0f;
- self.leftFrameMargin = 100.0f;
- self.rightFrameMargin = 100.0f;
-
- self.rubberEffectRatio = 0.5f;
- self.rubberEffectRecoveryTime = 0.2f;
- _rubberEffectRecovering = NO;
- _rubberEffectZooming = NO;
- }
- return self;
-}
-
-#pragma mark CCStandardTouchDelegate Touch events
-
-#ifdef __CC_PLATFORM_IOS
-
-- (void) ccTouchesBegan: (NSSet *) touches
- withEvent: (UIEvent *) event
-{
- for (UITouch *touch in [touches allObjects])
- {
- CGPoint curPosTouch = [[CCDirector sharedDirector] convertToGL: [touch locationInView: [touch view]]];
- NSLog(@"curPosTouch (%f,%f)",curPosTouch.x, curPosTouch.y);
-
- CGPoint curLocalPosTouch = [self.parent convertToNodeSpace:curPosTouch];
- NSLog(@"curLocalPosTouch (%f,%f)",curLocalPosTouch.x, curLocalPosTouch.y);
-
- // Add new touche to the array with current touches
- if (CGRectContainsPoint(_panBoundsRect, curLocalPosTouch))
- {
- [self.touches addObject: touch];
- }
- }
-
- if ([self.touches count] == 1)
- {
- _touchMoveBegan = NO;
- _singleTouchTimestamp = [NSDate timeIntervalSinceReferenceDate];
- }
- else
- _singleTouchTimestamp = INFINITY;
-}
-
-- (void) ccTouchesMoved: (NSSet *) touches
- withEvent: (UIEvent *) event
-{
- BOOL multitouch = [self.touches count] > 1;
- if (multitouch)
- {
- // Get the two first touches
- UITouch *touch1 = [self.touches objectAtIndex: 0];
- UITouch *touch2 = [self.touches objectAtIndex: 1];
- // Get current and previous positions of the touches
- CGPoint curPosTouch1 = [[CCDirector sharedDirector] convertToGL: [touch1 locationInView: [touch1 view]]];
- CGPoint curPosTouch2 = [[CCDirector sharedDirector] convertToGL: [touch2 locationInView: [touch2 view]]];
- CGPoint prevPosTouch1 = [[CCDirector sharedDirector] convertToGL: [touch1 previousLocationInView: [touch1 view]]];
- CGPoint prevPosTouch2 = [[CCDirector sharedDirector] convertToGL: [touch2 previousLocationInView: [touch2 view]]];
- // Calculate current and previous positions of the layer relative the anchor point
- CGPoint curPosLayer = ccpMidpoint(curPosTouch1, curPosTouch2);
- CGPoint prevPosLayer = ccpMidpoint(prevPosTouch1, prevPosTouch2);
-
- // Calculate new scale
- CGFloat prevScale = self.scale;
- self.scale = self.scale * ccpDistance(curPosTouch1, curPosTouch2) / ccpDistance(prevPosTouch1, prevPosTouch2);
- // Avoid scaling out from panBoundsRect when Rubber Effect is OFF.
- if (!self.rubberEffectRatio)
- {
- self.scale = MAX(self.scale, [self minPossibleScale]);
- }
- // If scale was changed -> set new scale and fix position with new scale
- if (self.scale != prevScale)
- {
- if (_rubberEffectRatio)
- {
- _rubberEffectZooming = YES;
- }
- CGPoint realCurPosLayer = [self convertToNodeSpace: curPosLayer];
- CGFloat deltaX = (realCurPosLayer.x - self.anchorPoint.x * self.contentSize.width) * (self.scale - prevScale);
- CGFloat deltaY = (realCurPosLayer.y - self.anchorPoint.y * self.contentSize.height) * (self.scale - prevScale);
- self.position = ccp(self.position.x - deltaX, self.position.y - deltaY);
- _rubberEffectZooming = NO;
- }
- // If current and previous position of the multitouch's center aren't equal -> change position of the layer
- if (!CGPointEqualToPoint(prevPosLayer, curPosLayer))
- {
- self.position = ccp(self.position.x + curPosLayer.x - prevPosLayer.x,
- self.position.y + curPosLayer.y - prevPosLayer.y);
- }
- // Don't click with multitouch
- self.touchDistance = INFINITY;
- }
- else if ([self.touches count] == 1)
- {
- // Get the single touch and it's previous & current position.
- UITouch *touch = [self.touches objectAtIndex: 0];
- CGPoint curTouchPosition = [[CCDirector sharedDirector] convertToGL: [touch locationInView: [touch view]]];
- CGPoint prevTouchPosition = [[CCDirector sharedDirector] convertToGL: [touch previousLocationInView: [touch view]]];
-
- // Always scroll in sheet mode.
- if (self.mode == kCCLayerPanZoomModeSheet)
- {
- // Set new position of the layer.
- self.position = ccp(self.position.x + curTouchPosition.x - prevTouchPosition.x,
- self.position.y + curTouchPosition.y - prevTouchPosition.y);
- }
-
- // Accumulate touch distance for all modes.
- self.touchDistance += ccpDistance(curTouchPosition, prevTouchPosition);
-
- // Inform delegate about starting updating touch position, if click isn't possible.
- if (self.mode == kCCLayerPanZoomModeFrame)
- {
- if (self.touchDistance > self.maxTouchDistanceToClick && !_touchMoveBegan)
- {
- [self.delegate layerPanZoom: self
- touchMoveBeganAtPosition: [self convertToNodeSpace: prevTouchPosition]];
- _touchMoveBegan = YES;
- }
- }
- }
-}
-
-- (void) ccTouchesEnded: (NSSet *) touches
- withEvent: (UIEvent *) event
-{
- _singleTouchTimestamp = INFINITY;
-
- // Process click event in single touch.
- if ( (self.touchDistance < self.maxTouchDistanceToClick) && (self.delegate)
- && ([self.touches count] == 1))
- {
- UITouch *touch = [self.touches objectAtIndex: 0];
- CGPoint curPos = [[CCDirector sharedDirector] convertToGL: [touch locationInView: [touch view]]];
- [self.delegate layerPanZoom: self
- clickedAtPoint: [self convertToNodeSpace: curPos]
- tapCount: [touch tapCount]];
- }
-
- for (UITouch *touch in [touches allObjects])
- {
- // Remove touche from the array with current touches
- [self.touches removeObject: touch];
- }
- if ([self.touches count] == 0)
- {
- self.touchDistance = 0.0f;
- }
-
- if (![self.touches count] && !_rubberEffectRecovering)
- {
- [self recoverPositionAndScale];
- }
-}
-
-- (void) ccTouchesCancelled: (NSSet *) touches
- withEvent: (UIEvent *) event
-{
- for (UITouch *touch in [touches allObjects])
- {
- // Remove touche from the array with current touches
- [self.touches removeObject: touch];
- }
- if ([self.touches count] == 0)
- {
- self.touchDistance = 0.0f;
- }
-}
-
-#pragma mark Update
-
-// Updates position in frame mode.
-- (void) update: (ccTime) dt
-{
- // Only for frame mode with one touch.
- if ( self.mode == kCCLayerPanZoomModeFrame && [self.touches count] == 1 )
- {
- // Do not update position if click is still possible.
- if (self.touchDistance <= self.maxTouchDistanceToClick)
- return;
-
- // Do not update position if pinch is still possible.
- if ([NSDate timeIntervalSinceReferenceDate] - _singleTouchTimestamp < kCCLayerPanZoomMultitouchGesturesDetectionDelay)
- return;
-
- // Otherwise - update touch position. Get current position of touch.
- UITouch *touch = [self.touches objectAtIndex: 0];
- CGPoint curPos = [[CCDirector sharedDirector] convertToGL: [touch locationInView: [touch view]]];
-
- // Scroll if finger in the scroll area near edge.
- if ([self frameEdgeWithPoint: curPos] != kCCLayerPanZoomFrameEdgeNone)
- {
- self.position = ccp(self.position.x + dt * [self horSpeedWithPosition: curPos],
- self.position.y + dt * [self vertSpeedWithPosition: curPos]);
- }
-
- // Inform delegate if touch position in layer was changed due to finger or layer movement.
- CGPoint touchPositionInLayer = [self convertToNodeSpace: curPos];
- if (!CGPointEqualToPoint(_prevSingleTouchPositionInLayer, touchPositionInLayer))
- {
- _prevSingleTouchPositionInLayer = touchPositionInLayer;
- [self.delegate layerPanZoom: self
- touchPositionUpdated: touchPositionInLayer];
- }
-
- }
-}
-
-- (void) onEnter
-{
- [super onEnter];
- CCScheduler *scheduler = [[CCDirector sharedDirector] scheduler];
- [scheduler scheduleUpdateForTarget: self
- priority: 0
- paused: NO];
-}
-
-- (void) onExit
-{
- CCScheduler *scheduler = [[CCDirector sharedDirector] scheduler];
- [scheduler unscheduleAllSelectorsForTarget: self];
- [super onExit];
-}
-
-#endif
-
-#pragma mark Layer Modes related
-
-@dynamic mode;
-
-- (void) setMode: (CCLayerPanZoomMode) mode
-{
-#ifdef DEBUG
- if (mode == kCCLayerPanZoomModeFrame)
- {
- CCLayerPanZoomDebugLines *lines = [CCLayerPanZoomDebugLines node];
- [lines setContentSize: [CCDirector sharedDirector].winSize];
- lines.topFrameMargin = self.topFrameMargin;
- lines.bottomFrameMargin = self.bottomFrameMargin;
- lines.leftFrameMargin = self.leftFrameMargin;
- lines.rightFrameMargin = self.rightFrameMargin;
- [[CCDirector sharedDirector].runningScene addChild: lines
- z: NSIntegerMax
- tag: kDebugLinesTag];
- }
- if (_mode == kCCLayerPanZoomModeFrame)
- {
- [[CCDirector sharedDirector].runningScene removeChildByTag: kDebugLinesTag
- cleanup: YES];
- }
-#endif
- _mode = mode;
-
- // Disable rubber effect in Frame mode.
- if (_mode == kCCLayerPanZoomModeFrame)
- {
- self.rubberEffectRatio = 0.0f;
- }
-}
-
-- (CCLayerPanZoomMode) mode
-{
- return _mode;
-}
-
-#pragma mark Scale and Position related
-
-@dynamic panBoundsRect;
-
-- (void) setPanBoundsRect: (CGRect) rect
-{
- _panBoundsRect = rect;
- self.scale = [self minPossibleScale];
-
- if (_snapToTop)
- {
- CGRect boundBox = [self boundingBox];
- [super setPosition: ccp(rect.origin.x, self.panBoundsRect.size.height + self.panBoundsRect.origin.y -
- boundBox.size.height * (1 - self.anchorPoint.y))];
- }
- else
- {
- self.position = rect.origin;
- }
-}
-
-- (CGRect) panBoundsRect
-{
- return _panBoundsRect;
-}
-
-- (void) setPosition: (CGPoint) position
-{
- CGPoint prevPosition = self.position;
- [super setPosition: position];
- if (!CGRectIsNull(_panBoundsRect) && !_rubberEffectZooming)
- {
- if (self.rubberEffectRatio && self.mode == kCCLayerPanZoomModeSheet)
- {
- if (!_rubberEffectRecovering)
- {
- CGFloat topDistance = [self topEdgeDistance];
- CGFloat bottomDistance = [self bottomEdgeDistance];
- CGFloat leftDistance = [self leftEdgeDistance];
- CGFloat rightDistance = [self rightEdgeDistance];
- CGFloat dx = self.position.x - prevPosition.x;
- CGFloat dy = self.position.y - prevPosition.y;
- if (bottomDistance || topDistance)
- {
- [super setPosition: ccp(self.position.x,
- prevPosition.y + dy * self.rubberEffectRatio)];
- }
- if (leftDistance || rightDistance)
- {
- [super setPosition: ccp(prevPosition.x + dx * self.rubberEffectRatio,
- self.position.y)];
- }
- }
- }
- else
- {
- CGRect boundBox = [self boundingBox];
- if (self.position.x - boundBox.size.width * self.anchorPoint.x > self.panBoundsRect.origin.x)
- {
- [super setPosition: ccp(boundBox.size.width * self.anchorPoint.x + self.panBoundsRect.origin.x,
- self.position.y)];
- }
- if (self.position.y - boundBox.size.height * self.anchorPoint.y > self.panBoundsRect.origin.y)
- {
- [super setPosition: ccp(self.position.x, boundBox.size.height * self.anchorPoint.y +
- self.panBoundsRect.origin.y)];
- }
- if (self.position.x + boundBox.size.width * (1 - self.anchorPoint.x) < self.panBoundsRect.size.width +
- self.panBoundsRect.origin.x)
- {
- [super setPosition: ccp(self.panBoundsRect.size.width + _panBoundsRect.origin.x -
- boundBox.size.width * (1 - self.anchorPoint.x), self.position.y)];
- }
- if (self.position.y + boundBox.size.height * (1 - self.anchorPoint.y) < self.panBoundsRect.size.height +
- self.panBoundsRect.origin.y)
- {
- [super setPosition: ccp(self.position.x, self.panBoundsRect.size.height + self.panBoundsRect.origin.y -
- boundBox.size.height * (1 - self.anchorPoint.y))];
- }
- }
- }
-}
-
-- (void) setSnapToTop:(BOOL)snapToTop
-{
- _snapToTop = snapToTop;
- self.panBoundsRect = self.panBoundsRect;
-}
-
-- (void) setScale: (float)scale
-{
- [super setScale: MIN(MAX(scale, self.minScale), self.maxScale)];
-}
-
-#pragma mark Ruber Edges related
-
-- (void) recoverPositionAndScale
-{
- if (!CGRectIsNull(self.panBoundsRect))
- {
- CGSize winSize = [CCDirector sharedDirector].winSize;
- CGFloat rightEdgeDistance = [self rightEdgeDistance];
- CGFloat leftEdgeDistance = [self leftEdgeDistance];
- CGFloat topEdgeDistance = [self topEdgeDistance];
- CGFloat bottomEdgeDistance = [self bottomEdgeDistance];
- CGFloat scale = [self minPossibleScale];
-
- if (!rightEdgeDistance && !leftEdgeDistance && !topEdgeDistance && !bottomEdgeDistance)
- {
- return;
- }
-
- if (self.scale < scale)
- {
- _rubberEffectRecovering = YES;
- CGPoint newPosition = CGPointZero;
- if (rightEdgeDistance && leftEdgeDistance && topEdgeDistance && bottomEdgeDistance)
- {
- CGFloat dx = scale * self.contentSize.width * (self.anchorPoint.x - 0.5f);
- CGFloat dy = scale * self.contentSize.height * (self.anchorPoint.y - 0.5f);
- newPosition = ccp(winSize.width * 0.5f + dx, winSize.height * 0.5f + dy);
- }
- else if (rightEdgeDistance && leftEdgeDistance && topEdgeDistance)
- {
- CGFloat dx = scale * self.contentSize.width * (self.anchorPoint.x - 0.5f);
- CGFloat dy = scale * self.contentSize.height * (1.0f - self.anchorPoint.y);
- newPosition = ccp(winSize.width * 0.5f + dx, winSize.height - dy);
- }
- else if (rightEdgeDistance && leftEdgeDistance && bottomEdgeDistance)
- {
- CGFloat dx = scale * self.contentSize.width * (self.anchorPoint.x - 0.5f);
- CGFloat dy = scale * self.contentSize.height * self.anchorPoint.y;
- newPosition = ccp(winSize.width * 0.5f + dx, dy);
- }
- else if (rightEdgeDistance && topEdgeDistance && bottomEdgeDistance)
- {
- CGFloat dx = scale * self.contentSize.width * (1.0f - self.anchorPoint.x);
- CGFloat dy = scale * self.contentSize.height * (self.anchorPoint.y - 0.5f);
- newPosition = ccp(winSize.width - dx, winSize.height * 0.5f + dy);
- }
- else if (leftEdgeDistance && topEdgeDistance && bottomEdgeDistance)
- {
- CGFloat dx = scale * self.contentSize.width * self.anchorPoint.x;
- CGFloat dy = scale * self.contentSize.height * (self.anchorPoint.y - 0.5f);
- newPosition = ccp(dx, winSize.height * 0.5f + dy);
- }
- else if (leftEdgeDistance && topEdgeDistance)
- {
- CGFloat dx = scale * self.contentSize.width * self.anchorPoint.x;
- CGFloat dy = scale * self.contentSize.height * (1.0f - self.anchorPoint.y);
- newPosition = ccp(dx, winSize.height - dy);
- }
- else if (leftEdgeDistance && bottomEdgeDistance)
- {
- CGFloat dx = scale * self.contentSize.width * self.anchorPoint.x;
- CGFloat dy = scale * self.contentSize.height * self.anchorPoint.y;
- newPosition = ccp(dx, dy);
- }
- else if (rightEdgeDistance && topEdgeDistance)
- {
- CGFloat dx = scale * self.contentSize.width * (1.0f - self.anchorPoint.x);
- CGFloat dy = scale * self.contentSize.height * (1.0f - self.anchorPoint.y);
- newPosition = ccp(winSize.width - dx, winSize.height - dy);
- }
- else if (rightEdgeDistance && bottomEdgeDistance)
- {
- CGFloat dx = scale * self.contentSize.width * (1.0f - self.anchorPoint.x);
- CGFloat dy = scale * self.contentSize.height * self.anchorPoint.y;
- newPosition = ccp(winSize.width - dx, dy);
- }
- else if (topEdgeDistance || bottomEdgeDistance)
- {
- CGFloat dy = scale * self.contentSize.height * (self.anchorPoint.y - 0.5f);
- newPosition = ccp(self.position.x, winSize.height * 0.5f + dy);
- }
- else if (leftEdgeDistance || rightEdgeDistance)
- {
- CGFloat dx = scale * self.contentSize.width * (self.anchorPoint.x - 0.5f);
- newPosition = ccp(winSize.width * 0.5f + dx, self.position.y);
- }
-
- id moveToPosition = [CCMoveTo actionWithDuration: self.rubberEffectRecoveryTime
- position: newPosition];
- id scaleToPosition = [CCScaleTo actionWithDuration: self.rubberEffectRecoveryTime
- scale: scale];
- id sequence = [CCSpawn actions: scaleToPosition, moveToPosition, [CCCallFunc actionWithTarget: self selector: @selector(recoverEnded)], nil];
- [self runAction: sequence];
-
- }
- else
- {
- _rubberEffectRecovering = YES;
- id moveToPosition = [CCMoveTo actionWithDuration: self.rubberEffectRecoveryTime
- position: ccp(self.position.x + rightEdgeDistance - leftEdgeDistance,
- self.position.y + topEdgeDistance - bottomEdgeDistance)];
- id sequence = [CCSpawn actions: moveToPosition, [CCCallFunc actionWithTarget: self selector: @selector(recoverEnded)], nil];
- [self runAction: sequence];
-
- }
- }
-}
-
-- (void) recoverEnded
-{
- _rubberEffectRecovering = NO;
-}
-
-#pragma mark Helpers
-
-- (CGFloat) topEdgeDistance
-{
- CGRect boundBox = [self boundingBox];
- return round(MAX(self.panBoundsRect.size.height + self.panBoundsRect.origin.y - self.position.y -
- boundBox.size.height * (1 - self.anchorPoint.y), 0));
-}
-
-- (CGFloat) leftEdgeDistance
-{
- CGRect boundBox = [self boundingBox];
- return round(MAX(self.position.x - boundBox.size.width * self.anchorPoint.x - self.panBoundsRect.origin.x, 0));
-}
-
-- (CGFloat) bottomEdgeDistance
-{
- CGRect boundBox = [self boundingBox];
- return round(MAX(self.position.y - boundBox.size.height * self.anchorPoint.y - self.panBoundsRect.origin.y, 0));
-}
-
-- (CGFloat) rightEdgeDistance
-{
- CGRect boundBox = [self boundingBox];
- return round(MAX(self.panBoundsRect.size.width + self.panBoundsRect.origin.x - self.position.x -
- boundBox.size.width * (1 - self.anchorPoint.x), 0));
-}
-
-- (CGFloat) minPossibleScale
-{
- if (!CGRectIsNull(self.panBoundsRect))
- {
- return MAX(self.panBoundsRect.size.width / self.contentSize.width,
- self.panBoundsRect.size.height / self.contentSize.height);
- }
- else
- {
- return self.minScale;
- }
-}
-
-- (CCLayerPanZoomFrameEdge) frameEdgeWithPoint: (CGPoint) point
-{
- BOOL isLeft = point.x <= self.panBoundsRect.origin.x + self.leftFrameMargin;
- BOOL isRight = point.x >= self.panBoundsRect.origin.x + self.panBoundsRect.size.width - self.rightFrameMargin;
- BOOL isBottom = point.y <= self.panBoundsRect.origin.y + self.bottomFrameMargin;
- BOOL isTop = point.y >= self.panBoundsRect.origin.y + self.panBoundsRect.size.height - self.topFrameMargin;
-
- if (isLeft && isBottom)
- {
- return kCCLayerPanZoomFrameEdgeBottomLeft;
- }
- if (isLeft && isTop)
- {
- return kCCLayerPanZoomFrameEdgeTopLeft;
- }
- if (isRight && isBottom)
- {
- return kCCLayerPanZoomFrameEdgeBottomRight;
- }
- if (isRight && isTop)
- {
- return kCCLayerPanZoomFrameEdgeTopRight;
- }
-
- if (isLeft)
- {
- return kCCLayerPanZoomFrameEdgeLeft;
- }
- if (isTop)
- {
- return kCCLayerPanZoomFrameEdgeTop;
- }
- if (isRight)
- {
- return kCCLayerPanZoomFrameEdgeRight;
- }
- if (isBottom)
- {
- return kCCLayerPanZoomFrameEdgeBottom;
- }
-
- return kCCLayerPanZoomFrameEdgeNone;
-}
-
-- (CGFloat) horSpeedWithPosition: (CGPoint) pos
-{
- CCLayerPanZoomFrameEdge edge = [self frameEdgeWithPoint: pos];
- CGFloat speed = 0.0f;
- if (edge == kCCLayerPanZoomFrameEdgeLeft)
- {
- speed = self.minSpeed + (self.maxSpeed - self.minSpeed) *
- (self.panBoundsRect.origin.x + self.leftFrameMargin - pos.x) / self.leftFrameMargin;
- }
- if (edge == kCCLayerPanZoomFrameEdgeBottomLeft || edge == kCCLayerPanZoomFrameEdgeTopLeft)
- {
- speed = self.minSpeed + (self.maxSpeed - self.minSpeed) *
- (self.panBoundsRect.origin.x + self.leftFrameMargin - pos.x) / (self.leftFrameMargin * sqrt(2.0f));
- }
- if (edge == kCCLayerPanZoomFrameEdgeRight)
- {
- speed = - (self.minSpeed + (self.maxSpeed - self.minSpeed) *
- (pos.x - self.panBoundsRect.origin.x - self.panBoundsRect.size.width +
- self.rightFrameMargin) / self.rightFrameMargin);
- }
- if (edge == kCCLayerPanZoomFrameEdgeBottomRight || edge == kCCLayerPanZoomFrameEdgeTopRight)
- {
- speed = - (self.minSpeed + (self.maxSpeed - self.minSpeed) *
- (pos.x - self.panBoundsRect.origin.x - self.panBoundsRect.size.width +
- self.rightFrameMargin) / (self.rightFrameMargin * sqrt(2.0f)));
- }
- return speed;
-}
-
-- (CGFloat) vertSpeedWithPosition: (CGPoint) pos
-{
- CCLayerPanZoomFrameEdge edge = [self frameEdgeWithPoint: pos];
- CGFloat speed = 0.0f;
- if (edge == kCCLayerPanZoomFrameEdgeBottom)
- {
- speed = self.minSpeed + (self.maxSpeed - self.minSpeed) *
- (self.panBoundsRect.origin.y + self.bottomFrameMargin - pos.y) / self.bottomFrameMargin;
- }
- if (edge == kCCLayerPanZoomFrameEdgeBottomLeft || edge == kCCLayerPanZoomFrameEdgeBottomRight)
- {
- speed = self.minSpeed + (self.maxSpeed - self.minSpeed) *
- (self.panBoundsRect.origin.y + self.bottomFrameMargin - pos.y) / (self.bottomFrameMargin * sqrt(2.0f));
- }
- if (edge == kCCLayerPanZoomFrameEdgeTop)
- {
- speed = - (self.minSpeed + (self.maxSpeed - self.minSpeed) *
- (pos.y - self.panBoundsRect.origin.y - self.panBoundsRect.size.height +
- self.topFrameMargin) / self.topFrameMargin);
- }
- if (edge == kCCLayerPanZoomFrameEdgeTopLeft || edge == kCCLayerPanZoomFrameEdgeTopRight)
- {
- speed = - (self.minSpeed + (self.maxSpeed - self.minSpeed) *
- (pos.y - self.panBoundsRect.origin.y - self.panBoundsRect.size.height +
- self.topFrameMargin) / (self.topFrameMargin * sqrt(2.0f)));
- }
- return speed;
-}
-
-- (void) setContent:(CCNode *)content
-{
- if (content != _content)
- {
- [_content release];
- _content = [content retain];
-
- [self removeAllChildrenWithCleanup:YES];
- if (content)
- {
- [self addChild:content];
- self.contentSize = content.contentSize;
- }
- }
-}
-
-- (void) setPanBoundsSize:(CGSize)panBoundsSize
-{
- CGRect oldPanBounds = _panBoundsRect;
- self.panBoundsRect = CGRectMake(oldPanBounds.origin.x, oldPanBounds.origin.y, panBoundsSize.width, panBoundsSize.height);
-}
-
-- (CGSize) panBoundsSize
-{
- return self.panBoundsRect.size;
-}
-
-- (void) setPanBoundsOrigin:(CGPoint)panBoundsOrigin
-{
- CGRect oldPanBounds = _panBoundsRect;
- self.panBoundsRect = CGRectMake(panBoundsOrigin.x, panBoundsOrigin.y, oldPanBounds.size.width, oldPanBounds.size.height);
-}
-
-- (CGPoint) panBoundsOrigin
-{
- return self.panBoundsRect.origin;
-}
-
-#pragma mark Dealloc
-
-- (void) dealloc
-{
- self.touches = nil;
- self.delegate = nil;
- [super dealloc];
-}
-
-@end
View
44 CocosBuilder/libs/CCLayerPanZoom/README.md
@@ -1,44 +0,0 @@
-CCLayerPanZoom
-=============
-
-This class represents the layer that can be scrolled and scaled with one or two fingers.
-CCLayerPanZoom have two modes: sheet mode and frame mode.
-In all modes you can receive click event through CCLayerPanZoomDelegate callback.
-Other delegate callbacks are: "clicked at point", "touch position updated" and "touch move began at position".
-
-Sheet Mode
---------------
-
-In this mode you can scroll layer with swipes and zoom it with pinch in/out gestures, like in Google Maps app (see "Simple sheet test").
-Also, in sheet mode it's possible to have "ruber edges" like in many iOS apps for sliding parts of the intraface (see "Advanced sheet test").
-
-
-Frame Mode
---------------
-
-In frame mode you can zoom layer with PinchIn/Out (like in first mode) but scrolling is different: it starts if touch is at layer's edge zones (configurable).
-This will come in handy when you'll need to move objects at layer with drag & drop, i.e. in map edit mode.
-See "Frame test".
-
-
-Usage
-=============
-
-1. Add CCLayerPanZoom.h & CCLayerPanZoom.m to your project.
-2. Import CCLayerPanZoom.h when you want to use it.
-3. Make sure that you enable multitouch in your glView.
-4. Create CCLayerPanZoom instance and add some children to it.
-5. Assign the delegate if you need it.
-6. Set mode for the layer.
-7. If you want to use kCCLayerPanZoomModeSheet:
- * Set ruberEffectRatio if you want to use "ruber effect" (scrolling/zooming outside of panBoundsRect).
- * Also you can change rubberEffectRecoveryTime - in that time layer will recover to normal zoom/position.
-8. If you want to use kCCLayerPanZoomModeFrame:
- * Set topFrameMargin, leftFrameMargin, bottomFrameMargin and rightFrameMargin to define distances from edges of panBoundingRect.
- * Set maxSpeed and minSpeed for autoscrolling when touch is in zone near edge of panBoundingRect.
-9. Set maxScale and minScale factor for the layer.
-10. Set maxTouchDistanceToClick for the layer. This is the max distance that touch can be drag before click (fuzzy shaky touch ;) ).
-
-
-
-
View
971 CocosBuilderExample/CocosBuilderExample/Resources/TestPanZoom.ccb
@@ -1,971 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>centeredOrigin</key>
- <false/>
- <key>exportFlattenPaths</key>
- <true/>
- <key>exportPath</key>
- <string>/Users/vlidholt/Projects/CocosBuilder/CocosBuilderExample/CocosBuilderExample/Resources/TestPanZoom.ccbi</string>
- <key>exportPlugIn</key>
- <string>ccbi</string>
- <key>fileType</key>
- <string>CocosBuilder</string>
- <key>fileVersion</key>
- <integer>3</integer>
- <key>nodeGraph</key>
- <dict>
- <key>baseClass</key>
- <string>CCLayer</string>
- <key>children</key>
- <array>
- <dict>
- <key>baseClass</key>
- <string>CCLayerPanZoom</string>
- <key>children</key>
- <array/>
- <key>customClass</key>
- <string></string>
- <key>memberVarAssignmentName</key>
- <string></string>
- <key>memberVarAssignmentType</key>
- <integer>0</integer>
- <key>properties</key>
- <array>
- <dict>
- <key>name</key>
- <string>position</string>
- <key>type</key>
- <string>Position</string>
- <key>value</key>
- <array>
- <real>240</real>
- <real>-704</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>contentSize</string>
- <key>type</key>
- <string>Size</string>
- <key>value</key>
- <array>
- <real>1024</real>
- <real>1024</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>anchorPoint</string>
- <key>type</key>
- <string>Point</string>
- <key>value</key>
- <array>
- <real>0.0</real>
- <real>0.0</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>scale</string>
- <key>type</key>
- <string>ScaleLock</string>
- <key>value</key>
- <array>
- <real>1</real>
- <real>1</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>rotation</string>
- <key>type</key>
- <string>Degrees</string>
- <key>value</key>
- <real>0.0</real>
- </dict>
- <dict>
- <key>name</key>
- <string>tag</string>
- <key>type</key>
- <string>Integer</string>
- <key>value</key>
- <integer>-1</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>isRelativeAnchorPoint</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>visible</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>isTouchEnabled</string>
- <key>platform</key>
- <string>iOS</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>isAccelerometerEnabled</string>
- <key>platform</key>
- <string>iOS</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>isMouseEnabled</string>
- <key>platform</key>
- <string>Mac</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>isKeyboardEnabled</string>
- <key>platform</key>
- <string>Mac</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>content</string>
- <key>type</key>
- <string>CCBFile</string>
- <key>value</key>
- <string>TestPanZoomLayer.ccb</string>
- </dict>
- <dict>
- <key>name</key>
- <string>panBoundsOrigin</string>
- <key>type</key>
- <string>Position</string>
- <key>value</key>
- <array>
- <real>240</real>
- <real>0.0</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>panBoundsSize</string>
- <key>type</key>
- <string>Size</string>
- <key>value</key>
- <array>
- <real>240</real>
- <real>320</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>minScale</string>
- <key>type</key>
- <string>Float</string>
- <key>value</key>
- <real>1</real>
- </dict>
- <dict>
- <key>name</key>
- <string>maxScale</string>
- <key>type</key>
- <string>Float</string>
- <key>value</key>
- <real>3</real>
- </dict>
- <dict>
- <key>name</key>
- <string>snapToTop</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>mode</string>
- <key>type</key>
- <string>IntegerLabeled</string>
- <key>value</key>
- <integer>0</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>rubberEffectRecoveryTime</string>
- <key>type</key>
- <string>Float</string>
- <key>value</key>
- <real>0.20000000298023224</real>
- </dict>
- <dict>
- <key>name</key>
- <string>rubberEffectRatio</string>
- <key>type</key>
- <string>Float</string>
- <key>value</key>
- <real>0.5</real>
- </dict>
- </array>
- </dict>
- <dict>
- <key>baseClass</key>
- <string>CCLayerColor</string>
- <key>children</key>
- <array/>
- <key>customClass</key>
- <string></string>
- <key>memberVarAssignmentName</key>
- <string></string>
- <key>memberVarAssignmentType</key>
- <integer>0</integer>
- <key>properties</key>
- <array>
- <dict>
- <key>name</key>
- <string>position</string>
- <key>type</key>
- <string>Position</string>
- <key>value</key>
- <array>
- <real>0.0</real>
- <real>0.0</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>contentSize</string>
- <key>type</key>
- <string>Size</string>
- <key>value</key>
- <array>
- <real>240</real>
- <real>320</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>anchorPoint</string>
- <key>type</key>
- <string>Point</string>
- <key>value</key>
- <array>
- <real>0.5</real>
- <real>0.5</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>scale</string>
- <key>type</key>
- <string>ScaleLock</string>
- <key>value</key>
- <array>
- <real>1</real>
- <real>1</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>rotation</string>
- <key>type</key>
- <string>Degrees</string>
- <key>value</key>
- <real>0.0</real>
- </dict>
- <dict>
- <key>name</key>
- <string>tag</string>
- <key>type</key>
- <string>Integer</string>
- <key>value</key>
- <integer>-1</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>isRelativeAnchorPoint</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>visible</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>isTouchEnabled</string>
- <key>platform</key>
- <string>iOS</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>isAccelerometerEnabled</string>
- <key>platform</key>
- <string>iOS</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>isMouseEnabled</string>
- <key>platform</key>
- <string>Mac</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>isKeyboardEnabled</string>
- <key>platform</key>
- <string>Mac</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>color</string>
- <key>type</key>
- <string>Color3</string>
- <key>value</key>
- <array>
- <integer>177</integer>
- <integer>172</integer>
- <integer>172</integer>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>opacity</string>
- <key>type</key>
- <string>Byte</string>
- <key>value</key>
- <integer>255</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>blendFunc</string>
- <key>type</key>
- <string>Blendmode</string>
- <key>value</key>
- <array>
- <integer>770</integer>
- <integer>771</integer>
- </array>
- </dict>
- </array>
- </dict>
- <dict>
- <key>baseClass</key>
- <string>CCLayerColor</string>
- <key>children</key>
- <array>
- <dict>
- <key>baseClass</key>
- <string>CCLabelBMFont</string>
- <key>children</key>
- <array/>
- <key>customClass</key>
- <string></string>
- <key>memberVarAssignmentName</key>
- <string></string>
- <key>memberVarAssignmentType</key>
- <integer>0</integer>
- <key>properties</key>
- <array>
- <dict>
- <key>name</key>
- <string>position</string>
- <key>type</key>
- <string>Position</string>
- <key>value</key>
- <array>
- <real>240.5</real>
- <real>20</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>contentSize</string>
- <key>type</key>
- <string>Size</string>
- <key>value</key>
- <array>
- <real>245</real>
- <real>26</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>anchorPoint</string>
- <key>type</key>
- <string>Point</string>
- <key>value</key>
- <array>
- <real>0.5</real>
- <real>0.5</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>scale</string>
- <key>type</key>
- <string>ScaleLock</string>
- <key>value</key>
- <array>
- <real>1</real>
- <real>1</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>rotation</string>
- <key>type</key>
- <string>Degrees</string>
- <key>value</key>
- <real>0.0</real>
- </dict>
- <dict>
- <key>name</key>
- <string>tag</string>
- <key>type</key>
- <string>Integer</string>
- <key>value</key>
- <integer>-1</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>isRelativeAnchorPoint</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>visible</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>fntFile</string>
- <key>type</key>
- <string>FntFile</string>
- <key>value</key>
- <string>markerfelt24shadow.fnt</string>
- </dict>
- <dict>
- <key>name</key>
- <string>opacity</string>
- <key>type</key>
- <string>Byte</string>
- <key>value</key>
- <integer>255</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>color</string>
- <key>type</key>
- <string>Color3</string>
- <key>value</key>
- <array>
- <integer>255</integer>
- <integer>255</integer>
- <integer>255</integer>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>string</string>
- <key>type</key>
- <string>Text</string>
- <key>value</key>
- <string>CCLayerPanZoom example</string>
- </dict>
- </array>
- </dict>
- </array>
- <key>customClass</key>
- <string></string>
- <key>memberVarAssignmentName</key>
- <string></string>
- <key>memberVarAssignmentType</key>
- <integer>0</integer>
- <key>properties</key>
- <array>
- <dict>
- <key>name</key>
- <string>position</string>
- <key>type</key>
- <string>Position</string>
- <key>value</key>
- <array>
- <real>0.0</real>
- <real>280</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>contentSize</string>
- <key>type</key>
- <string>Size</string>
- <key>value</key>
- <array>
- <real>480</real>
- <real>40</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>anchorPoint</string>
- <key>type</key>
- <string>Point</string>
- <key>value</key>
- <array>
- <real>0.0</real>
- <real>0.0</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>scale</string>
- <key>type</key>
- <string>ScaleLock</string>
- <key>value</key>
- <array>
- <real>1</real>
- <real>1</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>rotation</string>
- <key>type</key>
- <string>Degrees</string>
- <key>value</key>
- <real>0.0</real>
- </dict>
- <dict>
- <key>name</key>
- <string>tag</string>
- <key>type</key>
- <string>Integer</string>
- <key>value</key>
- <integer>-1</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>isRelativeAnchorPoint</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>visible</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>isTouchEnabled</string>
- <key>platform</key>
- <string>iOS</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>isAccelerometerEnabled</string>
- <key>platform</key>
- <string>iOS</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>isMouseEnabled</string>
- <key>platform</key>
- <string>Mac</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>isKeyboardEnabled</string>
- <key>platform</key>
- <string>Mac</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>color</string>
- <key>type</key>
- <string>Color3</string>
- <key>value</key>
- <array>
- <integer>0</integer>
- <integer>0</integer>
- <integer>0</integer>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>opacity</string>
- <key>type</key>
- <string>Byte</string>
- <key>value</key>
- <integer>127</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>blendFunc</string>
- <key>type</key>
- <string>Blendmode</string>
- <key>value</key>
- <array>
- <integer>770</integer>
- <integer>771</integer>
- </array>
- </dict>
- </array>
- </dict>
- <dict>
- <key>baseClass</key>
- <string>CCLabelTTF</string>
- <key>children</key>
- <array/>
- <key>customClass</key>
- <string></string>
- <key>memberVarAssignmentName</key>
- <string></string>
- <key>memberVarAssignmentType</key>
- <integer>0</integer>
- <key>properties</key>
- <array>
- <dict>
- <key>name</key>
- <string>position</string>
- <key>type</key>
- <string>Position</string>
- <key>value</key>
- <array>
- <real>365</real>
- <real>19</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>contentSize</string>
- <key>type</key>
- <string>Size</string>
- <key>value</key>
- <array>
- <real>220</real>
- <real>40</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>anchorPoint</string>
- <key>type</key>
- <string>Point</string>
- <key>value</key>
- <array>
- <real>0.5</real>
- <real>0.5</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>scale</string>
- <key>type</key>
- <string>ScaleLock</string>
- <key>value</key>
- <array>
- <real>1</real>
- <real>1</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>rotation</string>
- <key>type</key>
- <string>Degrees</string>
- <key>value</key>
- <real>0.0</real>
- </dict>
- <dict>
- <key>name</key>
- <string>tag</string>
- <key>type</key>
- <string>Integer</string>
- <key>value</key>
- <integer>-1</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>isRelativeAnchorPoint</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>visible</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>fontName</string>
- <key>type</key>
- <string>FontTTF</string>
- <key>value</key>
- <string>Cochin</string>
- </dict>
- <dict>
- <key>name</key>
- <string>fontSize</string>
- <key>type</key>
- <string>Float</string>
- <key>value</key>
- <real>12</real>
- </dict>
- <dict>
- <key>name</key>
- <string>opacity</string>
- <key>type</key>
- <string>Byte</string>
- <key>value</key>
- <integer>255</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>color</string>
- <key>type</key>
- <string>Color3</string>
- <key>value</key>
- <array>
- <integer>255</integer>
- <integer>255</integer>
- <integer>255</integer>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>dimensions</string>
- <key>type</key>
- <string>Size</string>
- <key>value</key>
- <array>
- <real>220</real>
- <real>40</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>alignment</string>
- <key>type</key>
- <string>IntegerLabeled</string>
- <key>value</key>
- <integer>1</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>string</string>
- <key>type</key>
- <string>Text</string>
- <key>value</key>
- <string>Image by Louise Lemettais
-Creative Commons attribution licence</string>
- </dict>
- </array>
- </dict>
- </array>
- <key>customClass</key>
- <string>TestPanZoom</string>
- <key>memberVarAssignmentName</key>
- <string></string>
- <key>memberVarAssignmentType</key>
- <integer>0</integer>
- <key>properties</key>
- <array>
- <dict>
- <key>name</key>
- <string>position</string>
- <key>type</key>
- <string>Position</string>
- <key>value</key>
- <array>
- <real>0.0</real>
- <real>0.0</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>contentSize</string>
- <key>type</key>
- <string>Size</string>
- <key>value</key>
- <array>
- <real>480</real>
- <real>320</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>anchorPoint</string>
- <key>type</key>
- <string>Point</string>
- <key>value</key>
- <array>
- <real>0.0</real>
- <real>0.0</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>scale</string>
- <key>type</key>
- <string>ScaleLock</string>
- <key>value</key>
- <array>
- <real>1</real>
- <real>1</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>rotation</string>
- <key>type</key>
- <string>Degrees</string>
- <key>value</key>
- <real>0.0</real>
- </dict>
- <dict>
- <key>name</key>
- <string>tag</string>
- <key>type</key>
- <string>Integer</string>
- <key>value</key>
- <integer>-1</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>isRelativeAnchorPoint</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>visible</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>isTouchEnabled</string>
- <key>platform</key>
- <string>iOS</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>isAccelerometerEnabled</string>
- <key>platform</key>
- <string>iOS</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>isMouseEnabled</string>
- <key>platform</key>
- <string>Mac</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- <dict>
- <key>name</key>
- <string>isKeyboardEnabled</string>
- <key>platform</key>
- <string>Mac</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <false/>
- </dict>
- </array>
- </dict>
- <key>stageHeight</key>
- <integer>320</integer>
- <key>stageWidth</key>
- <integer>480</integer>
-</dict>
-</plist>
View
BIN CocosBuilderExample/CocosBuilderExample/Resources/TestPanZoom.ccbi
Binary file not shown.
View
253 CocosBuilderExample/CocosBuilderExample/Resources/TestPanZoomLayer.ccb
@@ -1,253 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>centeredOrigin</key>
- <false/>
- <key>fileType</key>
- <string>CocosBuilder</string>
- <key>fileVersion</key>
- <integer>3</integer>
- <key>nodeGraph</key>
- <dict>
- <key>baseClass</key>
- <string>CCNode</string>
- <key>children</key>
- <array>
- <dict>
- <key>baseClass</key>
- <string>CCSprite</string>
- <key>children</key>
- <array/>
- <key>customClass</key>
- <string></string>
- <key>memberVarAssignmentName</key>
- <string></string>
- <key>memberVarAssignmentType</key>
- <integer>0</integer>
- <key>properties</key>
- <array>
- <dict>
- <key>name</key>
- <string>position</string>
- <key>type</key>
- <string>Position</string>
- <key>value</key>
- <array>
- <real>0.0</real>
- <real>0.0</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>contentSize</string>
- <key>type</key>
- <string>Size</string>
- <key>value</key>
- <array>
- <real>1024</real>
- <real>1024</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>anchorPoint</string>
- <key>type</key>
- <string>Point</string>
- <key>value</key>
- <array>
- <real>0.0</real>
- <real>0.0</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>scale</string>
- <key>type</key>
- <string>ScaleLock</string>
- <key>value</key>
- <array>
- <real>1</real>
- <real>1</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>rotation</string>
- <key>type</key>
- <string>Degrees</string>
- <key>value</key>
- <real>0.0</real>
- </dict>
- <dict>
- <key>name</key>
- <string>tag</string>
- <key>type</key>
- <string>Integer</string>
- <key>value</key>
- <integer>-1</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>isRelativeAnchorPoint</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>visible</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>displayFrame</string>
- <key>type</key>
- <string>SpriteFrame</string>
- <key>value</key>
- <array>
- <string></string>
- <string>flower.jpg</string>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>opacity</string>
- <key>type</key>
- <string>Byte</string>
- <key>value</key>
- <integer>255</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>color</string>
- <key>type</key>
- <string>Color3</string>
- <key>value</key>
- <array>
- <integer>255</integer>
- <integer>255</integer>
- <integer>255</integer>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>flip</string>
- <key>type</key>
- <string>Flip</string>
- <key>value</key>
- <array>
- <false/>
- <false/>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>blendFunc</string>
- <key>type</key>
- <string>Blendmode</string>
- <key>value</key>
- <array>
- <integer>770</integer>
- <integer>771</integer>
- </array>
- </dict>
- </array>
- </dict>
- </array>
- <key>customClass</key>
- <string></string>
- <key>memberVarAssignmentName</key>
- <string></string>
- <key>memberVarAssignmentType</key>
- <integer>0</integer>
- <key>properties</key>
- <array>
- <dict>
- <key>name</key>
- <string>position</string>
- <key>type</key>
- <string>Position</string>
- <key>value</key>
- <array>
- <real>0.0</real>
- <real>0.0</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>contentSize</string>
- <key>type</key>
- <string>Size</string>
- <key>value</key>
- <array>
- <real>1024</real>
- <real>1024</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>anchorPoint</string>
- <key>type</key>
- <string>Point</string>
- <key>value</key>
- <array>
- <real>0.0</real>
- <real>0.0</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>scale</string>
- <key>type</key>
- <string>ScaleLock</string>
- <key>value</key>
- <array>
- <real>1</real>
- <real>1</real>
- </array>
- </dict>
- <dict>
- <key>name</key>
- <string>rotation</string>
- <key>type</key>
- <string>Degrees</string>
- <key>value</key>
- <real>0.0</real>
- </dict>
- <dict>
- <key>name</key>
- <string>tag</string>
- <key>type</key>
- <string>Integer</string>
- <key>value</key>
- <integer>-1</integer>
- </dict>
- <dict>
- <key>name</key>
- <string>isRelativeAnchorPoint</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- <dict>
- <key>name</key>
- <string>visible</string>
- <key>type</key>
- <string>Check</string>
- <key>value</key>
- <true/>
- </dict>
- </array>
- </dict>
- <key>stageHeight</key>
- <integer>1024</integer>
- <key>stageWidth</key>
- <integer>1024</integer>
-</dict>
-</plist>
View
BIN CocosBuilderExample/CocosBuilderExample/Resources/TestPanZoomLayer.ccbi
Binary file not shown.
View
1 CocosBuilderExample/CocosBuilderExample/libs/CCLayerPanZoom

0 comments on commit e6970a0

Please sign in to comment.
Something went wrong with that request. Please try again.