Hello everyone… Today I will show you how to create a simple widget in android? First create a new project and name it “Widget1” and name the activity “WidgetDemo1“. Actually we dont need the activity class here. You can delete it and delete the corresponding entry of it from the AndroidManifest file also. Now we… Read More »
You can create any type of views in android and you can provide any color you want as background. It can be a single color or any number of colors as you wish. Here is a simple example. First create an xml inside the res/drawable folder and name it blue_button.xml and copy this code into… Read More »
In android with shapes we can create beautiful layouts. Lets look at an example. Create an xml named “gradient.xml” in your drawable folder and copy this code into it. Now the main layout file main.xml The main java file. Done. You can now run the application.
Beautifying our applications is one of the main features of your application’s success. In ANDROID there are many possible ways to do this. For eg. We need to have different colors for our buttons, However we can give backgrounds for buttons and all. But we can do many by using our custom xml files, like… Read More »
By adding a custom shape we can make the layout more attractive. For this we have to create a xml file and specify this in the main layout xml file First make a xml inside the drawable folder. Then in the main file specify this shape like this. The “category” is the name of the… Read More »
write the below code in “ccTouchesBegan” function and you are done. Here the ballBody represents the bullet body. You can increase the power variable to increase bullet speed.
The below code helps you to rotate a body in Box2D manually. Here the body is named “rotating_body” which is going to rotate and a sprite named “rot_sprite” is it’s userData, please give your own image for it. Make sure that you have it in your resources otherwise your program will crash. Note: call this… Read More »