0

For programming sprites, as a rule, rather the four functions for draw on canvas:

  1. Draw the bitmap in the coordinates (X, Y)
  2. Rotate the bitmap around the point (X0, Y0) at the angle alpha
  3. Make transparent colorRGB = 0xXXXXXX in the bitmap (for non-squareness of the sprite)
  4. Transparency of the sprite as a percentage

I know how to program it in Windows, but how to do it in Android or Linux?

Sathyajith Bhat
  • 19,739
  • 21
  • 90
  • 126

1 Answers1

1

OpenGL

Android uses OpenGL-ES graphics library to perform those actions and you can install OpenGL software development kit on Linux and Windows for that matter.

Using OpenGL the steps are pretty much the same, only the actual underlying calls and the order may be different. The concepts are usually the same.

The main difference between DirextX and OpenGL graphics libraries is that OpenGL uses the right hand rule so rotating a vector x y z points toward the user, the rotation will be counterclockwise. This rule permeates the entire library including construction of polygons, etc.

Here is a great post on how to get started with OpenGL-ES programming in Android.

General OpenGL

OpenGL on Windows

Community
  • 1
  • 1
Justin Shield
  • 2,360
  • 14
  • 12