Breaking News
Home / admin (page 30)

admin

How to hide the Cocos2D frame rate display?

Cocos2D displays the frame rate i.e. the number of frames per second in the bottom left corner of screen when the scene is rendered. This is a very useful piece of information for debugging purposesbecause it allows you to see the frame rate your game realtime as it runs. The …

Read More »

Some useful Box 2D macros

BOX2D has uses meters as a unit for length and width. However the objects need to be draw on screen in pixel sizes. The following macros helps with those conversions. #define PTM_RATIO 40.0f #define SCREEN_TO_WORLD(n) ((n) / PTM_RATIO) #define WORLD_TO_SCREEN(n) ((n) * PTM_RATIO) #define B2_ANGLE_TO_COCOS_ROTATION(n) (-1 * CC_RADIANS_TO_DEGREES(n)) #define COCOS_ROTATION_TO_B2_ANGLE(n) …

Read More »

How to find out SVN version?

Answer Simply run the svn client with the version argument and it would echo back the SVN client version. mymac:ios-apps mvohra$ svn –versionsvn, version 1.6.17 (r1128011)   compiled Nov  8 2011, 18:14:46 Copyright (C) 2000-2009 CollabNet.Subversion is open source software, see http://subversion.apache.org/This product includes software developed by CollabNet (http://www.Collab.Net/).<!

Read More »

How to compute SHA1 digest for NSString?

Computing SHA1 (Message Digest). The following is implemented as extension to NSString. // //  NSString+Hashing.h   #import <Foundation/Foundation.h>   @interface NSString (Hashing) – (NSString *)sha1; @end   // //  NSString+Hashing.m   #import "NSString+Hashing.h" #import <CommonCrypto/CommonDigest.h>   @implementation NSString (Hashing)   – (NSString *)sha1 {         NSData *data …

Read More »
Advertisment ad adsense adlogger