Line 818:
Line 818:
quad.SetWidth(800);
quad.SetWidth(800);
quad.SetHeight(600);</source>
quad.SetHeight(600);</source>
+
+
We encountered SetPosition() in chapter 3, so I won’t go over its function again. So instead we shall look at SetWidth() and SetHeight, they are both simple functions here is the definition:
+
+
+
<source lang="cpp">void wsp::Quad::SetWidth ( u32 width )
+
Sets the width of the quad.
+
Parameters:
+
width The new width of the quad.</source>
+
+
+
+
<source lang="cpp">void wsp::Quad::SetHeight ( u32 height )
+
Seets the height of the quad.
+
Parameters:
+
height The new height of the quad.</source>
+
+
+
Both of these functions need to be called before Draw() for a Quad object. Each of these takes as a parameter one number of type u32, this determines the pixels height and width, you can change this later in your game or app if you need to. So looking at this:
+
+
<source lang="cpp">quad.SetWidth(800);
+
quad.SetHeight(600);</source>
+
+
we can see this sets quad’s height to 600 pixels and quad’s width to 800. Simple enough? Lets move on. There’s only one other Quad function in this program and its used in a slightly complicated way so I’ll introduce it in an easier way, this function is SetBorderColor() its defined like this:
+
+
<source lang="cpp">void wsp::Quad::SetBorderColor ( GXColor borderColor )
+
Sets the color of the border of the quad. Initial color is black.
+
Parameters:
+
borderColor A GXColor with the desired data.</source>
+
For the purpose of this guide, we will only be dealing with a 32-bit colour stream, there are several flags you can use as it is passed directly to DX, we will use DXColor. A simple call to this using our quad object may look something like this: