-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Android NDK Game Development Cookbook
By :
The main UI element of our puzzle game is the animated 3D image selector. In this recipe, we show you how to render the animated carousel-like selector and interact with the user.
Before proceeding with this recipe, you may need to go back to Chapter 7, Cross-platform UI and Input System, and read how the Canvas class works. A bit of mathematics will be required to understand better how the code in this recipe works.
The idea behind the rendering is quite simple. We let the individual quads move in a way that their corners slide along four guiding curves. The following figure shows the same quad in a series of positions:

The four curves show the paths of the quad's corners.
We start with the helper Curve class, which implements the linear interpolation on the set of control points. A curve is represented in a parametric form.
A parametric equation of a curve is a representation of this curve through equations expressing the...
Change the font size
Change margin width
Change background colour