Skip to main content

Posts

Showing posts with the label Android

Pixel perfect mouse click on Images in Android Canvas

I was trying to build a sample for some image manipulation tool. The requirement was that the user should be able to pick an image that he pasted on the screen, move it around, scale and rotate it. The way we would do this using OpenGL is create a depth buffer use different depth value on each of the Quads' used to render the transparent image. So when you do a readPixel from the depth buffer you will get the z value of the sprite if it was under the touch. This is how we wold distinguish between two overlapping transparent images. The tracking of z value for different Quads is done automatically in OpenGL when you bind the depth buffer to the current frame buffer and start drawing stuff. Now this i know and have used for a while, but how does this work in the Android Canvas drawing world? Short answer: in the same way Long answer:  These are the steps you should follow to get it done: You have to create a separate Bitmap of the same size as your drawing area Set the ...

LoL-Wars Mobile

I've been working on lol-wars for the mobile for a couple of days now. The gameplay is pretty much the same as the original html5 version, but the experience is what i've been working on. The major problem with the html5 version was the use of firebase for handling the communication between the players and also to keep track of who is online. Frankly the code was all messed up and all over the place. I did however learnt how to use angular material and get familiar with the riot's developer api. For the mobile version i've tried doing it with unity, quickly realising that i was spending way too much time without much progress. I was trying to figure out the gameplay flow while trying to figure how it's done and eventually the project got sidelined. I still loved the idea but wasn't able to motivate myself to get it done in unity, so i thought to myself that getting the game done was more important to me than doing it in a particular tech. I needed this ga...

QuickDictionary

The Qt5.2.0 is adding support for android and i couldn't be more excited. After fiddling around with the basic Qt based stuff, i realized that the QtQuick is the way to go for making interfaces for the mobile devices. The tutorial video about getting started with QtQuick is a good start for getting acquainted with the QtQuick. The tutorial covers how to make scalable interfaces only the basic stuff though but it should be good enough to get you started. Here is the URL: http://qt-project.org/videos/watch/using-qt-quick-for-rapid-ui-prototyping-and-development With this as a starting point iv'e been able to create a dictionary app with just QtQuick framework. Well why a dictionary app? 1) I found a really cool minimalistic UI design 2) Had a couple of cool looking color schemes that i could pick 3) I didn't have to create an infinite scrolling list :D 4) Minimal requirements. With these i've started designing the application. Most of the tutorials claim th...

Qt on Android

It's been a while since ive' looked at Qt. I used it extensively during my masters project and pretty much every project that i worked on in the college. I even made a 2D top down game using OpenGL and Qt along with a couple of my friends as a course project. I even taught a class how to get started with Qt using PyQt. The most recent experience i've had with Qt was looking at PyQt being used for creating a DB access software at University of Groningen. It was written based on Qt3.0 and upgrading to Qt4.0 was causing all sorts of problem that is when i thought Qt probably lost it's way with all the Selling / Ownership transfer / Shift of focus on Platforms etc. Now saying that i love the power of Qt for creating GUI's is an understatement. The documentation and the examples provided made it so easy to pick up the Toolkit. I was worried they might have misstepped too much and lost control of how awesome it used to be. Recently i came across some article which...

ComicNext

With the advent of the ios/android/wp8 there has been a steady rise in the digital comics market. A very immersive experience with audio / animations and some times even gameplay. This takes the already fun experience of reading comic books to a whole new level. Imagine the your favorite comics coming to life at least partially, with audio and animation effects. This idea has fascinated me and i decided to spend some time trying to figure out how best to do it. Here are some of the goals that i wanted to achieve for this: 1) Ease of creating content 2) Ensure that only the data changes for putting out a new comic. 3) Be Cross Platform Enter ComicNext  A new framework that will make creating digitial interactive comics for mobile phones / tablets very easy. We were able to create a quick prototype of how a comic book would look, you can try it out yourself HERE .  This is obviously in beginning stages and will take time to be widely available but, If you ar...

Unity Plugin Android(Part2)

In my last post iv'e covered about how to write a plugin without actually over-riding the unity activities so you can peacefully co-exist with other unity plugins (for android). The reality is that you will have to deal with people using Prime31 as one of their plugins. This can be a problem if you need to get callbacks for the android system event callbacks like: void onCreate(Bundle Intent){ } void onStart(){ } void onStop(){ } and so on. You get the idea. Fortunately the prime31 guys provide us a method for registering a class to get callbacks from these methods on the activity. The details of which are provided at the following url https://gist.github.com/prime31/0908e6100d7e228f1add/raw/a5d96177c8d8fde548068d2a15de49acdb2023ec/Android+Activity+Sharing This is pretty straight forward If you know how to use Android ADT/Eclipse for creating android projects. Here is how you go about it. 1) First create an Android Project. Mark it as a library project. 2) Add ...

Unity Plugin (Android)

I've been working on creating a plugin for unity(Android). The latest versions of unity (4.x) provide clean way of accessing the java side of things on android. If you want access to the android activity from android,  all you have to do is call the following.. AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject activity = unityPlayer.GetStatic ("currentActivity"); This doesn't give us much of a head way... i.e, if you want to add any functionality you will have to extend the UnityPlayerActivity and add the functions you want and call them. But there is a more elegant way of doing it. You can just create a jar file from your android library and access its' functionality like so.. AndroidJavaClass   _pluginClass = new AndroidJavaClass ( "com.vkgamedev.MyTestLib.MyTestLib" ); _pluginClass.CallStatic( "setGoogleProjectId" , googleProjectId); If your  libr...