I am working on project and i need to connect MYSQL database. I am success to connect SQLite in my project ( using cocos2d).But i can not connect MYSQL database in my project.
I any one do like this than help me for how to connect . Give me the necessary information.
...
Hi all, I'm trying to get to grips with Cocos2d by trying to accomplish simple things. At this point, I have a scene, that scene has a background sprite, and a Layer. I'm trying to draw onto the Layer uding drawLine. Here's by current attempt.
@implementation MyLayer
-(id)init{
self = [super init];
if(self != nil){
glColor...
Hi,all, me again with another noob Cocos2d iphone question.
I've set my Director to Landscape, but when I was looking at the coordinates of the 'Touch Event' it was still picking them up as though the screen was portrait. So they were basically reversed.
x = 100, y = 50
should have been
x = 50, y = 100
No biggie, it was easily ...
Can anyone please suggest me some links for using textField in cocos2d.
I want to press on label, then textfield should get selected and i need to edit on that textfield.
Please help me on this
...
I have a class called GameScene, with is a subclass of a cocos2d Scene.
In there I have two layers. GameLayer and ControlsLayer. You can probably tell already that I want the ControlsLayer to move stuff around in the GameLayer. To be precise, I'm trying to control a cPBody in the GameLayer from the ControlsLayer.
At the moment, I'm t...
I'm trying to learn Objective C & Cocoa, but I just can't manage to access a property inside an Object. Specifically an object from a C method. I'm working with the chipmunk dynamics library.
Chipmunk has something similar to NSPoint called cpVect. Now I have no problem defining a cpVect inside my object, but when I try to make the acc...
I am trying to add a variable amount of MenuItem objects to a Menu object on runtime. When my game starts I don't really know if my menu is having 2 or for example 5 items.
for (MyItem* item in myItemCollection)
{
MenuItemImage* menuItem = [MenuItemImage itemFromNormalImage:@"MenuItem.png" selectedImage:@"MenuItemSelected.png" targ...
Hopefully, this question isn't a dumb as I fear it sounds, but it may still be pretty dumb.
I'm new to Objective-C, and Cocoa. In fact, I'm completely new to C in general. I'm trying to implement an iPhone game using Cocos2d-iPhone. It's a game I've made before in Flash, so I thought it would be a nice way to lean Objective C, cocoa an...
I want to invisible some text which is show by leble.I can invisible using this ( leblename.visible = NO; ).But some time it's create problem when i call different screen.I need different way for invisible leble text which is not create this type of problem.
...
Hi All,
I am having a problem in placing data(textField text) from one scene to another scene.
I'm attaching my source code with this mail.
Please help me if anything wrong in my code.
//
// PlayerSettingsAppDelegate.m
// PlayerSettings
//
//
//
#import "PlayerSettingsAppDelegate.h"
#import "TestScene.h"
NSString *result;
...
Hi All,
I am trying to the restart the same level of the game once it is completed. I am using alert view to display at the time of Finish.
I'm using 2 buttons in AlertView (End and PlayAgain). Once end is touched it should end that is working fine. The problem is once playAgain is touched
The AlertView is displayed once again but...
I am trying to create a cool score counter in my iPhone game, where I created the digits 0 to 9 in photoshop and I want to update the score every second.
What I am doing now is the following:
In my init I load all the digit sprites into an array, so that the array has 10 items.
I created a method which breaks down the current score (e...
How would one go about creating a custom action in Cocos2D that was able to perform a 'callback' over time, making each call to the callback progressively longer than the last call to it (using something similar to the EaseExponentialOut action already provided with Cocos2D.
Something similar to this: (which does not work)
id sequence ...
I'm using the cocos2d framework for various of my applications, and have run into the following problem. I have set up a few sequences of actions and CallFuncNDs, the actions have durations set up and when I run it in the iPhone simulator, it works just like I expect it to: transitions take the amount of time I set them to and they go in...
I am trying to solve a tricky math problem, in a cocos2d for iphone context.
Basically I have a roullette wheel which is rotating over time.
I want to have a Sprite latch onto the wheel at certain points (like compass ordinal points N, S, E, W) and bounce off at all other points.
I have the image of the wheel rotating, and just need t...
Is there a way in cocos2d 0.7.1 to specify the text alignment in a LabelAtlas?
I'm using a LabelAtlas for a score (displayed in the upper right corner) but when the score goes above 10, the second digit is cut off.
I can implement code to detect that and move the LabelAtlas, but is there a way to have cocos2d do it for me?
Thanks.
...
Is it possible to change just a portion of a Sprite's alpha in response to user interaction? A good example of what I mean is iFog or iSteam, where the user can wipe "steam" off the iPhone's screen. Swapping images out wouldn't be feasible due to the sheer number of possibilities where the user could touch and move...
For example, say ...
I'm running this sample code located here:
http://monoclestudios.com/cocos2d_whitepaper.html
using cocos 2d-iphone 0.7.2, and the sprites are being drawn coloured blue. But this is only happening on the simulator. On an actual device, everything looks fine.
Has anyone else run into this problem?
...
In cocos2d does anyone know how to center a sprite? Right now, I have a sprite that moves to where you touch on the screen. The problem is that the sprite is aligned to the lower left corner. This means that instead of moving down, if you touch just a little over the bottom the sprite will move up. Thanks in advance!
Here is my code...
...
In cocos2d how would you detect a touch on an image? I'm having a lot of trouble with this so thanks in advance!
...