You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
radium/docs/api/draw.html

169 lines
5.7 KiB
HTML

<!doctype html>
<html>
<head>
<style>
body {
background-color: #F5F5F5;
font-family: sans-serif;
margin-right: 40px;
}
h2, h3, h4, h5, h6, h7
{
margin-top: 16px;
margin-bottom: 4px;
}
.children { padding-left: 40px; }
.definition
{
font-weight: bold;
margin-bottom: 32px;
}
.example
{
padding: 5px 6px;
font-weight: bold;
font-size: 15px;
background-color: #E6E6E6;
margin-top: 11px;
}
.example > .children
{
padding-top: 11px;
padding-left: 10px;
}
.example > .children > h7
{
font-size: 13px;
}
h7
{
font-size: 14px;
font-weight: bold;
margin-bottom: 2px;
}
pre
{
margin-top: 0px;
padding: 6px 7px;
background-color: #D9D9D9;
font-weight: normal;
font-size: 13px;
}
dl
{
margin: 5px 0px;
}
dt
{
font-weight: bold;
}
dd
{
font-size: 14px;
font-weight: normal;
margin-left: 8px;
}
dd > .children
{
font-size: 95%;
}
dd > .children > dl > dd
{
margin-left: 13px;
}
.exclamation
{
padding: 7px 8px;
margin: 11px 0px;
background-color: #FFE9AA;
border: 1px solid yellow;
font-size: 15px;
font-weight: normal;
}
.text
{
font-size: 15px;
font-weight: normal;
margin-bottom: 14px;
margin-top: 10px;
}
.toc
{
border: 1px solid gray;
background-color: #E6E6E6;
padding: 8px 9px;
font-size: 15px;
margin-bottom: 12px;
}
.toc h2
{
margin: 0px 0px 3px 0px;
font-size: 19px;
}
.toc ul
{
margin-top: 0px;
margin-bottom: 0px;
padding-left: 25px;
}
.toc li
{
margin-bottom: 2px;
}
.toc .alternatives
{
font-size: 12px;
}
.toc a
{
color: #292722;
}
.toc a:hover
{
color: black;
}
.fixed
{
font-family: monospace;
background-color: white;
padding: 1px 4px;
border: 1px solid silver;
border-radius: 4px;
}
</style>
</head>
<body>
<div class="children"><h1>Engine.Draw</h1><div class="text">The Draw library provides functions to draw shapes, text, and sprites on a scene.</div><div class="toc"><h2>Table of contents</h2><ul><li><a href="#Engine_Draw_Linex1y1x2y2options">Engine.Draw.Line(x1, y1, x2, y2, options)</a> Draws a line. </li><li><a href="#Engine_Draw_Rectanglex1y1x2y2options">Engine.Draw.Rectangle(x1, y1, x2, y2, options)</a> Draws a rectangle. </li></ul></div><div class="definition"><a name="Engine_Draw_Linex1y1x2y2options">Engine.Draw.Line(<em>x1</em>, <em>y1</em>, <em>x2</em>, <em>y2</em>, <em>options</em>) <div class="children"><div class="text">Draws a line.</div><dl><dt>x1</dt><dd>The X coordinate of the starting position.<div class="children"></div></dd></dl><dl><dt>y1</dt><dd>The Y coordinate of the starting position.<div class="children"></div></dd></dl><dl><dt>x2</dt><dd>The X coordinate of the ending position.<div class="children"></div></dd></dl><dl><dt>y2</dt><dd>The Y coordinate of the ending position.<div class="children"></div></dd></dl><dl><dt>options</dt><dd><em>Optional.</em> Options for drawing the line.<div class="children"><dl><dt>width</dt><dd>Width of the line in pixels.<div class="children"></div></dd></dl><dl><dt>color</dt><dd>The line <a href="../drawing.html">color</a>.<div class="children"></div></dd></dl><dl><dt>cap</dt><dd>The type of <a href="../drawing.html">line cap</a>.<div class="children"></div></dd></dl><dl><dt>alpha</dt><dd>The alpha value of the line.<div class="children"></div></dd></dl></div></dd></dl><div class="example">Example: Draw a blue line <div class="children"><h7>Code:</h7><pre class="code">Engine.Draw.Line(10, 10, 120, 120, {
color: "blue"
});</pre></div></div></div></a></div><div class="definition"><a name="Engine_Draw_Rectanglex1y1x2y2options">Engine.Draw.Rectangle(<em>x1</em>, <em>y1</em>, <em>x2</em>, <em>y2</em>, <em>options</em>) <div class="children"><div class="text">Draws a rectangle.</div><dl><dt>x1</dt><dd>The X coordinate of the top left corner.<div class="children"></div></dd></dl><dl><dt>y1</dt><dd>The Y coordinate of the top left corner.<div class="children"></div></dd></dl><dl><dt>x2</dt><dd>The X coordinate of the right bottom corner.<div class="children"></div></dd></dl><dl><dt>y2</dt><dd>The Y coordinate of the right bottom corner.<div class="children"></div></dd></dl><dl><dt>options</dt><dd><em>Optional.</em> Options for drawing the rectangle.<div class="children"><dl><dt>width</dt><dd>Width of the outline in pixels.<div class="children"></div></dd></dl><dl><dt>linecolor</dt><dd>The <a href="../drawing.html">color</a> of the outline.<div class="children"></div></dd></dl><dl><dt>cap</dt><dd>The type <a href="../drawing.html">line cap</a> for the outline.<div class="children"></div></dd></dl><dl><dt>rx</dt><dd>The horizontal radius of the corners of the rectangle.<div class="children"></div></dd></dl><dl><dt>ry</dt><dd>The vertical radius of the corners of the rectangle.<div class="children"></div></dd></dl><dl><dt>radius</dt><dd>A short-hand option that sets both <span class="fixed">rx</span> and <span class="fixed">ry</span>.<div class="children"></div></dd></dl><dl><dt>color</dt><dd>The fill color of the rectangle.<div class="children"></div></dd></dl><dl><dt>alpha</dt><dd>The alpha value of the rectangle.<div class="children"></div></dd></dl></div></dd></dl><div class="example">Example: Draw a blue rectangle with a yellow outline, rounded borders and at 70% opacity <div class="children"><h7>Code:</h7><pre class="code">Engine.Draw.Rectangle(20, 30, 150, 180, {
linecolor: "yellow",
color: "blue",
radius: 8,
alpha: 0.7
});</pre></div></div></div></a></div></div>
</body>
</html>