Techbirds | Knowledge Hub | Page 9
ArrayList: ArrayList is a basic implementation of List interface in Collection framework.It extends AbstractList. ArrayList supports dynamic array that can grow as needed. Some of the important methods in ArrayList are void add(int index,Object element):add the element at the specified index. void add(Object element): Add the element at the end of the list. void clear(): clears
Read More →
746 total views, no views today
I always try to bring some thing new and useful on this blog. This time we will understand the Void.class (which in itself looks something tricky) present in rt.jar.One can consider the java.lang.Void class as a wrapper for the keyword void.Some developers draw the analogy with the primitive data types int, long, short and byte
Read More →
1,077 total views, no views today
Hi friends. In this tutorial we will learn how to drag a sprite in cocos2d-x Step 1 Create a new project and delete everything in init() function of HelloWorldScene.cpp Step 2 In your HelloWorldScene.h write #include “cocos2d.h” using namespace cocos2d;
class HelloWorld : public cocos2d::CCLayer { CCSprite *ball; CCPoint touchOffset; int tag; public: virtual bool init(); static cocos2d::CCScene* scene(); CCPoint touchToPoint(CCTouch* touch); // Returns true if the touch is within the boundary of our sprite bool isTouchingSprite(CCTouch* touch); //using touch functions void ccTouchesBegan(CCSet* touches, CCEvent* event); void ccTouchesMoved(CCSet* touches, CCEvent* event); void ccTouchesEnded(CCSet* touches, CCEvent* event); CREATE_FUNC(HelloWorld); };
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
class HelloWorld : public cocos2d::CCLayer { CCSprite *ball; CCPoint touchOffset; int tag; public: virtual bool init(); static cocos2d::CCScene* scene(); CCPoint touchToPoint(CCTouch* touch); // Returns true if the touch is within the boundary of our sprite bool isTouchingSprite(CCTouch* touch); //using touch functions void ccTouchesBegan(CCSet* touches, CCEvent* event); void ccTouchesMoved(CCSet* touches, CCEvent* event); void ccTouchesEnded(CCSet* touches, CCEvent* event); CREATE_FUNC(HelloWorld); }; |
Step 3 Write the following code in your init function and add any sprite
Read More →
5,319 total views, no views today
Hi All, There is some flow with Grouped Table view with iOS7 like adding extra padding space. Specially this problem come with iPad. As you can see in above image with marked box with extra padding in group table. By using below code we can remove extra padding as follows :- tableObject.contentInset = UIEdgeInsetsMake(-30, 0,
Read More →
4,551 total views, no views today
apple-mobile-web-app-capable:- ………………………………. Sets whether a web application runs in full-screen mode. syntex:- Discussion If content is set to yes, the web application runs in full-screen mode; otherwise, it does not. The default behavior is to use Safari to display web content. You can determine whether a webpage is displayed in full-screen mode using the window.navigator.standalone
Read More →
503 total views, no views today