1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../../../CSS/revolution.css"> 8<LINK rel="stylesheet" type="text/css" href="../../../CSS/revolution.css"> 9<TITLE>G2D-test</TITLE> 10</HEAD> 11<BODY link="#0000ff" vlink="#800080"> 12<H1>G2D-test</H1> 13 14<H2>Description</H2> 15<P>This sample game demo uses the G2D library. This game demo demonstrates the following:</P> 16<UL> 17<LI>How layers can comprise tiles of different materials. 18<LI>How to design tiles so that the viewport can be rotated without creating artificial aliasing. 19<LI>How to compose and separately scroll multiple layers. 20</UL> 21<P>For details about this library, refer to the 2D Graphics Library (G2D) in the <em>Revolution Graphics Programmer's Guide</em>.</P> 22 23<H2>Coverage</H2> 24<TABLE border="1" cellpadding="3" cellspacing="0.1" width="640"> 25 <TBODY> 26 <TR> 27<TD width="30%" valign="middle" bgcolor="#C0C0C0"><EM><STRONG>Functions</STRONG></EM></TD> 28<TD width="25%" valign="middle" bgcolor="#C0C0C0"><EM><STRONG>Parameters</STRONG></EM></TD> 29<TD width="45%" valign="middle" bgcolor="#C0C0C0"><EM><STRONG>Description</STRONG></EM></TD> 30 </TR> 31 <TR> 32<TD width="30%"><CODE>G2DinitSprite</CODE></TD> 33<TD width="25%"><SPAN class="argument">sprite</SPAN></TD> 34<TD width="45%" valign="MIDDLE">Pointer to the <CODE>G2DSprite</CODE> structure.</TD> 35 </TR> 36 <TR> 37<TD width="30%" rowspan="2"><CODE><CODE>G2DDrawSprite</CODE></CODE></TD> 38<TD width="25%"><SPAN class="argument">sprite</SPAN></TD> 39<TD width="45%" valign="MIDDLE">Pointer to the <CODE>G2DSprite</CODE> structure.</TD> 40 </TR> 41 <TR> 42<TD width="25%"><SPAN class="argument">po</SPAN></TD> 43<TD width="45%" valign="MIDDLE">Pointer to the <CODE>G2DPosOri</CODE> structure to which the position and orientation of the sprite have been passed.</TD> 44 </TR> 45 <TR> 46<TD width="30%" rowspan="2"><CODE><CODE>G2DDrawLayer</CODE></CODE></TD> 47<TD width="25%"><SPAN class="argument"><STRONG><EM><CODE>layer</CODE></EM></STRONG></SPAN></TD> 48<TD width="45%" valign="MIDDLE">Pointer to the <CODE>G2DLayer</CODE> structure.</TD> 49 </TR> 50 <TR> 51<TD width="25%"><SPAN class="argument"><STRONG><EM><CODE>aSortBuffer</CODE></EM></STRONG></SPAN></TD> 52<TD width="45%" valign="MIDDLE">Pointer to work buffer.</TD> 53 </TR> 54 <TR> 55<TD width="30%"><CODE><CODE>G2DSetCamera</CODE></CODE></TD> 56<TD width="25%"><SPAN class="argument">po</SPAN></TD> 57<TD width="45%" valign="MIDDLE">Pointer to the <CODE>G2DPosOri</CODE> structure to which the position and orientation of the camera have been passed.</TD> 58 </TR> 59 <TR> 60<TD width="30%" rowspan="2"><CODE><CODE>G2DInitWorld</CODE></CODE></TD> 61<TD width="25%"><SPAN class="argument"><STRONG><EM><CODE>nWorldX</CODE></EM></STRONG></SPAN></TD> 62<TD width="45%" valign="MIDDLE">Width of world space in pixels.</TD> 63 </TR> 64 <TR> 65<TD width="25%"><SPAN class="argument"><STRONG><EM><CODE>nWorldY</CODE></EM></STRONG></SPAN></TD> 66<TD width="45%" valign="MIDDLE">Height of world space in pixels.</TD> 67 </TR> 68 <TR> 69<TD width="30%" rowspan="4"><CODE><CODE>G2DSetViewport</CODE></CODE></TD> 70<TD width="25%"><SPAN class="argument"><STRONG><EM><CODE>nLeft</CODE></EM></STRONG></SPAN></TD> 71<TD width="45%" valign="MIDDLE">The left side of the screen space coordinates for viewport.</TD> 72 </TR> 73 <TR> 74<TD width="25%"><SPAN class="argument"><STRONG><EM><CODE>nTop</CODE></EM></STRONG></SPAN></TD> 75<TD width="45%" valign="MIDDLE">The upper side of the screen space coordinates for viewport.</TD> 76 </TR> 77 <TR> 78<TD width="25%"><SPAN class="argument"><STRONG><EM><CODE>nWidth</CODE></EM></STRONG></SPAN></TD> 79<TD width="45%" valign="MIDDLE">Width of viewport in screen space coordinates.</TD> 80 </TR> 81 <TR> 82<TD width="25%"><SPAN class="argument"><STRONG><EM><CODE>nHeight</CODE></EM></STRONG></SPAN></TD> 83<TD width="45%" valign="MIDDLE">Height of viewport in screen space coordinates.</TD> 84 </TR> 85 <TR> 86<TD width="30%"><CODE><CODE>GXPosition2f32</CODE></CODE></TD> 87<TD width="25%"><SPAN class="argument"><STRONG><EM><CODE>X, Z</CODE></EM></STRONG></SPAN></TD> 88<TD width="45%" valign="MIDDLE"><EM>x</EM>- and <EM>z</EM>-coordinates of vertex (used by <CODE>G2D.c</CODE> rather than the sample demo).</TD> 89 </TR> 90 </TBODY> 91</TABLE> 92 93<H2>Using the Demo</H2> 94<P>The following is a summary of the control methods:</P> 95<TABLE border="1" cellpadding="3" cellspacing="0.1"> 96 <TBODY> 97 <TR> 98<TD width="25%" valign="middle" align="left" bgcolor="#C0C0C0"><EM><STRONG>Button</STRONG></EM></TD> 99<TD width="30%" valign="middle" align="left" bgcolor="#C0C0C0"><EM><STRONG>Normal / Bounce Mode</STRONG></EM></TD> 100 </TR> 101 <TR> 102<TD width="25%">START</TD> 103<TD width="30%">Exits the demo.</TD> 104 </TR> 105 <TR> 106<TD width="25%">Control Stick</TD> 107<TD width="30%">Move ship.</TD> 108 </TR> 109 <TR> 110<TD width="25%">L and R</TD> 111<TD width="30%">Rotate ship.</TD> 112 </TR> 113 <TR> 114<TD width="25%">A</TD> 115<TD width="30%">No function.</TD> 116 </TR> 117 <TR> 118<TD width="25%">B</TD> 119<TD width="30%">Brake ship.</TD> 120 </TR> 121 <TR> 122<TD width="25%">Y</TD> 123<TD width="30%">Cycles mode.</TD> 124 </TR> 125 <TR> 126<TD width="25%">X</TD> 127<TD width="30%">No function.</TD> 128 </TR> 129 </TBODY> 130</TABLE> 131 132<H2>Snapshot</H2> 133<P><IMG src="./images/g2d-test-1.jpg" alt="g2d-test-1.jpg (101393 bytes)" width="640" height="480"></P> 134 135<H2>Required Data Files</H2> 136<P>Requires <CODE>g2d-00.tpl</CODE> from the <CODE>$REVOLUTION_SDK_ROOT/dvddata/gxTests</CODE> directory.</P> 137 138<H2>Revision History</H2> 139<P> 1402006/03/01 Initial version.<br> 141</P> 142 143<hr><p>CONFIDENTIAL</p></body> 144</HTML>