<!--Code Ninjas | Jackson Hagood--> <!DOCTYPE html> <html lang="en"> <head> <title>Scale</title> <link rel="stylesheet" type="text/css" href="style.css" media="screen" /> <link rel="icon" href="images/icon.png"> <style> </style> </head> <body> <div class="sidenav"> <a href="functions.html"><h2>GDP Functions</h2></a> <br> <h2><a href="position.html">Position</a></h2> <h2><a href="rotation.html">Rotation</a></h2> <h2><a href="scale.html">Scale</a></h2> <ul id="contents"> <li><a href="#scalexy">.scaleX() and .scaleY()</a></li> <li><a href="#wd">.height() and .width()</a></li> </ul> <h2><a href="collision.html">Collision</a></h2> <h2><a href="appearance.html">Appearance</a></h2> <h2><a href="timers.html">Timers</a></h2> <h2><a href="animation.html">Animation</a></h2> <h2><a href="attributes.html">Attributes</a></h2> <h2><a href="miscellaneous.html">Miscellaneous</a></h2> </div> <div name="Scale"> <!--done--> <h1>Scale</h1> <div class="item"> <!--done--> <a name="scalexy"> <h3>.scaleX() and .scaleY()</h3> <p>The functions .scaleX() and .scaleY() can be used to scale an object's x and y components. The functions can also be used to return and object's current scale. .scaleX() and .scaleY() take in one parameter, and object's desired scale.</p> <pre><code>object.scaleX(10); //scales 'object' in the x direction, with a factor of 10 var scale = object.scaleY(); //sets variable 'scale' to the y scale of 'object'</code></pre> <h4>See Further:</h4> <ol class="more"> <li>Meteors Part 2</li> </ol> </a> </div> <br> <div class="item"> <!--done--> <a name="wd"> <h3>.height() and .width()</h3> <p>The functions .height() and .width() can set an object's dimensions. .width() sets and object's x dimension, while .height() sets an object's y dimension. The functions take in one parameter, and object's desired dimension. These functions can also return an object's current dimension.</p> <pre><code>object.width(10); //sets the width of 'object' to 10; var height = object.height(); //sets variable 'height' to the height of 'object'</code></pre> <h4>See Further:</h4> <ol class="more"> <li>Space Bumpers</li> </ol> </a> </div> </div> </body> </html>