Line 864:
Line 864:
This works in the same way as SetRotation() in Lesson 4, the value passed must by divided by two in order to get the true result. As this simply works in the same way as SetRotation in the Sprite class, simply read that description in order to learn how to use it. GetRotation() works in the same way as any other ‘Get’ function. Simply call GetRotation from the Quad class to, well, get the current angle of rotation. Examples of how both of these functions would be used:
This works in the same way as SetRotation() in Lesson 4, the value passed must by divided by two in order to get the true result. As this simply works in the same way as SetRotation in the Sprite class, simply read that description in order to learn how to use it. GetRotation() works in the same way as any other ‘Get’ function. Simply call GetRotation from the Quad class to, well, get the current angle of rotation. Examples of how both of these functions would be used:
+
+
<source lang="cpp">quad.SetRotation(90/2); // This would rotate the image +45 degrees
+
quad.GetRotation(); </source>
+
+
Second function will return the current rotation of the quad object which is of type Quad. After the first call for example GetRotation() will return 45.
+
+
Now I will take a short interlude to introduce a function that will allow you to understand the rest of the functions I will go over. The function of which I speak of is SetBorder(), this again is found in the Quad class.
+
+
<source lang="cpp">void wsp::Quad::SetBorder ( bool border ) </source>
+
+
Turns the border of the quad on or off.
+
+
+
<source lang="cpp">Parameters:
+
border Set to true if the quad should have border, false if not.</source>
+
+
+
Border, as it suggests creates a border around the Quad object defined. Simply call it like this:
+
+
+
<source lang="cpp">quad.SetBorder(true);</source>
+
+
and to turn it off,
+
+
+
<source lang="cpp">quad.SetBorder(flase);</source>
+
+
That’s about it for that function, now we are able to move on to the rest of the Get, Set functions.
+
+
'''SetBorderWidth and GetBorderWidth'''
+
+
<source lang="cpp">void wsp::Quad::SetBorderWidth ( u16 width )
+
Sets the border width of the quad.
+
Parameters:
+
width The new border width of the quad.</source>