iphone,cocos2d-iphone,cocos2d,spriteRelated issues-Collection of common programming errors
Götze
iphone ios xcode git osx
I am setting up one git client on Mac (Using Source Tree). While committing the code it is showing the following error(please check the screen-shot). Any idea to solve this error ?ERROR :
hjon
iphone core-location
Is kCLErrorNetwork “fatal”, i.e. can location still be acquired or should we tell Core Location to stop updating the location?In iOS 3.0, Core Location added an error code, kCLErrorNetwork. It is described as a “general, network-related error”. Does this mean that neither the cell network nor Wi-Fi is available and Core Location can only use GPS? Or something else?
Giffyguy
iphone
how to handle error in an iphone app ? log and exit ? show an alert dialog and exit ? for exemple, if an image is missing from the bundle..even though it should not …
kiran
iphone ipad
/Desktop/aug_9/iOSSample/iOSSample/test.m:11:10: fatal error: ‘nDCAPI.h’ file not found #include <nDCAPI.h>^ 1 error generated.I got this error even i include the file in my project Right click on project and add file to project and selected the file and selected Destination and folders i create folder references for any added folders.for adding the file into the project! I got this error /Desktop/aug_9/iOSSample/iOSSample/test.m:11:10: fatal error: ‘nDCAPI.h’ file not found#include ^1 er
Udi I
iphone monotouch xamarin
I am trying to understand the reason my app crashes, randomly it seems, when trying to present a view. The button click code:if ( d.rootNavigationController.RespondsToSelector(new MonoTouch.ObjCRuntime.Selector(“presentViewController:animated:completion:”))){d.rootNavigationController.PresentViewController(childBroswer, true,null);}else{d.rootNavigationController.PresentModalViewController(childBroswer, true);}This is the stack trace:at MonoTouch.UIKit.UIApplication.Main (string[],string,string)
PeeHaa
iphone fatal-error
Ok, I only made a minor change to a project of mine in Xcode (I just added a new .h, .m, and .xib file, they’re very small), and now it won’t run and gives me this message:”fatal error: error writing to -: Broken pipe”WTF? So I removed all the changes and tried to run it again and it STILL gives me the error, what’s the deal?
Elisabeth
javascript iphone ipad orientation
I’m having the same problem that a couple of others have had with getting the correct behavior in a web app on an orientation change, and there doesn’t seem to be an obvious solution – I’ve seen this question asked a couple of times on Stack Overflow and no one’s yet been able to answer it.When I start the app in portrait mode, it works fine. Then I rotate into landscape and it’s scaled up. To get it to scale correctly for the landscape mode I have to double tap on something twice, first to zoo
Shekhar Gupta
iphone xcode terminal
Is there some way by which I can use Xcode only to organise my code and not display errors at the time of compilation? I want that the error messages and the output get displayed in the Terminal instead. I am a college student and am learning how to program in C. I really want the error messages to be displayed in the Terminal, as they are shown there in a fairly cryptic manner, instead of the user friendly manner which is there is in Xcode.
soshiki
c# iphone mono monotouch monodevelop
I have a project set up in MonoDevelop, it compiles and runs fine for the simulator but when I try to target a device I get a compile error saying:Error 1: mtouch failed with no output (1) (ChicksnVixens-MonoTouch)And this is the last bunch of stuff the build output has (paste bin: http://pastebin.com/Ea8hgaFH):Compiling to native code /Developer/MonoTouch/usr/bin/mtouch -v–nomanifest –nosign -dev”/Users/dev/Documents/Proj/cnv/MyCode/ChicksnVixens/bin/iPhone/Debug/ChicksnVixens-MonoTouch.app””
Darren Reely
iphone cocoa cocoa-touch avfoundation
First time asking a question here. I’m hoping the post is clear and sample code is formatted correctly.I’m experimenting with AVFoundation and time lapse photography.My intent is to grab every Nth frame from the video camera of an iOS device (my iPod touch, version 4) and write each of those frames out to a file to create a timelapse. I’m using AVCaptureVideoDataOutput, AVAssetWriter and AVAssetWriterInput.The problem is, if I use the CMSampleBufferRef passed to captureOutput:idOutputSampleBuffe
user1118321
objective-c cocos2d-iphone
What does this error mean ? Following is my code. But I don’t see anything wrong -(id) init {if( (self=[super init] )) {CGSize winSize = [[CCDirector sharedDirector] winSize];CCSprite *player = [CCSprite spriteWithFile:@”Player.png” rect:CGRectMake(0, 0, 27, 40)];player.position = ccp(player.contentSize.width/2, winSize.height/2);[self addChild:player]; }if( (self=[super initWithColor:ccc4(255,255,255,255)] )) {}return self; }
Waneck
iphone ios opengl-es cocos2d-iphone antialiasing
I am new to opengl programming, but I am doing something very basic, and the difference of quality between a custom opengl code and cocos2d is huge!I am trying just to load an image and continuously rotate it every frame. With my code, I get a lot of flickering, sharp edges, while cocos2d has it all nice and smooth. I’ve set up 4x Multi-Sampling Anti-Aliasing using apple’s recommended code for iOs 4 on my code, and still it looks very bad in comparison to cocos2d without any MSAA.You can see the
LearnCocos2D
cocos2d-iphone callback game-physics chipmunk cocos2d-iphone-3.0
I’m using Cocos2d v3 and want to change a body from dynamic to static after colliding with another body. At the moment I’ve got:-(void)ccPhysicsCollisionPostSolve:(CCPhysicsCollisionPair *)pair static:(CCNode *)nodeA wildcard:(CCNode *)nodeB {_player.physicsBody.type = CCPhysicsBodyTypeStatic; }or-(BOOL)ccPhysicsCollisionPreSolve:(CCPhysicsCollisionPair *)pair static:(CCNode *)nodeA wildcard:(CCNode *)nodeB {_player.physicsBody.type = CCPhysicsBodyTypeStatic;return YES; }but neither works. I get
Guru
objective-c cocos2d-iphone core-audio simpleaudioengine
I read about preloading sounds in SimpleAudioEngine through [[SimpleAudioEngine sharedEngine] preloadEffect:@”bell.wav”];But, with this there are memory leaks which I read on couple of sites. On some websites it was used like this: –(void)loadSoundFilesInBackground {NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];[[SimpleAudioEngine sharedEngine] preloadEffect:@”bell.wav”];[pool release]; }What is the best way to load sound files in background through SimpleAudioEngine ? What is the
Tiddly
iphone ios cocos2d-iphone cocos2d
I’m using cocos2d for iOS. Not sure if I’m doing something wrong here or if CCParallaxNode does something strange that I just don’t understand.I’m trying to create a few layers of parallax scrolling in the background of my game, at the moment I just have one layer added to the parallax node till I can figure out what’s going wrong. When the game loads the layer it’s always offset down and left by about 30% of the image size. I’ve uploaded an image demonstrating the difference in position here ht
kender
iphone cocoa-touch memory-management cocos2d-iphone
I have an iPhone application in Cocos2d that sometimes crashes on actual device, due to memory problems. What I have so far found out is that the scenes, when switched, aren’t fully released – the [retainCount] for them is somewhat about 4-10 🙂 The dealloc method never gets called, and then I assume, when I switch the scenes a few times, the memory issue shows up. I’m wondering – where should I relese the scene? Since it has number of children, I suppose I should be doing a cleanup-removal of t
LearnCocos2D
cocos2d-iphone uialertview
I am trying to lay buttons on top of a background image for a UIAlertView in Cocos2d. Its not working with the code below. any suggestions?UIAlertView *Win=[[UIAlertView alloc] initWithTitle:@”You Win” message:nil delegate:self cancelButtonTitle:@”Next” otherButtonTitles:@”Replay”,@”Quit”, nil];UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(-50, -30, 400, 300)];NSString *path = [[NSString alloc] initWithString:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathCom
White Money
iphone cocos2d cocos2d-iphone
I’m wonderring that what’s the difference between ccTouchesCancelled and ccTouchesEnded events in Cocos2d?Thanks! Tien
OpenLearner
cocos2d-iphone cocos2d
I have a simple CCRotateBy action in a sequence; it is followed by a call to another method which confirms that the CCRotateBy completed (otherwise, that CCCallFunc would not get called in the sequence if CCRotateBy didn’t complete):-(void)correctRotation{if (self.rotationAmount){CCLOG(@”correcting rotation inside: %i”,self.buildNum);CCRotateBy*second=[CCRotateBy actionWithDuration:1 angle:-self.rotationAmount];CCEaseBackInOut*bounce2=[CCEaseBackInOut actionWithAction:second];CCCallFunc*func=[CC
25 revs, 2 users 100%Lukasz
iphone cocos2d-iphone opengl-es-2.0 alpha blending
I have very simple CCScene with ONLY 1 CCLayer containing:CCSprite for background with standard blending mode CCRenderTexture to draw paint brushes, with its sprite attached to root CCLayer above background sprite:_bgSprite = [CCSprite spriteWithFile:backgroundPath]; _renderTexture = [CCRenderTexture renderTextureWithWidth:self.contentSize.width height:self.contentSize.height]; [_renderTexture.sprite setBlendFunc:(ccBlendFunc){GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}]; [self addChild:_bgSprite z:-1
Ricardo Cerqueira
ios xcode crash cocos2d adhoc
my app runs fine on development mode, but for some reason on ad hoc i get a crash right after loading screen.I really can’t understand what could be wrong, any tips on how to test it better?Apple rejected it with this message:We found that your app failed to launch on an iPhone 5 and iPad 3rd gen running iOS 6.1.3, on both Wi-Fi and cellular networks.We encountered the issue when selecting the application on the Home screen – the app displayed a launch image then quit unexpectedly. This may be b
Clever
ios objective-c cocos2d
How would you go about protecting a shared resources in cocos2d so that only one class or method is allowed to access or change it at one time? My initial though was to setup a class that handles Lock / Unlock coordination as follows: – (BOOL)requestLock {if (self.lockAvailable == YES) {self.lockAvailable = NO;return YES;}return NO; }- (void)returnLock:(CGFloat)time {self.timer = 0;self.timeToUnlock = time; }- (void)update:(CGFloat)dt {self.timer += dt;if (self.timer > self.timeToUnlock) {sel
Tiddly
iphone ios cocos2d-iphone cocos2d
I’m using cocos2d for iOS. Not sure if I’m doing something wrong here or if CCParallaxNode does something strange that I just don’t understand.I’m trying to create a few layers of parallax scrolling in the background of my game, at the moment I just have one layer added to the parallax node till I can figure out what’s going wrong. When the game loads the layer it’s always offset down and left by about 30% of the image size. I’ve uploaded an image demonstrating the difference in position here ht
Paul Renton
objective-c data-structures cocos2d
Some Context: In my destructible terrain library for Cocos2D, one of the features is collapsable terrain. In order to collapse efficiently, I store the columns whose pixels have been altered in a NSMutableSet which contains NSNumbers which contain integers. I am using this data structure because I don’t want to iterate over duplicate columns.My first instinct for how to loop through the NSMutableSet was to use a ‘for in’ loop.for (NSNumber * col in [alteredColumns allObjects]) { // Works // for
White Money
iphone cocos2d cocos2d-iphone
I’m wonderring that what’s the difference between ccTouchesCancelled and ccTouchesEnded events in Cocos2d?Thanks! Tien
OpenLearner
cocos2d-iphone cocos2d
I have a simple CCRotateBy action in a sequence; it is followed by a call to another method which confirms that the CCRotateBy completed (otherwise, that CCCallFunc would not get called in the sequence if CCRotateBy didn’t complete):-(void)correctRotation{if (self.rotationAmount){CCLOG(@”correcting rotation inside: %i”,self.buildNum);CCRotateBy*second=[CCRotateBy actionWithDuration:1 angle:-self.rotationAmount];CCEaseBackInOut*bounce2=[CCEaseBackInOut actionWithAction:second];CCCallFunc*func=[CC
redux
cocos2d
I can’t get my head around what’s going on here and I know I’m being stupid, but here’s whats going on:I have two images, one is 1024×768, one is 2048×1536. They are “background” textures. I’m trying to switch from one texture to the other:CCSprite *bg = [CCSprite spriteWithFile:@”one.jpg”]; bg.scale = 0.5; [self addChild:bg]; … CCTexture2D* tex = [[CCTextureCache sharedTextureCache] addImage:two.jpg]; [bg setTexture: tex];OK this is totally normal, the 2nd image fits perfectly into the same
Precursor
iphone c++ objective-c xcode cocos2d
I use the following code to initialize an objectCCSprite *gridp = [CCSprite spriteWithFile:@”grid.png” rect:CGRectMake(0, 0, 60, 60)]; gridp.position = ccp(x, y);My question is, after I add the object and after the functions return, how can I delete the sprite? I was guessing there would be a get by CGPoint, but I haven’t found anything like that. I cannot store references to all of the objects since the game generates a few hundred of these at runtime.
MountainRock
grid cocos2d cocos2d-iphone tile
Hello guysI have a small problem while designing a iphone game with a grid using cocos2d. The game needs a 10×10 grid in the middle of the screen (it is not covering the entire screen). A line is drawn at runtime where the user touches two points in the grid. Question: would tilemap be ideal for this problem? As i need to verify the co-ordinates do belong to the grid or not when the user touches a point would tilemap be useful?Question: Is there any better way of solving this in cocos2d. Pleas
L_?o_??n_??g_??p_?o_??k_??e_??
iphone cocos2d order cocos2d-iphone
I am working on a game with many sprites in a layer, and once you touch the sprite, it will do something.my problem is the z order issue, most of my sprites are overlapping and when you touch the overlapping sprites, the one behind(i think with the lowest z order) react instead of the one in front.I need to understand more on the z order for cocos2d.how do I change the z order at runtime?thanks!
Marius Ndini
performance sprite corona
General Corona SDK question, what would get better performance having a runtime event listener on enterFrame or a sprite sheet. So essentially what i have is:local function animate(e)star.rotation = star.rotation +3; end Runtime:addEventListener (“enterFrame”, animate); return star;Would this get better performance than having a sprite sheet that has the automation on loop. Both essentially go in a loop indefinitely (or until an action happens).
Ruud Lenders
c# xna drawing 2d sprite
What is an efficient way to draw sprites in my 2D XNA game? To be more concrete, I have split this question up into 4 questions.I used to declare Game1’s spriteBatch static, and called SpriteBatch.Begin and .Close in every IDrawable.Draw. That didn’t work well. Giving each drawable it’s own SpriteBatch also didn’t work well.Q1: I assume it’s best to have one SpriteBatch instance, and only call begin/close once. Is this correct?Currently, my Game1.Draw looks something like this:spriteBatch.Begin(
user2052855
java sprite bufferedimage
I want to store RGB values in a pixel array like so:pixels = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();where image is:BufferedImage image = new BufferedImage(100,100,BufferedImage.TYPE_INT_RGB);I read the file using ImageIO and it read fine, it’s this part that’s the problem. Here’s the error:Exception in thread “main” java.lang.ClassCastException: java.awt.image.DataBufferByte cannot be cast to java.awt.image.DataBufferInt at SpritePractice.render(SpritePractice.java:114) at
Chanakya
iphone android opengl-es 2d sprite
I am writing a 2d game on the android and I am targeting phones with that have a minimum OpenGl ES 1.1 support.I am currently looking at creating my animated sprite class which is basically a quad that has a changing texture on it to provide animation.I wanted to stick to Opengl 1.1 so am avoiding shaders and was wondering how other people have approached the implementation of animated sprites. My thoughts initially were to either:Have a single vertex buffer object with one texture coordinate s
Oleksiyka
actionscript-3 flash sprite linkage
Just found it is possible to give a linkage in Flash Professional IDE for symbols that has Sprite class as parent. Previously I was sure the only option is MovieClip.The question is:How to make these symbols to play animation at runtime? When I put it on a stage in IDE I can extend parent’s timeline and use Loop or Play First propery to control the animation inside of a sprite. But if I instantiate that Sprite derived class at runtime I have no idea hot to animate it 🙁 There are no play() and I
Andy
actionscript-3 sprite shape fxg
I can import FXG files as Sprites as follows:import graphics.mypic; // graphics/mypic.fxg var mysprite:Sprite = new mypic();I don’t always need the fancy things that come with Sprites. How can I import them to Shapes?
Zanrkvil
c# sprite
I’m making a little game based on XNA game development’s tutorial game “shooter”… after a bit of trial and error, I made my own animated sprite that i can move around the screen. The problem is, he’s always facing right.How can i change this (image below) so that he faces the right direction every time the key event is pressed?!I’m pretty new to C# as you might have guessed, and I realize this may be more complicated than i thought, so i just need to know how to make the sprite face right when
TheDarkIn1978
flash actionscript-3 dynamic properties sprite
i’m pretty confused over the following issue and would be grateful for some clarity.generally, how i work involves designing all of my graphics in Flash Authoring, converting them to Sprite symbols by changing the base class to flash.display.Sprite, give my instances names and finally export them to ActionScript.the approach actually permits me to dynamically create properties in code on my Sprite instances that i’ve exported to ActionScript, just as if they were instances of MovieClips. i’m no
Tim Cooper
css asp.net-mvc image sprite
Hi im using the sprite framework http://aspnet.codeplex.com/releases/view/50140I have it working so that i can do things like:@Microsoft.Samples.Web.ImageSprite.Image(“~/App_Sprites/icons/calendar.png”)but how can i use the images within css files? eg#wrapper {width: 980px;margin: 0 auto;background: url(/App_Sprites/images/img01.gif) repeat-y left top; }
Steve
actionscript-3 cursor flex4 sprite bitmapdata
I want a custom cursor I can edit in the .mxml file. For the moment I got a static one with a class extends Sprite. Is for a SketchPad application, the cursor will be the color and the size of the user choice. Let me know if it possible and how.Here the class in a .as file :package project {import flash.display.Sprite;public class cursors extends Sprite{public function cursors(){this.graphics.lineStyle( 1 , 0x666666 , 1 );this.graphics.drawCircle( 0 , 0 , 5/2 );super();}} }Here the .mxml file co
Web site is in building