Does someone know how to do complex animations in Android Stuido such as Select-Seats-Payment Animation?
I know there is Open GL for creating Spirtes and so on but do you actually do this kind of complex animations with Open Gl? And also wouldn't that be laggy?
Any hints would be very appreciated! Thanks in advance!
I guess you want to create the flight zoom and rotate animation.You don't need to go to OpenGl level. You just need to learn canvas. All the seats and the flight itself is simply plain design. So no need for bitmaps/images to create them. Create all seats by drawing them and treat them as like separate objects and give them their own properties like click listeners(Clicks should be handled by onTouch() function of the customView). But it takes lots of practice in canvas API of Android.
Related
I m trying to track after the screen rendering in Android for move a simple Object on screen but with no luck.
For Example: The background and the bars in flappy bird game, How does they "move" and the bird is flying like?!
I m trying to avoid from using OpenGL.
Any tutorial? Any Tip/Trick?
In iOS it's super simple, In android is it the same?
Thanks in advance!
If you are trying to build a game (especialy if you build it for android and IOS) and need to use some tweening go and use platform such as
Corona:
http://coronalabs.com/products/corona-sdk/
Unity:
http://unity3d.com/
you could use openGL but this is a lot of power for some little app...
if you just want animations you could try to use the android animations:
http://developer.android.com/training/animation/index.html
also a nice tutorial for animations and tweening:
http://code.tutsplus.com/tutorials/android-sdk-creating-a-simple-tween-animation--mobile-14898
or extend the view class and override onDraw, this way you could draw stuff on a canvas and even create your own animations by calling invalidate() again.
all depend on your needs.
I'm making a board for Android. I use .png images for the board (background) and checker pieces. Basically, it's a game where the graphics are updated upon touch events. It's a school-assignment so I have to use View implementations. For the graphics I've considered two options:
Making a whole "BoardView" class (that extends View) and draw all the graphic components directly on the canvas using onDraw(canvas).
Using ImageView objects to represent each checker piece and the board and putting them on a Layout.
My intuition tells me to use the first method. But my thoughts are that I want to use the pre-implemented TranslateAnimation when a checker is moved. From my understandings; this forces me to use the second method, since I can't animate a Drawable.
Now, to the question: what method is best for me? And if the second; which Layout is preferred to use? I want to be able to overlap the checkers over the board image and compare the ImageView objects' positions to each other to determine where to put the checkers on the board.
Regarding to your simple requirement, I think you can adopt method 2.
Trust me, I have done this kind of stuff years ago, on a legacy linux platform. For these kind of simple game applications, you really do not need to bother with all the frame drawing stuff. Just stick with the existing UI widgets.
This is because the visible elements are all very simple, like cards, static images, blocks etc. You don't need to perform pixel drawing. I have tried to make tetris, mine sweep, and card match games. I even create simple visual effects for it using existing animation facility. That is very easy to do so.
And, of cause, as a software programmer, to write a game using the typical frame by frame approach is much more professional. But it depends on the requirements. Why not using less code to create more value?
Im experienced iOS dev but new to Android dev and asking some newbie questions here...
I have to make a app where I have a background image and I then place some other images on top of that, and also onto those images I have to place different "glow" images that flicker (opacity on/off), and I need good control on positioning all those images. Now there is not some high performance goal here, and its not many objects, its not really a game.
What is the best approach for this? Can I use ImageView's for this or will it be better to use a Surface and custom draw in a thread?
And please, what ever you suggest, can you give a link to a good tutorial on the approach (ImageView or custom draw), I need all the help I can on this project with its crazy deadline.
Thank you
Søren
In my experience:
if its mostly static you should stick to XML and stuff like ImageViews etc
if its simple animations, the predefined android classes are fine and somewhat easy to use
if you want real custom then drawing with canvas is the way to go
You can extend View and override the onDraw method or create a SurfaceView which has better performance but is not that easy to use.
(sorry i dont have any tutorial links)
The background of my game is going to be scrolling. Instead of making it scroll by moving all the objects in relation to my main character, I want to just move the camera to follow him.
I could do that with g.translate(x,y) in java but what is the equivalent in Android?
Also, if you want let me know your thoughts about if moving the camera is the best choice. Why does everyone just make the background move, and not the camera?
Thanks!
I could do that with g.translate(x,y) in java but not sure how in Android.
The equivalent would be c.translate(xPos,yPos), where c is of type Canvas.
Also, if you want let me know your thoughts about if moving the camera is the best choice. Why does everyone just make the background move, and not the camera?
Probably because they are unaware they can apply matrix transformations to drawing operations.
I'm trying to create a simple Pegs game. I have drawn the 15-hole board using canvas. I have been programming a while, but games are new to me and I'm stuck on what to do when it comes to handling the pegs. I want to only use the touch screen, but it seems like it is really difficult to touch the pegs and actually select them individually. I plan on just drawing everything programmatically. What is best way on handling this? Using buttons as place holders and changing the button image? Any help would be greatly appreciated.
To be very brief, you have to keep track of the things you draw on the canvas.
I wrote some tutorials for making and moving selectable shapes on the canvas. They should help a lot.
On android it might be a little different than using mousedown, but it should give you a very good starting place.
I don't know if this will help, but you might want to write your own onTouch()function. Check it out