Skip to content

Commit

Permalink
Support for bones
Browse files Browse the repository at this point in the history
  • Loading branch information
vladubogdan committed Feb 8, 2015
1 parent 585a887 commit 512d8ed
Show file tree
Hide file tree
Showing 52 changed files with 10,676 additions and 16 deletions.
10 changes: 10 additions & 0 deletions DEMOS/DEMOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
6E4026981982BD55002B4D32 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E4026961982BD55002B4D32 /* main.m */; };
6E40269B1982BDE4002B4D32 /* AppDelegateMacOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E40269A1982BDE4002B4D32 /* AppDelegateMacOS.m */; };
6E40269D1982BE30002B4D32 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6E40269C1982BE30002B4D32 /* MainMenu.xib */; };
6E77DFB91A87363C00159958 /* LHSceneSkeletalCharacterTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6E77DFB81A87363C00159958 /* LHSceneSkeletalCharacterTest.mm */; };
6E77DFBA1A87363C00159958 /* LHSceneSkeletalCharacterTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6E77DFB81A87363C00159958 /* LHSceneSkeletalCharacterTest.mm */; };
6E77DFBB1A87363C00159958 /* LHSceneSkeletalCharacterTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6E77DFB81A87363C00159958 /* LHSceneSkeletalCharacterTest.mm */; };
6E9B5D371A6CF9170090C8B4 /* BlueRobotSprite.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6E9B5D041A6CF9170090C8B4 /* BlueRobotSprite.mm */; };
6E9B5D381A6CF9170090C8B4 /* BlueRobotSprite.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6E9B5D041A6CF9170090C8B4 /* BlueRobotSprite.mm */; };
6E9B5D391A6CF9170090C8B4 /* BlueRobotSprite.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6E9B5D041A6CF9170090C8B4 /* BlueRobotSprite.mm */; };
Expand Down Expand Up @@ -340,6 +343,8 @@
6E4026991982BDE4002B4D32 /* AppDelegateMacOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegateMacOS.h; path = Classes/AppDelegateMacOS.h; sourceTree = "<group>"; };
6E40269A1982BDE4002B4D32 /* AppDelegateMacOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegateMacOS.m; path = Classes/AppDelegateMacOS.m; sourceTree = "<group>"; };
6E40269C1982BE30002B4D32 /* MainMenu.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MainMenu.xib; path = Resources/MainMenu.xib; sourceTree = "<group>"; };
6E77DFB71A87363C00159958 /* LHSceneSkeletalCharacterTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LHSceneSkeletalCharacterTest.h; path = Classes/LHSceneSkeletalCharacterTest.h; sourceTree = "<group>"; };
6E77DFB81A87363C00159958 /* LHSceneSkeletalCharacterTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = LHSceneSkeletalCharacterTest.mm; path = Classes/LHSceneSkeletalCharacterTest.mm; sourceTree = "<group>"; };
6E9B5CDE1A6CF8E60090C8B4 /* Box2D.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Box2D.xcodeproj; path = ../Box2D/Box2D.xcodeproj; sourceTree = "<group>"; };
6E9B5CE71A6CF8EF0090C8B4 /* cocos2d.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d.xcodeproj; path = ../cocos2d/cocos2d.xcodeproj; sourceTree = "<group>"; };
6E9B5CF71A6CF8F70090C8B4 /* LevelHelper2-API.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "LevelHelper2-API.xcodeproj"; path = "../LevelHelper2-API/LevelHelper2-API.xcodeproj"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -557,6 +562,8 @@
6E9B5D1A1A6CF9170090C8B4 /* LHSceneDemo.mm */,
6E9B5D1F1A6CF9170090C8B4 /* LHSceneIntroduction.h */,
6E9B5D201A6CF9170090C8B4 /* LHSceneIntroduction.mm */,
6E77DFB71A87363C00159958 /* LHSceneSkeletalCharacterTest.h */,
6E77DFB81A87363C00159958 /* LHSceneSkeletalCharacterTest.mm */,
6E9B5DA81A6D166E0090C8B4 /* LHSceneAdvancedPhysicsTest.h */,
6E9B5DA91A6D166E0090C8B4 /* LHSceneAdvancedPhysicsTest.mm */,
6E9B5E791A6E6F180090C8B4 /* LHSceneOnTheFlySpritesWithPhysicsTest.h */,
Expand Down Expand Up @@ -947,6 +954,7 @@
6E9B5D7C1A6CF9170090C8B4 /* LHSceneUserPropertiesTest.mm in Sources */,
6E9B5D491A6CF9170090C8B4 /* LHSceneCameraTest.mm in Sources */,
6E9B5D551A6CF9170090C8B4 /* LHSceneCollisionHandlingTest.mm in Sources */,
6E77DFB91A87363C00159958 /* LHSceneSkeletalCharacterTest.mm in Sources */,
6E9B5D3A1A6CF9170090C8B4 /* LHSceneAssetsTest.mm in Sources */,
6E9B5D4F1A6CF9170090C8B4 /* LHSceneCharacterAnimationTest.mm in Sources */,
6E9B5D431A6CF9170090C8B4 /* LHSceneBodyScaleTest.mm in Sources */,
Expand Down Expand Up @@ -984,6 +992,7 @@
6E9B5D7E1A6CF9170090C8B4 /* LHSceneUserPropertiesTest.mm in Sources */,
6E9B5D4B1A6CF9170090C8B4 /* LHSceneCameraTest.mm in Sources */,
6E9B5D571A6CF9170090C8B4 /* LHSceneCollisionHandlingTest.mm in Sources */,
6E77DFBB1A87363C00159958 /* LHSceneSkeletalCharacterTest.mm in Sources */,
6E9B5D3C1A6CF9170090C8B4 /* LHSceneAssetsTest.mm in Sources */,
6E9B5D511A6CF9170090C8B4 /* LHSceneCharacterAnimationTest.mm in Sources */,
6E9B5D451A6CF9170090C8B4 /* LHSceneBodyScaleTest.mm in Sources */,
Expand Down Expand Up @@ -1021,6 +1030,7 @@
6E9B5D7D1A6CF9170090C8B4 /* LHSceneUserPropertiesTest.mm in Sources */,
6E9B5D4A1A6CF9170090C8B4 /* LHSceneCameraTest.mm in Sources */,
6E9B5D561A6CF9170090C8B4 /* LHSceneCollisionHandlingTest.mm in Sources */,
6E77DFBA1A87363C00159958 /* LHSceneSkeletalCharacterTest.mm in Sources */,
6E9B5D3B1A6CF9170090C8B4 /* LHSceneAssetsTest.mm in Sources */,
6E9B5D501A6CF9170090C8B4 /* LHSceneCharacterAnimationTest.mm in Sources */,
6E9B5D441A6CF9170090C8B4 /* LHSceneBodyScaleTest.mm in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
buildConfiguration = "Release"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
Expand Down
4 changes: 3 additions & 1 deletion DEMOS/DEMOS/Classes/LHSceneDemo.mm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#import "LHSceneNodesSubclassingTest.h"
#import "LHSceneAdvancedPhysicsTest.h"
#import "LHSceneOnTheFlySpritesWithPhysicsTest.h"

#import "LHSceneSkeletalCharacterTest.h"
#import "LHSceneUniversalDevicesTest.h"

@implementation LHSceneDemo
Expand Down Expand Up @@ -65,6 +65,8 @@ - (id)initWithContentOfFile:(NSString *)levelPlistFile

[availableScenes addObject:[LHSceneIntroduction class]];

[availableScenes addObject:[LHSceneSkeletalCharacterTest class]];

[availableScenes addObject:[LHSceneOnTheFlySpritesWithPhysicsTest class]];

[availableScenes addObject:[LHSceneAdvancedPhysicsTest class]];
Expand Down
20 changes: 20 additions & 0 deletions DEMOS/DEMOS/Classes/LHSceneSkeletalCharacterTest.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// LHSceneSkeletalCharacterTest.h
// LevelHelper2-Cocos2d-v3
//
// Created by Bogdan Vladu on 15/05/14.
// Copyright VLADU BOGDAN DANIEL PFA 2014. All rights reserved.
//
// -----------------------------------------------------------------------

// Importing cocos2d.h and cocos2d-ui.h, will import anything you need to start using cocos2d-v3
#import "cocos2d.h"
#import "cocos2d-ui.h"

#import "LevelHelper2API.h"
#import "LHSceneDemo.h"

@interface LHSceneSkeletalCharacterTest : LHSceneDemo


@end
51 changes: 51 additions & 0 deletions DEMOS/DEMOS/Classes/LHSceneSkeletalCharacterTest.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// LHSceneSkeletalCharacterTest.m
// LevelHelper2-Cocos2d-v3
//
// Created by Bogdan Vladu on 15/05/14.
// Copyright VLADU BOGDAN DANIEL PFA 2014. All rights reserved.
//
// -----------------------------------------------------------------------

// Import the interfaces
#import "LHSceneSkeletalCharacterTest.h"

@implementation LHSceneSkeletalCharacterTest
+ (LHSceneDemo *)scene{
return [[self alloc] initWithContentOfFile:@"PUBLISH_FOLDER/skeletalCharacter.lhplist"];
}

- (id)initWithContentOfFile:(NSString *)levelPlistFile
{
self = [super initWithContentOfFile:levelPlistFile];

if (!self) return(nil);


//#if LH_USE_BOX2D
CCLabelTTF* ttf = [CCLabelTTF labelWithString:@"Skeletal Character Setup.\n"
fontName:@"ArialMT"
fontSize:20];
//#else
// CCLabelTTF* ttf = [CCLabelTTF labelWithString:@"ASSETS DEMO\nAssets are special objects that when edited they will change\nto the new edited state everywhere they are used in your project.\n\nClick to create a new officer (asset) of a random scale and rotation.\n\nChipmunk detected:\nSorry but currently Cocos2d has a bug where it does not update children physics body position.\nWhen using Chipmunk and having physics bodies on children of node transformations will not work correctly.\nSwitch to the Box2d target for correct physics transformations."
// fontName:@"ArialMT"
// fontSize:20];
//#endif


[ttf setColor:[CCColor blackColor]];
[ttf setHorizontalAlignment:CCTextAlignmentCenter];
[ttf setPosition:CGPointMake(self.contentSize.width*0.5,
self.contentSize.height*0.5+60)];

[[self uiNode] addChild:ttf];//add the text to the ui element as we dont want it to move with the camera

// done
return self;
}





@end
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,7 @@
<key>nodeType</key>
<string>LHNode</string>
<key>parentUUID</key>
<string>6782E66D-C9C7-4C7D-AF1B-4CCA94718C63</string>
<string>A2B375AB-97AB-4FC6-A530-BEDE23FF0D6E</string>
<key>rotation</key>
<real>0.0</real>
<key>scale</key>
Expand All @@ -1779,7 +1779,7 @@
<key>nodeType</key>
<string>LHAsset</string>
<key>parentUUID</key>
<string>9C6D97AA-CBC5-46C3-8643-7EE3EEECB357</string>
<string>CA62873D-CB98-4495-8530-41B0F4DD0D21</string>
<key>rotation</key>
<real>0.0</real>
<key>scale</key>
Expand All @@ -1791,7 +1791,7 @@
<string>DEFAULT</string>
</array>
<key>uuid</key>
<string>6782E66D-C9C7-4C7D-AF1B-4CCA94718C63</string>
<string>A2B375AB-97AB-4FC6-A530-BEDE23FF0D6E</string>
<key>zOrder</key>
<integer>0</integer>
</dict>
Expand Down
18 changes: 9 additions & 9 deletions DEMOS/DEMOS/Resources/PUBLISH_FOLDER/carAsset.lhasset.plist
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<key>fixedRotation</key>
<false/>
<key>fixtureUUID</key>
<string>A8A2D929-CAD4-4530-A34A-B759EFBB3E8C</string>
<string>ECD04CFF-EDFA-4DB5-B6F0-63B2CFFE67AC</string>
<key>genericFixture</key>
<dict>
<key>category</key>
Expand Down Expand Up @@ -70,7 +70,7 @@
<key>nodeType</key>
<string>LHSprite</string>
<key>parentUUID</key>
<string>BFE4145F-414D-46F6-850D-47BE2DB26EF5</string>
<string>BD9E4235-25CA-4043-BE41-62BEF5B28294</string>
<key>relativeImagePath</key>
<string>PUBLISH_FOLDER/</string>
<key>rotation</key>
Expand Down Expand Up @@ -112,7 +112,7 @@
<key>nodeType</key>
<string>LHRevoluteJoint</string>
<key>parentUUID</key>
<string>BFE4145F-414D-46F6-850D-47BE2DB26EF5</string>
<string>BD9E4235-25CA-4043-BE41-62BEF5B28294</string>
<key>relativePosA</key>
<string>{0.000000, 0.000000}</string>
<key>spriteAUUID</key>
Expand Down Expand Up @@ -148,7 +148,7 @@
<key>nodeType</key>
<string>LHRevoluteJoint</string>
<key>parentUUID</key>
<string>BFE4145F-414D-46F6-850D-47BE2DB26EF5</string>
<string>BD9E4235-25CA-4043-BE41-62BEF5B28294</string>
<key>relativePosA</key>
<string>{0.000000, 0.000000}</string>
<key>spriteAUUID</key>
Expand Down Expand Up @@ -222,7 +222,7 @@
<key>nodeType</key>
<string>LHSprite</string>
<key>parentUUID</key>
<string>BFE4145F-414D-46F6-850D-47BE2DB26EF5</string>
<string>BD9E4235-25CA-4043-BE41-62BEF5B28294</string>
<key>relativeImagePath</key>
<string>PUBLISH_FOLDER/</string>
<key>rotation</key>
Expand Down Expand Up @@ -302,7 +302,7 @@
<key>nodeType</key>
<string>LHSprite</string>
<key>parentUUID</key>
<string>BFE4145F-414D-46F6-850D-47BE2DB26EF5</string>
<string>BD9E4235-25CA-4043-BE41-62BEF5B28294</string>
<key>relativeImagePath</key>
<string>PUBLISH_FOLDER/</string>
<key>rotation</key>
Expand Down Expand Up @@ -334,7 +334,7 @@
<key>nodeType</key>
<string>LHAsset</string>
<key>parentUUID</key>
<string>9C6D97AA-CBC5-46C3-8643-7EE3EEECB357</string>
<string>CA62873D-CB98-4495-8530-41B0F4DD0D21</string>
<key>rotation</key>
<real>0.0</real>
<key>scale</key>
Expand All @@ -347,7 +347,7 @@
</array>
<key>tracedFixtures</key>
<dict>
<key>A8A2D929-CAD4-4530-A34A-B759EFBB3E8C</key>
<key>ECD04CFF-EDFA-4DB5-B6F0-63B2CFFE67AC</key>
<array>
<array>
<string>{-40.75, -37.5}</string>
Expand Down Expand Up @@ -407,7 +407,7 @@
</array>
</dict>
<key>uuid</key>
<string>BFE4145F-414D-46F6-850D-47BE2DB26EF5</string>
<string>BD9E4235-25CA-4043-BE41-62BEF5B28294</string>
<key>zOrder</key>
<integer>0</integer>
</dict>
Expand Down
Loading

0 comments on commit 512d8ed

Please sign in to comment.