<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.hard-light.org/index.php?action=history&amp;feed=atom&amp;title=Script_-_Example_HUD</id>
	<title>Script - Example HUD - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.hard-light.org/index.php?action=history&amp;feed=atom&amp;title=Script_-_Example_HUD"/>
	<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Example_HUD&amp;action=history"/>
	<updated>2026-11-15T10:05:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_Example_HUD&amp;diff=28854&amp;oldid=prev</id>
		<title>TopAce at 19:27, 18 April 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Example_HUD&amp;diff=28854&amp;oldid=prev"/>
		<updated>2010-04-18T19:27:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:27, 18 April 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{captionedimage|image=[[image:Script-hudexample.jpg|thumbnail|320px]]|caption=Partial HUD created with scripting}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{captionedimage|image=[[image:Script-hudexample.jpg|thumbnail|320px]]|caption=Partial HUD created with scripting}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==Function==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Creates new HUD or rather an example of scripted HUD. (Original source by [[User:WMCoolmon|WMCoolmon]])&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Creates new HUD or rather an example of scripted HUD. (Original source by [[User:WMCoolmon|WMCoolmon]])&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>TopAce</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_Example_HUD&amp;diff=6641&amp;oldid=prev</id>
		<title>Wanderer: fixed due change in scripting</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Example_HUD&amp;diff=6641&amp;oldid=prev"/>
		<updated>2006-07-07T07:45:50Z</updated>

		<summary type="html">&lt;p&gt;fixed due change in scripting&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:45, 7 July 2006&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l9&quot;&gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$GameInit:  [[init.lua]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$GameInit:  [[init.lua]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$HUD:    [[hud.lua]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$HUD:    [[hud.lua]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    +Override: &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;YES&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    +Override: &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;true&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#End&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#End&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Wanderer</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_Example_HUD&amp;diff=6539&amp;oldid=prev</id>
		<title>WMCoolmon at 04:12, 1 July 2006</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Example_HUD&amp;diff=6539&amp;oldid=prev"/>
		<updated>2006-07-01T04:12:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:12, 1 July 2006&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{captionedimage|image=[[image:Script-hudexample.jpg|thumbnail|320px]]|caption=Partial HUD created with scripting}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Function==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Function==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Creates new HUD or rather an example of scripted HUD&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Creates new HUD or rather an example of scripted HUD&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. (Original source by [[User:WMCoolmon|WMCoolmon]])&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Table Entry==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Table Entry==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WMCoolmon</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_Example_HUD&amp;diff=5868&amp;oldid=prev</id>
		<title>Wanderer at 15:21, 10 May 2006</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Example_HUD&amp;diff=5868&amp;oldid=prev"/>
		<updated>2006-05-10T15:21:20Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Function==&lt;br /&gt;
Creates new HUD or rather an example of scripted HUD&lt;br /&gt;
&lt;br /&gt;
==Table Entry==&lt;br /&gt;
&lt;br /&gt;
===Scripting.tbl===&lt;br /&gt;
&amp;lt;pre&amp;gt;#Global Hooks&lt;br /&gt;
$GameInit:  [[init.lua]]&lt;br /&gt;
$HUD:    [[hud.lua]]&lt;br /&gt;
   +Override: YES&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===init.lua===&lt;br /&gt;
&amp;lt;pre&amp;gt;--#################### HUD ####################--&lt;br /&gt;
drawBevRect = function(x1, y1, x2, y2)&lt;br /&gt;
   -------Draw background&lt;br /&gt;
   gr.setColor(0, 0, 48)&lt;br /&gt;
   for x=1,5 do&lt;br /&gt;
      --&amp;quot;/ \&amp;quot;&lt;br /&gt;
      gr.drawLine(x1+(5-x), y1+x, x2-(5-x), y1+x)&lt;br /&gt;
      --&amp;quot;\ /&amp;quot;&lt;br /&gt;
      gr.drawLine(x1+(5-x), y2-x, x2-(5-x), y2-x)&lt;br /&gt;
   end&lt;br /&gt;
   -- &amp;quot;| |&amp;quot;&lt;br /&gt;
   gr.drawRectangle(x1+1, y1+5, x2, y2-6, true)&lt;br /&gt;
   &lt;br /&gt;
   -------Draw lines&lt;br /&gt;
   gr.setColor(0, 128, 255)&lt;br /&gt;
   --&amp;quot; - &amp;quot;&lt;br /&gt;
   gr.drawLine(x1+5, y1, x2-6, y1)&lt;br /&gt;
   --&amp;quot;/ \&amp;quot;&lt;br /&gt;
   gr.drawLine(x1, y1+5, x1+5, y1)&lt;br /&gt;
   gr.drawLine(x2, y1+5, x2-5, y1)&lt;br /&gt;
   --&amp;quot;| |&amp;quot;&lt;br /&gt;
   gr.drawLine(x1, y1+5, x1, y2-5)&lt;br /&gt;
   gr.drawLine(x2, y1+5, x2, y2-5)&lt;br /&gt;
   --&amp;quot;\ /&amp;quot;&lt;br /&gt;
   gr.drawLine(x1, y2-5, x1+5, y2)&lt;br /&gt;
   gr.drawLine(x2, y2-5, x2-5, y2)&lt;br /&gt;
   --&amp;quot; - &amp;quot;&lt;br /&gt;
   gr.drawLine(x1+5, y2, x2-6, y2)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
setDamageColor = function(dcm)&lt;br /&gt;
   local r&lt;br /&gt;
   local g&lt;br /&gt;
   local b&lt;br /&gt;
   if dcm &amp;gt; .5 then&lt;br /&gt;
      r = 255 * math.sin(dcm*math.pi)&lt;br /&gt;
      g = 128+128 * math.sin(dcm*math.pi)&lt;br /&gt;
      b = -255 * math.cos(2*dcm*math.pi)&lt;br /&gt;
   else&lt;br /&gt;
      r = 255&lt;br /&gt;
      g = 255 * math.sin(dcm*math.pi)&lt;br /&gt;
      b = 0&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   gr.setColor(r, g, b)&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===hud.lua===&lt;br /&gt;
&amp;lt;pre&amp;gt;if slf then&lt;br /&gt;
-------Draw speed&lt;br /&gt;
   x = 50&lt;br /&gt;
   y = 50&lt;br /&gt;
   &lt;br /&gt;
   drawBevRect(x, y, x+100, y+30)&lt;br /&gt;
   &lt;br /&gt;
   local vel = slf.Orientation:rotateVector(slf.Velocity)&lt;br /&gt;
   local mvel = slf.MaxVelocity&lt;br /&gt;
   &lt;br /&gt;
   --Skip beveled area&lt;br /&gt;
   x = x+5&lt;br /&gt;
   y = y+5&lt;br /&gt;
&lt;br /&gt;
   --Draw X component&lt;br /&gt;
   local speed = (vel.x/mvel.x)*10&lt;br /&gt;
   gr.drawRectangle(x, y+5, x+20, y+15, false)&lt;br /&gt;
   gr.drawRectangle(x+10, y+5, x+10+speed, y+15)&lt;br /&gt;
   &lt;br /&gt;
   --Skip last gauge(20 px)&lt;br /&gt;
   x = x+20+5&lt;br /&gt;
   &lt;br /&gt;
   --Draw Y component&lt;br /&gt;
   local speed = (vel.y/mvel.y)*10&lt;br /&gt;
   gr.drawRectangle(x, y, x+10, y+20, false)&lt;br /&gt;
   gr.drawRectangle(x, y+15, x+10, y+15+speed)&lt;br /&gt;
   &lt;br /&gt;
   --Skip last gauge(10 px)&lt;br /&gt;
   x=x+10+5&lt;br /&gt;
   &lt;br /&gt;
   --Draw Z component&lt;br /&gt;
   local speed = (vel.z/mvel.z)*50&lt;br /&gt;
   gr.drawRectangle(x, y+5, x+50, y+15, false)&lt;br /&gt;
   gr.drawRectangle(x, y+5, x+speed, y+15)&lt;br /&gt;
   &lt;br /&gt;
-------Draw life&lt;br /&gt;
   x = 25&lt;br /&gt;
   y = 200&lt;br /&gt;
   &lt;br /&gt;
   drawBevRect(x, y, x+20, y+110)&lt;br /&gt;
   &lt;br /&gt;
   x = x+5&lt;br /&gt;
   y = y+5&lt;br /&gt;
&lt;br /&gt;
   dcm = slf.HitpointsLeft/slf.HitpointsMax&lt;br /&gt;
   &lt;br /&gt;
   --Draw bar&lt;br /&gt;
   gr.drawRectangle(x, y, x+10, y+100, false)&lt;br /&gt;
   setDamageColor(dcm)&lt;br /&gt;
   gr.drawRectangle(x, y+(1-dcm)*100, x+10, y+100)&lt;br /&gt;
   &lt;br /&gt;
-------Draw mission time&lt;br /&gt;
   x = gr.getScreenWidth()-125&lt;br /&gt;
   y = 200&lt;br /&gt;
   &lt;br /&gt;
   drawBevRect(x, y, x+100, y+20)&lt;br /&gt;
   &lt;br /&gt;
   x = x+5&lt;br /&gt;
   y = y+5&lt;br /&gt;
&lt;br /&gt;
   gr.drawString(&amp;quot;Flight time: &amp;quot;, x, y)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------Draw gun ammo&lt;br /&gt;
   x = 25&lt;br /&gt;
   y = gr.getScreenHeight()-45&lt;br /&gt;
   &lt;br /&gt;
   local pbank = slf.PrimaryBanks[1]&lt;br /&gt;
&lt;br /&gt;
   if pbank then&lt;br /&gt;
      local ammo = pbank.AmmoLeft/pbank.AmmoMax*70&lt;br /&gt;
      &lt;br /&gt;
      drawBevRect(x, y, x+120, y+20)&lt;br /&gt;
&lt;br /&gt;
      --Skip beveled area&lt;br /&gt;
      x = x+5&lt;br /&gt;
      y = y+5&lt;br /&gt;
      &lt;br /&gt;
      --Draw bar&lt;br /&gt;
      gr.drawRectangle(x, y, x+70, y+10, false)&lt;br /&gt;
      gr.drawRectangle(x, y, x+ammo, y+10)&lt;br /&gt;
      &lt;br /&gt;
      --Skip bar(70px)&lt;br /&gt;
      x = x+70+5&lt;br /&gt;
      &lt;br /&gt;
      --Draw number&lt;br /&gt;
      gr.drawString(pbank.AmmoLeft, x, y)&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
-------Draw missile ammo&lt;br /&gt;
   x = gr.getScreenWidth()-190&lt;br /&gt;
   y = gr.getScreenHeight()-45&lt;br /&gt;
   &lt;br /&gt;
   local sbank = slf.SecondaryBanks[1]&lt;br /&gt;
&lt;br /&gt;
   if sbank then&lt;br /&gt;
      local sb_left = sbank.AmmoLeft&lt;br /&gt;
      local sb_max = sbank.AmmoMax&lt;br /&gt;
&lt;br /&gt;
      drawBevRect(x, y, x+165, y+20)&lt;br /&gt;
&lt;br /&gt;
      x = x+5&lt;br /&gt;
      y = y+5&lt;br /&gt;
&lt;br /&gt;
      for i = 1,16 do&lt;br /&gt;
         if i &amp;gt; sb_max then&lt;br /&gt;
            break&lt;br /&gt;
         elseif i &amp;gt; sb_left then&lt;br /&gt;
            gr.drawRectangle(x, y, x+5, y+10, false)&lt;br /&gt;
         else&lt;br /&gt;
            gr.drawRectangle(x, y, x+5, y+10)&lt;br /&gt;
         end&lt;br /&gt;
&lt;br /&gt;
         x = x+10&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   &lt;br /&gt;
-------Draw countermeasures&lt;br /&gt;
   x = (gr.getScreenWidth()/2)-(105/2)&lt;br /&gt;
   y = gr.getScreenHeight()-40&lt;br /&gt;
   &lt;br /&gt;
   local cm_max = slf.Class.CountermeasuresMax&lt;br /&gt;
   &lt;br /&gt;
   if cm_max then&lt;br /&gt;
      local cm_left = slf.CountermeasuresLeft&lt;br /&gt;
      drawBevRect(x, y, x+105, y+15)&lt;br /&gt;
   &lt;br /&gt;
      x = x+5&lt;br /&gt;
      y = y+5&lt;br /&gt;
&lt;br /&gt;
      for i = 1,10 do&lt;br /&gt;
         if i &amp;gt; cm_max then&lt;br /&gt;
            break&lt;br /&gt;
         elseif i &amp;gt; cm_left then&lt;br /&gt;
            --&amp;quot;-&amp;quot;&lt;br /&gt;
            gr.drawLine(x+2, y+2, x+3, y+2)&lt;br /&gt;
            --&amp;quot;|&amp;quot;&lt;br /&gt;
            gr.drawLine(x+2, y+2, x+2, y+3)&lt;br /&gt;
         else&lt;br /&gt;
            --&amp;quot;-&amp;quot;&lt;br /&gt;
            gr.drawLine(x, y+2, x+5, y+2)&lt;br /&gt;
            --&amp;quot;|&amp;quot;&lt;br /&gt;
            gr.drawLine(x+2, y, x+2, y+5)&lt;br /&gt;
            --&amp;quot;\&amp;quot;&lt;br /&gt;
            gr.drawLine(x, y, x+5, y+5)&lt;br /&gt;
            --&amp;quot;/&amp;quot;&lt;br /&gt;
            gr.drawLine(x, y+5, x+5, y)&lt;br /&gt;
         end&lt;br /&gt;
&lt;br /&gt;
         x = x+10&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
--/slf&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Examples|Example HUD]]&lt;/div&gt;</summary>
		<author><name>Wanderer</name></author>
	</entry>
</feed>