Game Development Reference
In-Depth Information
The Unproject() and MouseCoordsToWorldPointAndRay() functions convert 2D
screen point coordinates into a ray in the 3D world space, where our carousel quads ly. Their
implementations can be found in the GeomUtil.h ile.
To rewind the selector to some speciic image we set a target position:
void SetCurrentImageTarget( int i )
{ FFlinger->SetTargetValue( ( float )i * ( OneImageSize ) ); }
There's more...
In this recipe we used 3D lines to render the carousel. It is really simple to use the Canvas
class to render each quad with a texture. We also encourage the reader to add a relection
effect, which is easily done by rendering the same set of quads with an additional transform
representing the relection from a horizontal plane.
See also
F Implementing the complete picture-puzzle game
Page-based user interface
In the previous chapter, we developed a game that contained a single page. Most of the
modern mobile games, however, contain sophisticated user interfaces backed by complex
business logic. A typical user interface consists of several full-screen pages with multiple
UI elements, such as buttons, images and, input boxes. These are rendered using the in-
game rendering system, and do not depend on the user interface of the underlying operating
system. In this recipe, we show you how to approach this problem.
Getting ready
You might want to ind out what open source C++ multiplatform UI libraries exist out there.
The following link will help you: http://en.wikipedia.org/wiki/List_of_platform-
independent_GUI_libraries .
We would also like to recommend looking at libRocket if you want to go for a full-scale
HTML/CSS user interface for your game ( http://librocket.com ). Its integration is
straightforward, but lies outside of the scope of this topic.
 
Search WWH ::




Custom Search