spritebuilder

使用SpriteBuilder制作Cocos2D游戏完全中文教程(四)

六月ゝ 毕业季﹏ 提交于 2020-03-22 21:24:40
3 月,跳不动了?>>> 使用 SpriteBuilder 添加菜单 ( Add Menus Using SpriteBuilder ) 现在,我们要设置开始菜单。这开始菜单会引导我们进入游戏场景。 从 MainScene.ccb 删除一切 我们将使用 MainScene 作为我们的主菜单,从项目模板中删除的默认生成的标签和背景图像。 设置背景图像 美术提供菜单背景的设计工作在 3.5 英寸( <= iPhone 4 )和 4 英寸( > = iPhone 5 )的屏幕。 拖动 menubackground.png 到屏幕上。通过保持默认锚点( 0.5 , 0.5 )和位置将背景图片设置到屏幕中央,并设置相对父容器位置的 x 和 y 为父容器的 50 %: 定位 Sprite 的这种方式确保其始终居中 - 独立的屏幕尺寸。 添加播放按钮 打开 节点库视图( Node library View ) 在左窗格中拖动一个 按钮 到舞台( Stage )。现在你需要修改选择的按钮的一些设置。 在右侧面板的底部,你可以选择不同的按钮状态下的图片。对于正常状态和高亮状态都选择 button.png 图片。不要担心,如果该按钮现在看起来失真,您需要更改其他设置: 首选大小 应为( 167.0 , 152.0 )较好的尺寸需要的图像大小的 50 %为视网膜图像。最后一步,删除按钮的 “ 标题

iOS app validation error: Missing plist key CFBundleShortVersionString

£可爱£侵袭症+ 提交于 2020-01-11 08:54:18
问题 I built an iOS game with SpriteBuilder and cocos2d. When I attempt to submit it to the AppStore, I get the following error: ERROR ITMS-9000: "Missing plist key. The Info.plist file is missing the required key: CFBundleShortVersionString." How do I fix this? Thanks! 回答1: This is an easy fix. You just need to add the CFBundleShortVersionString key to your Info.plist file. Click your Info.plist file in your project. Right click and select "Add Row". Then paste in the string

Cocos2d v.2 to v.3: All my resources scale up like crazy

半腔热情 提交于 2020-01-06 14:51:30
问题 I´ve just created an new cocos2d 3.3 project using SpriteBuilder. I imported my art resources and code from my cocos2d v2 project and got it to run, but all my resources scale up to about 3x their original size and the positions I set seems to be and all touch handling seems to be broken. I only have one sprite sheet and it does not have any suffix (like -hd). I´ve commented out [CCBReader configureCCFileUtils]; in AppDelegate.m but that didn´t change anything. Do I have to add a suffix or

Swift Cocos2d3.x CCSprite applyImpulse not giving proper jump

坚强是说给别人听的谎言 提交于 2019-12-25 06:56:23
问题 I am using Cocos2d3.x with SpriteBuilder in Swift language. I want to make some animation like bouncing ball on Polls as seen in this GIF: https://www.dropbox.com/s/43vwlbjoazaxe7u/jumpyBall_15_jul_15.gif?dl=0 If you have noticed in the GIF file, each second jump is half of the previous jump. So, it seems pattern of 1,0.5,1,0.5,1,0.5,... Following are my settings: Polls: Physics Enabled Density: 1.0 Static Body Collision Type: Platform Circle: Physics Enabled Density: 1.0 Dynamic Body

How to add seperate iPad and iPhone images in spritebuilder- Cocos2d 3.2

只谈情不闲聊 提交于 2019-12-24 03:07:04
问题 I love that Spritebuilder takes the retina iPad image and automatically makes the scaled down iPhone images. I make one image (ipad retina), And spritebuilder makes the iPhone ones automatically: But for certain buttons/sprites, I wanted to make both the iPad and iPhone images myself. How do I add custom iPhone AND iPad versions for an image that can be used in the Spritebuilder UI? Eg. Use one image for iPad (retina), But use another one for iPhone. Also, how do I add something like an

Unable to instantiate the UIApplication subclass instance

久未见 提交于 2019-12-14 03:17:34
问题 i'm building a SpriteBuilder project and getting the error of: " * Assertion failure in int UIApplicationMain(int, char **, NSString *, NSString *)(), /SourceCache/UIKit_Sim/UIKit-2903.23/UIApplication.m:2380 Unable to instantiate the UIApplication subclass instance. No class named NSApplication is loaded." For the main.m code of: #import <UIKit/UIKit.h> int main(int argc, char *argv[]) { @autoreleasepool { int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); return retVal; } }

Bodies connected by a joint must be added to the same CCPhysicsNode, however two bodies are under the same CCPhysicsNode but

家住魔仙堡 提交于 2019-12-13 02:47:31
问题 I am making application by this tutorial. https://www.makegameswith.us/tutorials/getting-started-with-spritebuilder/spritebuilder-physics/ I made jointnode directly in code like this _mouseJoint = [CCPhysicsJoint connectedSpringJointWithBodyA:_mouseJointNode.physicsBody bodyB:_catapultArm.physicsBody anchorA:ccp(0, 0) anchorB:ccp(34, 138) restLength:0.f stiffness:3000.f damping:150.f]; but even though surely two nodes are under the same CCPhysicNode, it shows this error Bodies connected by a

Spritebuilder project with wrong node positions in xcode 6

杀马特。学长 韩版系。学妹 提交于 2019-12-12 23:52:50
问题 I've been using spritebuilder to play around with a few design ideas. I recently upgraded xcode to xcode 6 and my node positions have ended up being a bit screwy. I was wondering if anyone else is having these issues. What I get on spritebuilder vs how it ends up looking like on ios simulator Deploying to an actual ios device with ios 7 works correctly. 回答1: I managed to find a solution to the problem. unchecking all deivce orientations and checking protrait in xcode resolved it. I think

SpriteBuilder image file not found

[亡魂溺海] 提交于 2019-12-12 17:02:54
问题 I have added a .png image in sprit builder resource folder and I have published it. I see the added image in sprite builder all folder in Resources under Published-IOS. Here I have tried to access the added image in following ways. _hero.spriteFrame = [CCSpriteFrame frameWithImageNamed:@"Down.png"]; [_hero setTexture:[CCTexture textureWithFile:@"Game/Down.png"]] But none of these methods are working. it show error in log as. -[CCFileUtils fullPathForFilename:contentScale:] : cocos2d: Warning:

Using applicationDidBecomeActive makes app lag and slow after awakening it

断了今生、忘了曾经 提交于 2019-12-11 18:25:40
问题 NOTE: This only happens when I use cocos2d and spritebuilder. I tried the same exact code with just a single view app which worked fine. When using applicationDidBecomeActive to send an NSLog, the app becomes laggy and slow upon being reopened. This is an extremely simple app so it does not have to do with intensive graphics or processes. MainScene.m #import "MainScene.h" @implementation MainScene int score; -(void)digButton { score++; scoreLabel.string = [NSString stringWithFormat:@"%i",