How to add infinite backgrounds in Cocos2D, iphone?

By | December 24, 2010

You often may need scrolling backgrounds in your game or any other application. The following code helps you to add continuous backgrounds. Each sprite is added to the right of the current sprite which make them continuos. //Add more stripes, flip them, and position them next to their neighbour stripe. for (int i = 0; i < numStripes;… Read More »

admin

How to dynamically change image in a sprite in cocos2D iphone?

By | December 24, 2010

//Dynamically change the sprite image…… //my_sprite is a CCSprite already initialized with spriteWithFile. [[CCTextureCache sharedTextureCache] removeTexture:[self.my_sprite texture]; CCTexture2D *tex = [[CCTextureCache sharedTextureCache] addImage:@”new_image.jpg”]; [my_sprite setTexture:tex];

admin

How to use CCRibbon in Cocos2D in iphone?

By | December 23, 2010

The CCRibbon class, together with touch input, can be used to create the line-drawing effects of popular games. Note: you can’t remove individual points from a CCRibbon. You can only remove the whole CCRibbon by removing it as child from its parent.

admin

How to use CCBitmapFontAtlas in iPhone cocos2D?

By | December 23, 2010

CCBitmapFontAtlas faster than CCLabel. Labels that update fast at the expense of more memory usage, like any other CCSprite,is the specialty of the CCBitmapFontAtlas class //Usage… CCBitmapFontAtlas scoreLabel = [CCBitmapFontAtlas bitmapFontAtlasWithString:@”0″ fntFile:@”bitmapfont.fnt”];

admin

Working with files in Objective C

By | December 22, 2010

Basic file operations Assumes the existence of a file called “testfile” in the current working directory #import #import #import #import #import int main (int argc, char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSString *fName = @”testfile”; NSFileManager *fm; NSDictionary *attr; // Need to create an instance of the file manager fm = [NSFileManager defaultManager]; //… Read More »

admin

How to use picker in iphone, A simple example.

By | December 20, 2010

#import “ViewController.h” @implementation ViewController @synthesize mlabel; – (void)viewDidLoad { [super viewDidLoad]; arrayNo = [[NSMutableArray alloc] init]; [arrayNo addObject:@” Hello “]; [arrayNo addObject:@” Hai “]; [arrayNo addObject:@” Picker “]; [arrayNo addObject:@” Simple “]; [arrayNo addObject:@” example “]; [pickerView selectRow:1 inComponent:0 animated:NO]; mlabel.text= [arrayNo objectAtIndex:[pickerView selectedRowInComponent:0]]; } – (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView; { return 1; } – (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {… Read More »

admin

Minimise all windows Shortcut in Windows.

By | December 19, 2010

Hold the windows key and press M. This will minimise all windows in one key press! This is the same as pressing the ‘Show Desktop’ icon but without having to click on it. It should be noted that Windows key + D also works for this!

admin

PC Optimization – Clearing Temp files from your PC

By | December 19, 2010

The temp folder found in C:WindowsTemp often contains files that have no reason to exist any longer. You can use the ‘Disk Cleanup Wizard’ that comes with windows to sort out your temp folder by clicking on the Start menu -> Programs -> Accessories -> System Tools -> Disk Cleanup. Select the drive you wish to clean (usually… Read More »

admin

Reset Windows XP password

By | December 19, 2010

— First thing you need to do is to start command prompt or CMD. There is two ways: Press F8 when Windows XP start up (before windows xp logo – progress bar for loading) and choose “Save Mode Command prompt” option If you are logged in: click on start -> Run, type “cmd” and press ENTER. — In… Read More »

admin

what is XPath?

By | October 5, 2010

XSLT uses XPath to find information in an XML document. XPath is used to navigate through elements and attributes in XML documents.

admin

what is the difference between CSS and XSL?

By | October 5, 2010

CSS = Style Sheets for HTML HTML uses predefined tags, and the meaning of each tag is well understood. The table tag in HTML defines a table – and a browser knows how to display it. XSL = Style Sheets for XML XML does not use predefined tags (we can use any tag-names we like), and therefore the… Read More »

admin

what is E4X Simply?

By | October 5, 2010

E4X = JavaScript for XML E4X means “ECMAScript For XML”. It is a standard extension to ECMAScript. So in real life E4X means “JavaScript for XML”.

admin

Custom Toasts in ANDROID.

By | October 5, 2010

First, just show an image inside a toast: This method just displays a text toast: And this method displays a Toast that contains both an image and text:

admin

Get my Telephone number in ANDROID

By | October 5, 2010

Gets the phone number the app is running on. It needs a permission so add the line uses-permission android:name=”android.permission.READ_PHONE_STATE” to the manifest.xml

admin

How to send an SMS from an android application?

By | October 4, 2010

It’s easy to send Messages using the SmsManager in android. Check some of the examples relating to working with SMS’s in android. 1. How to simulate an incoming call to an emulator OR Send an SMS to an emulator in ANDROID ? 2. Listening incoming sms message in Android. 3. How to get notified during an incoming call… Read More »

admin

Play Video using VideoView in ANDROID.

By | September 19, 2010

Playing a video file is simple in android. This post will help you. Put your video in res/raw folder. If no raw folder present then create a new folder inside res. The main. xml file. Please leave your comments if this post was useful.

admin