Android game: Canvas or OpenGL?-ThrowExceptions

Exception or error: I am to write a game for Android, and I have to choose between Canvas or OpenGL for drawing. I have read that Canvas doesn´t have a good frame rate, but what is good? Imagine you were going to write an Angry Birds type game, would Canvas frame rate be enough? How …

android – Draw dash line on a Canvas-ThrowExceptions

Exception or error: How can i draw dash line on a canvas. I already tried this: Paint dashPaint = new Paint(); dashPaint.setARGB(255, 0, 0, 0); dashPaint.setStyle(Paint.Style.STROKE); dashPaint.setPathEffect(new DashPathEffect(new float[]{5, 10, 15, 20}, 0)); canvas.drawLine(0, canvas.getHeight() / 2, canvas.getWidth(), canvas.getHeight() / 2, dashPaint); And it gave me not dash line but a simple one. How to …

How to Draw TextView on Canvas in android..?-ThrowExceptions

Exception or error: How to Draw TextView on Canvas in android..? We have Canvas.DrawBitmap(), Canvas.drawText(). Do we have any Method in Canvas which takes TextView as a parameter or any other method to display TextView on Canvas? Actually, I have a alphabet in TextView and I have to make drawing on that alphabet which is …

java – Paint bordered text in a Canvas android-ThrowExceptions

Exception or error: I’d like to paint in a Canvas something like: How can I do the bordered effect? Thanks How to solve: Draw the text two times. First draw the text with a fill paint like so: Paint fillPaint = new Paint(); fillPaint.setColor(Color.MAGENTA); canvas.drawText(…. fillPaint); Then draw it again with a stroke like so: …

Scrolling a Canvas smoothly in Android-ThrowExceptions

Exception or error: I’m new to Android. I am drawing bitmaps, lines and shapes onto a Canvas inside the OnDraw(Canvas canvas) method of my view. I am looking for help on how to implement smooth scrolling in response to a drag by the user. I have searched but not found any tutorials to help me …