Archive for the ‘iPhone’ Category

31
Dec

Here is the list of some common iOS fonts available…

Family name: AppleGothic
Font name: AppleGothic
Family name: Hiragino Kaku Gothic ProN
Font name: HiraKakuProN-W6
Font name: HiraKakuProN-W3 More »

31
Dec

Steps
1.Find the fonts you want and download them.Following website has a good collection of Font

http://www.webpagepublicity.com/free-fonts-a2.html#FreeFonts

2.Add the font files to resources folder of your project.
3. Find the font’s name. Here as an example I use Newfont

4.Add the following your info.plist file:


UIAppFonts

    NewFont.ttf

5. To use the font name the way you would normally:

CCLabel* myLabel = [CCLabel labelWithString:@"Some Text" fontName:@"NewFont" fontSize:18];

31
Dec

The first step (if you haven’t done it before) is to go to adwhirl.com and sign up. Once you’re registered and logged in, you’re presented with a dashboard where you can register (and track) your applications.
The first step (if you haven’t done it before) is to go to adwhirl.com and sign up. Once you’re registered and logged in, you’re presented with a dashboard where you can register (and track) your applications. More »

, , , , , , , , , , , ,

31
Dec

• Open Mekanimo
• in left side , click System -> Box (Set width =15, Height =10)
• Create different Bodies Which can be select from right side
• Save the project ,then File -> Export -> Box2D
• In Box2d Project ,Copy body Def,Body Fixture,Bodies etc and paste in ‘init’ function

• This Should be pasted after creating world
• Replace (&shape); with (&shape,0);
• make the bodies dynamic
• and your project is ready…!!!

31
Dec
        b2Body* ground = NULL;
         ground = world->CreateBody(&bd);
         b2RevoluteJointDef revJointDef;
        b2Vec2 pos;

  //Revolute joints
        pos.Set(2.896859f, 2.296030f);
        revJointDef.Initialize(anyBody, ground, pos); //anyBody is a b2Body
        revJointDef.collideConnected = false;
        world->CreateJoint(&revJointDef);

, , , ,

31
Dec
        b2Body * standBlock1;
        CCSprite *standSprite;  // Add Some sprite…
        b2BodyDef bodyDef;
        b2Fixture * stndBlockFixture1;
        b2FixtureDef fd;
        bodyDef.type=b2_dynamicBody;
        b2Vec2 initVel;
        b2PolygonShape shape;

        bodyDef.position.Set(2.878201f, 9.974458f);
        bodyDef.angle = 0.649263f;
		bodyDef.userData = standSprite;
        standBlock1 = world->CreateBody(&bodyDef);
        initVel.Set(0.000000f, 0.000000f);
        standBlock1->SetLinearVelocity(initVel);
        standBlock1->SetAngularVelocity(0.000000f);

        b2Vec2 standBlock1_vertices[4];
        standBlock1_vertices[0].Set(-2.585715f*.8, -0.429164f);
        standBlock1_vertices[1].Set(2.585715f*.8, -0.429164f);
        standBlock1_vertices[2].Set(2.585715f*.8, 0.429164f);
        standBlock1_vertices[3].Set(-2.585715f*.8, 0.429164f);
        shape.Set(standBlock1_vertices, 4);
        fd.shape = &shape;
        fd.density = 0.15000f;
        fd.friction = 0.300000f;
        fd.restitution = 0.600000f;
        fd.filter.groupIndex = int16(0);
        fd.filter.categoryBits = uint16(65535);
        fd.filter.maskBits = uint16(65535);

		stndBlockFixture1= standBlock1->CreateFixture(&fd);

, , , , , , ,

31
Dec

b2Body *block;
if(block->IsAwake()0
{
//block is not in rest !!!!
}
else {
// block in rest !!!!
}

31
Dec

Schedule function creates an automatic callback to a function in the specified interval.

[self schedule:@selector(update:) interval:0.1];

In the above code ‘update’ is called every 0.1 seconds.

31
Dec
if ([[SimpleAudioEngine sharedEngine] mute]) {  // To check whether the sound is muted/

            [[SimpleAudioEngine sharedEngine] setMute:0]; // If sound is muted unmute the sound

      }

      else {

            [[SimpleAudioEngine sharedEngine] setMute:1];  // If sound is unmuted then mute the sound

      }

31
Dec
if(!YourBody->IsAwake)

{

CCLOG(@"body is idle");

}