<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IONSTAR Studios</title>
	<atom:link href="http://www.ionstar.org/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.ionstar.org</link>
	<description>Games, Tools, Middleware</description>
	<lastBuildDate>Thu, 28 Feb 2013 16:19:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Improved Tooltip System</title>
		<link>http://www.ionstar.org/?p=679</link>
		<comments>http://www.ionstar.org/?p=679#comments</comments>
		<pubDate>Thu, 14 Feb 2013 00:11:44 +0000</pubDate>
		<dc:creator>Christian Herold</dc:creator>
				<category><![CDATA[SQUID]]></category>

		<guid isPermaLink="false">http://www.ionstar.org/?p=679</guid>
		<description><![CDATA[Have fun with another preview of 1.0.4 ! Todays topic: Tooltips Here&#8217;s a snippet of the changelog: &#8220;Desktop.TooltipControl is now of type Tooltip. Inherit the abstract Tooltip class to create your own Tooltip behaviour. Tooltip inherits Frame. Override the SetContext<span class="ellipsis">&#8230;</span> <a href="http://www.ionstar.org/?p=679"><div class="see-more">See more &#8250;</div><!-- end of .see-more --></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Have fun with another preview of 1.0.4 !</strong></p>
<p><strong>Todays topic:</strong> Tooltips</p>
<p>Here&#8217;s a snippet of the changelog:</p>
<p><em>&#8220;Desktop.TooltipControl is now of type Tooltip.<br />
Inherit the abstract Tooltip class to create your own Tooltip behaviour.<br />
Tooltip inherits Frame. Override the SetContext method to receive the current tooltip context.<br />
Several Desktop properties wered moved into this new class.<br />
The TooltipControl defaults to a SimpleTooltip, which is an autosized label.&#8221;</em><em> </em></p>
<p>I think this sums it up pretty well. This change allows you to create Tooltip controls of arbitrary complexity. You can nest controls, animate them, position/align the whole salad where you want, or set AutoLayout to true and have the baseclass handle it for you.</p>
<p><strong>This is important to understand:</strong><br />
In order to use your Tooltip control, you assign it to Desktop.TooltipControl.<br />
This control is dynamically added/removed to Desktop.Elements, based on its Visible property.<br />
This ensures it always stays on top of all other controls.</p>
<p>Note how i use the properties <strong>Delay</strong>, <strong>Opacity</strong> and <strong>Visible</strong> in the SimpleTooltip sourcecode below:</p>
<pre class="brush:csharp">    // Simple text tooltip that fades in and out
    public class SimpleTooltip : Tooltip
    {
        private int FadeDirection = 1; // used to fade in&amp;out
        private float DelayTimer; // timer to keep track of delay

        // label to display text
        public Label Label { get; private set; }

        // time (ms) it takes to fade in&amp;out
        public float FadeDuration { get; set; }

        // time (ms) it takes before the tooltip fades in.
        // Delay only applies when the tooltip is completely faded out.
        public float Delay { get; set; }

        public SimpleTooltip()
        {
            Delay = 500f; // 0.5 seconds delay
            FadeDuration = 500f; // 0.5 seconds fade
            Opacity = 0; // start transparent
            AutoSize = AutoSize.HorizontalVertical;

            // lets just use a Label to display the tooltip as simple text
            Label = new Label();
            Label.BBCodeEnabled = true;
            Label.AutoSize = AutoSize.HorizontalVertical;
            Label.Style = "tooltip";
            Controls.Add(Label);
        }

        // Gets called when the tooltip context is updated.
        // This occurs when the Hot control changes.
        public override void SetContext(Control context)
        {
            // if there's no tooltip context
            if (context == null || string.IsNullOrEmpty(context.Tooltip))
            {
                // fade out
                FadeDirection = -1;
            }
            else
            {
                // grab the tooltip text
                Label.Text = context.Tooltip;

                // make the control visible
                Visible = true;

                // fade in
                FadeDirection = 1;
            }
        }

        protected override void Update()
        {
            // increment timer if delay isnt reached
            if(DelayTimer &lt; Delay) DelayTimer += GuiHost.TimeElapsed;                          // if delay is reached             if (DelayTimer &gt;= Delay)
            {
                // fade Opacity in/out over Duration depending on FadeDirection
                Opacity += (GuiHost.TimeElapsed / FadeDuration) * FadeDirection;

                // clamp between 0 and 1
                Opacity = Opacity &lt; 0 ? 0 : (Opacity &gt; 1 ? 1 : Opacity);
            }

            // make the control invisible when completely faded out
            if (FadeDirection &lt; 0 &amp;&amp; Opacity == 0)
            {
                Visible = false;
                DelayTimer = 0;
            }
        }
    }</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ionstar.org/?feed=rss2&#038;p=679</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Road to 1.0.4</title>
		<link>http://www.ionstar.org/?p=659</link>
		<comments>http://www.ionstar.org/?p=659#comments</comments>
		<pubDate>Wed, 06 Feb 2013 17:24:32 +0000</pubDate>
		<dc:creator>Christian Herold</dc:creator>
				<category><![CDATA[SQUID]]></category>

		<guid isPermaLink="false">http://www.ionstar.org/?p=659</guid>
		<description><![CDATA[Users are nervously waiting for the next Squid version, so i thought it would be a good time to give a little rundown on what&#8217;s going to happen in 1.0.4, which is just around the corner. There are a few<span class="ellipsis">&#8230;</span> <a href="http://www.ionstar.org/?p=659"><div class="see-more">See more &#8250;</div><!-- end of .see-more --></a>]]></description>
			<content:encoded><![CDATA[<p>Users are nervously waiting for the next Squid version, so i thought it would be a good time to give a little rundown on what&#8217;s going to happen in 1.0.4, which is just around the corner.</p>
<p>There are a few things in 1.0.4 that i&#8217;d like to explain in more detail, as i&#8217;m convinced that users will wonder about some of my decisions in this version.</p>
<h5>Breaking Changes</h5>
<p><strong><br />
1. Control.Initialize was removed<br />
</strong>The Initialize method used to be called in the Control base class, subclassed controls then used to override Initialize. This lead to subclass constructors being called after Initialize, which was confusing for most users and rarely useful. Because of this, we decided to remove Initialize completely.<br />
As a result, all controls are now initialized in their constructors.</p>
<p><strong>2. UVCoords were removed and replaced with Rectangle.<br />
</strong>Style textures are now expressed in pixels instead of UV coords.<br />
This makes building styles a lot easier, thinking in pixels is much more straight forward.<br />
Thanks to all the Beta testers that urged me to make this happen!</p>
<p><strong>3. Changed 2 method signatures in ISquidRenderer<br />
</strong>ISquidRenderer.DrawTexture now uses a Rectangle instead of UVCoords.<br />
The Rectangle represents the source texture rectangle in pixels.<br />
Most renderer implementations benefit from this change, since Graphics APIs usually work with a similar rectangle struct layout.<br />
ISquidRenderer.SetScissor now uses width/height parameters, instead of x2/y2<br />
A small but important change to avoid redundant calculations in renderer implementations.</p>
<p><strong>4. HScrollbar and VScrollbar replaced with ScrollBar<br />
</strong>These two controls were redundant, so now there&#8217;s only one control, the ScrollBar.<br />
You can change between horizontal/vertical scrolling via the Orientation property.</p>
<p><strong>5. Naming conventions<br />
</strong>We&#8217;ve aligned the naming conventions for events with those proposed and used by Microsoft.<strong><br />
</strong>Before 1.0.4 : control.OnMouseClick<br />
After 1.0.4 : control.MouseClick</p>
<h5>Fixes and Improvements</h5>
<p><strong><br />
A lot of fixes to TextBox!</strong><br />
Such as blinking caret, clean linebreaks, selection color, and most importantly improved Text alignment.<br />
When different font sizes are used in one line, the fonts will now align to their baseline.<br />
Note that this is a first iteration of this fix and will most likely need some tweaking in the near future.<br />
Further bugfixes include missing caret on first character and a wrong textoffset when selected text was deleted in a scrolled textbox.</p>
<p><strong>Multiline TextBox aka TextArea!</strong><br />
This new control, as the name already reveals, provides multiline input, selection and arrow key navigation.<br />
For now it does not support BBCode nor auto-textwrap, hard linebreaks are of course respected.<br />
Both are being worked on and will hopefully make it into 1.0.5 or even an earlier hotfix.</p>
<p><strong>Sample Project<br />
</strong>We&#8217;re working on a new sample, with the intention of gearing it more towards a typical &#8220;Game&#8221; user interface. You will find a range of widgets that you are familiar with from many games, like an Inventory, Skillbook, Chatpanel, ActionBars, StatusBars, PaperDoll, item/action tooltips, and a command line Console.</p>
<p><strong>Watch out for 1.0.4 hitting the download area very soon!</strong><br />
<strong><br />
</strong><span style="color: #ff6600;"><strong>Note to Unity users:</strong> <span style="color: #000000;">1.0.4 will be out for Unity shortly after the SDK is updated. </span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ionstar.org/?feed=rss2&#038;p=659</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Release update 12/03/2012</title>
		<link>http://www.ionstar.org/?p=646</link>
		<comments>http://www.ionstar.org/?p=646#comments</comments>
		<pubDate>Mon, 03 Dec 2012 13:40:44 +0000</pubDate>
		<dc:creator>Christian Herold</dc:creator>
				<category><![CDATA[SQUID]]></category>

		<guid isPermaLink="false">http://www.ionstar.org/?p=646</guid>
		<description><![CDATA[The new version 1.0.3 is ready for public release! See the downloads section. In development for 1.0.4: fading tooltips support for Angelcode BMFont improved Drag&#38;Drop Release Notes 1.0.3 fixed Control.AutoSize now takes Controls and Elements into account fixed Label and classes derived<span class="ellipsis">&#8230;</span> <a href="http://www.ionstar.org/?p=646"><div class="see-more">See more &#8250;</div><!-- end of .see-more --></a>]]></description>
			<content:encoded><![CDATA[<p>The new version 1.0.3 is ready for public release!<br />
See the <a title="Downloads" href="http://www.ionstar.org/?page_id=8">downloads</a> section.</p>
<h3>In development for 1.0.4:</h3>
<ul>
<li>fading tooltips</li>
<li>support for Angelcode BMFont</li>
<li>improved Drag&amp;Drop</li>
</ul>
<h3>Release Notes 1.0.3</h3>
<ul>
<li>fixed Control.AutoSize now takes Controls and Elements into account</li>
<li>fixed Label and classes derived from Label now chose AutoSize based on Text and Elements</li>
<li>fixed ActiveList&lt;T&gt; now exposes events: ItemRemove, ItemAdded, ItemsCleared, BeforeItemAdded, BeforeItemRemoved, BeforeItemsCleared</li>
<li>fixed a bug that caused only button 0 to fire some events</li>
<li>fixed a bug that caused wrong linebreaks in Label.Text when TextWrap was true</li>
<li>fixed Desktop.TooltipControl go out of screen bounds</li>
<li>fixed a bug in Window.Show() that caused double modality</li>
<li>fixed a potential crash when Window.Show() was called with null parameter</li>
<li>fixed cursor position while resizing. cursor remains perfectly sticky now</li>
<li>fixed text display problems with some special characters</li>
<li>fixed wrong render order of textbox highlight</li>
<li>fixed DropDownList not processing events when nested in a modal window</li>
<li>fixed a bug that caused some controls to be inactive in a modal window</li>
<li>fixed a null exception in ListBox.SelectedItem</li>
<li>fixed ListBoxItem.Selected and LIstBox.SelectedItems now interact correctly</li>
<li>fixed TextBox processing some input when ReadOnly</li>
<li>fixed several bugs related to ListBox.SelectedItemChanged</li>
</ul>
<ul>
<li>renamed virtual void Control.OnUpdate to Control.Update</li>
<li>renamed virtual void Control.OnStateChanged to Control.StateChanged</li>
<li>renamed virtual void Control.OnLateUpdate to Control.LateUpdate</li>
</ul>
<ul>
<li>added new event Control.OnUpdate</li>
<li>added new event Button.BeforeCheckedChanged</li>
<li>added new control RadioButton, suppports grouping</li>
<li>added new method Control.FindControls&lt;T&gt; to find direct children of a given type</li>
<li>added int TextBox.HighlightColor to change the background color of selected text</li>
<li>added property ListBox.SelectedItems and event ListBox.SelectedItemsChanged</li>
<li>added ListBox.MaxSelected to limit the max number or selected items</li>
<li>added Color.Tint property. Used to tint the control style.</li>
<li>added Flipbook class for animated texture uv coords</li>
<li>added FlipbookCursor class for animated cursors</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ionstar.org/?feed=rss2&#038;p=646</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Release update 07/17/2012</title>
		<link>http://www.ionstar.org/?p=510</link>
		<comments>http://www.ionstar.org/?p=510#comments</comments>
		<pubDate>Tue, 17 Jul 2012 15:45:30 +0000</pubDate>
		<dc:creator>Christian Herold</dc:creator>
				<category><![CDATA[SQUID]]></category>

		<guid isPermaLink="false">http://www.ionstar.org/?p=510</guid>
		<description><![CDATA[The new version 1.0.2 is ready for public release! See the downloads section. Note: I was asked to include a GridView control in this release, but i wasn&#8217;t able to finish it. So instead of rushing it i included the unfinished GridView<span class="ellipsis">&#8230;</span> <a href="http://www.ionstar.org/?p=510"><div class="see-more">See more &#8250;</div><!-- end of .see-more --></a>]]></description>
			<content:encoded><![CDATA[<p>The new version 1.0.2 is ready for public release! See the <a title="Downloads" href="http://www.ionstar.org/?page_id=8">downloads</a> section.</p>
<p><strong>Note:</strong></p>
<p>I was asked to include a GridView control in this release, but i wasn&#8217;t able to finish it.<br />
So instead of rushing it i included the unfinished GridView sourcecode as part of the SampleControls project!<br />
This gives everyone another example of how to develop your own complex controls using Squid.</p>
<p><strong>Release note:</strong></p>
<p>- fixed a fatal bug in XmlSerializer<br />
- fixed an issue with smooth scrolling getting out of bounds on low frame rates</p>
<p>- added MouseEventArgs to OnMouseClick/MouseDown/MouseUp/MousePres/MouseDoubleClick<br />
- removed Control.OnKeyEvent<br />
- added Control.OnKeyDown and Control.OnKeyUp<br />
- MouseEventArgs carry the mouse button index<br />
- KeyEventArgs now carry the key/scancode that is down or up</p>
<p>- added GridView control sourcecode to SampleControls</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ionstar.org/?feed=rss2&#038;p=510</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Release update 04/25/2012</title>
		<link>http://www.ionstar.org/?p=496</link>
		<comments>http://www.ionstar.org/?p=496#comments</comments>
		<pubDate>Wed, 25 Apr 2012 16:02:55 +0000</pubDate>
		<dc:creator>Christian Herold</dc:creator>
				<category><![CDATA[SQUID]]></category>

		<guid isPermaLink="false">http://www.ionstar.org/?p=496</guid>
		<description><![CDATA[The new version 1.0.1 is ready for public release! See the downloads section. Below the release notes for this version. General: - fixed several exceptions in base Control class - fixed wrong Font offset caused by TextPadding.Bottom - fixed wrong Font offset<span class="ellipsis">&#8230;</span> <a href="http://www.ionstar.org/?p=496"><div class="see-more">See more &#8250;</div><!-- end of .see-more --></a>]]></description>
			<content:encoded><![CDATA[<p>The new version 1.0.1 is ready for public release!</p>
<p>See the <a title="Downloads" href="http://www.ionstar.org/?page_id=8">downloads</a> section.</p>
<p>Below the release notes for this version.</p>
<p><strong>General:<br />
</strong>- fixed several exceptions in base Control class<br />
- fixed wrong Font offset caused by TextPadding.Bottom<br />
- fixed wrong Font offset when TextAlign.MiddleLeft/Right/Center was used<br />
- fixed Font import for fontbuilder Divo files (Unity3D)<br />
- fixed Font rendering issues with large fonts (Unity3D)<br />
- added bool Slider.Ease, float Slider.EasedValue for smooth content scrolling<br />
- added Ease/EasedValue to HScrollbar and VScrollbar<br />
- added enum: Alignment.Inherit<br />
- added enum: TextureMode</p>
<p>TextureMode.Stretch : stretch texture to fit control<br />
TextureMode.Grid : use 9slice defined in style.Grid<br />
TextureMode.GridRepeat: like Grid, but repeats the borders<br />
TextureMode.Repeat : repeat texture on both axis<br />
TextureMode.RepeatX : repeat texture on X<br />
TextureMode.RepeatY : repeat texture on Y</p>
<p><strong>* Glyph (Unity3D)<br />
</strong>- added fields: Width, Height, OffsetX, OffsetY, Advance</p>
<p><strong>* Style<br />
</strong>- removed properties: GridEnabled, GridRepeat<br />
- added property: Tiling (defaults to TextureMode.Stretch)<br />
- Style.TextAlign now defaults to Inherit</p>
<p><strong>* Label<br />
</strong>- added property: TextAlign (defaults to Alignment.MiddleLeft)<br />
- Text will now use control.TextAlign if style.TextAlign is Inherit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ionstar.org/?feed=rss2&#038;p=496</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Release update 03/02/2012</title>
		<link>http://www.ionstar.org/?p=476</link>
		<comments>http://www.ionstar.org/?p=476#comments</comments>
		<pubDate>Fri, 02 Mar 2012 11:30:22 +0000</pubDate>
		<dc:creator>Christian Herold</dc:creator>
				<category><![CDATA[SQUID]]></category>

		<guid isPermaLink="false">http://www.ionstar.org/?p=476</guid>
		<description><![CDATA[Finally the latest version has arrived! The SDK download is available again. See the downloads section. Below the release notes for this version. General: - added Squid.Xml.XmlSerializer for loading/saving desktops, controls and skins - added (Label) Leading (en.wikipedia.org/wiki/Leading) - added<span class="ellipsis">&#8230;</span> <a href="http://www.ionstar.org/?p=476"><div class="see-more">See more &#8250;</div><!-- end of .see-more --></a>]]></description>
			<content:encoded><![CDATA[<p>Finally the latest version has arrived!</p>
<p>The SDK download is available again. See the <a title="Downloads" href="http://www.ionstar.org/?page_id=8">downloads</a> section.</p>
<p>Below the release notes for this version.</p>
<p><strong>General:</strong></p>
<p>- added Squid.Xml.XmlSerializer for loading/saving desktops, controls and skins<br />
- added (Label) Leading (en.wikipedia.org/wiki/Leading)<br />
- added (Label) BBCode support (font, color, url, img)<br />
- added (Label) clickable links (Label.OnLinkClicked(string url))<br />
- added style.GridRepeat (repeats left/top/right/bottom slices)<br />
- added control.TabIndex<br />
- added control.Animation<br />
- added Skin class<br />
- added VS9 and VS10 solutions<br />
- added SplitContainer.Orientation (hor/vert)<br />
- added Control.GetControl(string name). (searches any depth)<br />
- added Control.MinSize/MaxSize (only used if maxsize &gt; 0)<br />
- added DockStyle.Middle/Center<br />
- added Desktop.TooltipAlign (TopLeft/TopRight/MiddleLeft/etc.)<br />
- renamed SplitContainer.Aspect to AspectRatio<br />
- SplitContainer.Frame1 now respects MinSize/MaxSize<br />
- Desktop now also fires OnDragDrop if drop target was null</p>
<p><strong>Fixes:</strong></p>
<p>- Squid.GUI renamed to Squid.GuiHost to avoid conflicts with other libraries<br />
- fixed window resizing behaviour in respect to min/max size<br />
- fixed (Label) TextAlign (text is now properly aligned in all cases)<br />
- fixed FlowLayoutFrame not updating correctly if AutoSize != None<br />
- fixed Panel.Content not showing sometimes<br />
- fixed Opacity for drawn text<br />
- fixed InputManager examples (SlimDX, XNA)<br />
- moved StyleMap.cs to example code<br />
- replaced XNA3.1 with XNA4.0<br />
- removed System.Xml</p>
<p><strong>Notes:</strong></p>
<p>- Tab, Shift+Tab now cycle through tabs (not hierarchical)<br />
- TextAlign and TextWrap now work together<br />
- TextWrap is disabled if AutoSize != None<br />
- Controls can now be animated via coroutines (see code samples)<br />
- added XmlReader, XmlWriter, XmlSerializer, XmlIgnoreAttribute, HiddenAttribute</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ionstar.org/?feed=rss2&#038;p=476</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scissor test, batches, bitmap fonts and draw calls</title>
		<link>http://www.ionstar.org/?p=170</link>
		<comments>http://www.ionstar.org/?p=170#comments</comments>
		<pubDate>Mon, 07 Nov 2011 20:54:00 +0000</pubDate>
		<dc:creator>Christian Herold</dc:creator>
				<category><![CDATA[SQUID]]></category>

		<guid isPermaLink="false">http://www.ionstar.org/?p=170</guid>
		<description><![CDATA[Why hardware scissoring and batches don&#8217;t like each other: - Some of you might have used the XNA SpriteBatch or the SlimDX Sprite in order to batch quads. And a few of you might have wondered why changing the ScissorRect<span class="ellipsis">&#8230;</span> <a href="http://www.ionstar.org/?p=170"><div class="see-more">See more &#8250;</div><!-- end of .see-more --></a>]]></description>
			<content:encoded><![CDATA[<h3>Why hardware scissoring and batches don&#8217;t like each other:</h3>
<p>-<br />
Some of you might have used the XNA SpriteBatch or the SlimDX Sprite in order to batch quads.<br />
And a few of you might have wondered why changing the ScissorRect between batch.Draw calls doesn&#8217;t do what you expect.</p>
<p>The explanation is really simple when you understand what the batch class does under the hood:<br />
Every Batch.Draw call stores a single primitive in the batch. The next call to Batch.End then updates a dynamic vertex buffer, binds it to the device and issues a Device.Draw call.</p>
<p><strong>There is no way to change the scissor rect in between batch.Draw calls.</strong></p>
<p>The only way around this is to end the batch, change the scissor rect, and start the batch again, which is exactly what Squid does.  But this leads to more draw calls, actually as many as there are scissor rect changes.</p>
<p>In practice, the batch will also submit a Device.Draw call for every different texture that was used in Batch.Draw, in order of appearance. And this leads to even more draw calls. Some batches give you the option to sort by texture, which is convenient in some situations, but not relevant for GUI drawing. For our purposes, all we need is an alphablended painters algorithm aka everything is drawn in the order it was submitted.</p>
<p>Now, all of this is not a big problem, since you can clip your quads manually before drawing them in a batch.<br />
That way you can avoid the hardware scissor rect alltogether, but that&#8217;s where fonts become a real problem.<br />
Even in XNA 4.0 the SpriteFont class doesn&#8217;t let you do software clipping. In order to clip fonts pixel perfect,<br />
you either need to use the hardware scissor rect (which we&#8217;re trying to get rid of here) or roll your own SpriteFont class.</p>
<p><strong>The solution is a custom SpriteFont class that respects the current software scissor rectangle.</strong></p>
<p>All in all, here&#8217;s what we have to do in order to reduce draw calls, and possibly even reduce the whole GUI rendering to a single Device.Draw call:</p>
<ul>
<li>replace hardware scissor test with software clipping (scissor quads before sending them to the batch)</li>
<li>use custom spritefont (scissor glyphs  before sending them to the batch)</li>
<li>avoid texture switches (use texture array or atlas, depending on available hardware)</li>
</ul>
<h3>How is this relevant for Squid?</h3>
<p>-<br />
Whenever the scissor rect changes, Squid makes a call to Renderer.EndBatch, Renderer.Scissor, Renderer.StartBatch.<br />
This degrades the performance of batching. Imagine every single control would scissor. That&#8217;s right, this would result in 1 draw call per control, which is not acceptable.</p>
<p>So it&#8217;s very important to wisely decide which controls actually need scissor and which do not.<br />
This is why Squid lets you enable/disable the scissor testing via the Control.Scissor property, which is false by default.</p>
<p>But there is more.<br />
Because i assumed any renderer implementation would use the hardware scissor test, Squid sends you un-clipped  quads. A little known fact that will change in the next version, where Squid will send you software clipped quads with correctly adjusted UVs. Which means, everything but text will be clipped correctly, even without the hardware scissor test!  The clipping itself is boiler plate code which will be wrapped away in Squid. And Squid will still give you a scissor rect which you can use to clip font glyphs.</p>
<p>Hint: You can do all this by yourself already, if you use a custom SpriteFont equivalent!</p>
<p>Wait, when we don&#8217;t use hardware scissor, why stop the batch? The answer is we don&#8217;t have to.<br />
Squid will still make the same calls to EndBatch/Scissor/StartBatch, but you can ignore every End/Start betwen the first Start and the very last End call. I&#8217;ll show an example of this in my next blog.</p>
<p><strong>Why that is important:</strong></p>
<ol>
<li>Smart users can use Squid with software scissor on every single control at virtually no cost.</li>
<li>Very smart users can reduce the whole GUI rendering to a single Device.Draw call.</li>
<li> Unity3D renderer will be possible to implement in several ways.</li>
</ol>
<p><strong>How do i get optimal Squid performance:</strong></p>
<ol>
<li>Use software clipping, also for fonts.</li>
<li>Use less textures. Merge textures into arrays or an atlas.</li>
</ol>
<p><strong>Upcoming Squid changes: </strong></p>
<ol>
<li>Squid will send you clipped quads with clipped UVs.</li>
<li>EndBatch will change to EndBatch(bool final), to signal when the whole GUI rendering is done.</li>
<li>Squid will include a sample XNA4.0 renderer.</li>
<li>Squid will include a sample DirectX11 renderer, using PointList and Geometry Shader.</li>
</ol>
<p>I&#8217;ll explain more about #4 in my next blog: <strong>An optimal Squid renderer in DirectX11.</strong></p>
<p>Stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ionstar.org/?feed=rss2&#038;p=170</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Release Update 05/05/2011</title>
		<link>http://www.ionstar.org/?p=155</link>
		<comments>http://www.ionstar.org/?p=155#comments</comments>
		<pubDate>Thu, 05 May 2011 15:47:10 +0000</pubDate>
		<dc:creator>Christian Herold</dc:creator>
				<category><![CDATA[SQUID]]></category>

		<guid isPermaLink="false">http://www.ionstar.org/?p=155</guid>
		<description><![CDATA[Small maintenance update. Release notes: added Desktop.TooltipOffset added Window.AllowDragOut added ISquidRenderer.TranslateKey added experimental DropDownButton class renamed ComboBox to DropDownList TreeNode is no longer a text control. use TreeNodeLabel or create your own custom class. updated sample renderer sourcecode to translate<span class="ellipsis">&#8230;</span> <a href="http://www.ionstar.org/?p=155"><div class="see-more">See more &#8250;</div><!-- end of .see-more --></a>]]></description>
			<content:encoded><![CDATA[<div>
<p>Small maintenance update.</p>
<p>Release notes:</p>
<ul>
<li>added Desktop.TooltipOffset</li>
<li>added Window.AllowDragOut</li>
<li>added ISquidRenderer.TranslateKey</li>
<li>added experimental DropDownButton class</li>
<li>renamed ComboBox to DropDownList</li>
<li>TreeNode is no longer a text control. use TreeNodeLabel or create your own custom class.</li>
<li>updated sample renderer sourcecode to translate virtual keys</li>
<li>SQUID should now be be fully XBOX/Win7 compatible</li>
</ul>
<p>Grab the new download <a href="http://www.ionstar.org/?page_id=8">HERE</a> and have fun with it!</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ionstar.org/?feed=rss2&#038;p=155</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Release Update 06/24/2010</title>
		<link>http://www.ionstar.org/?p=111</link>
		<comments>http://www.ionstar.org/?p=111#comments</comments>
		<pubDate>Thu, 24 Jun 2010 14:21:09 +0000</pubDate>
		<dc:creator>Christian Herold</dc:creator>
				<category><![CDATA[SQUID]]></category>

		<guid isPermaLink="false">http://www.ionstar.org/?p=111</guid>
		<description><![CDATA[Here&#8217;s another major update for SQUID! We completely revamped the samples, moved everything into one solution and included sample projects for Truevision3D, XNA3.1 and SlimDX. Added a few new controls, drag&#38;drop and a brand new and slick looking style. Screenshot<span class="ellipsis">&#8230;</span> <a href="http://www.ionstar.org/?p=111"><div class="see-more">See more &#8250;</div><!-- end of .see-more --></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another major update for SQUID!</p>
<p>We completely revamped the samples, moved everything into one solution and included sample projects for Truevision3D, XNA3.1 and SlimDX. Added a few new controls, drag&amp;drop and a brand new and slick looking style.</p>
<p>Screenshot of the code samples in action:</p>
<p><a href="http://chlabs.de/ionstar/wp-content/squidxna.jpg"><img class="alignnone size-medium wp-image-120" title="squidxna" src="http://chlabs.de/ionstar/wp-content/squidxna-300x172.jpg" alt="" width="300" height="172" /></a></p>
<p>Release notes:</p>
<ul>
<li>added TabControl</li>
<li>added HScrollBar control</li>
<li>added Panel control</li>
<li>added Drag &amp; Drop</li>
<li>added SlimDX sample</li>
<li>added XNA 3.1 sample</li>
<li>added a completely new style</li>
<li>lots of bug fixes</li>
</ul>
<p>Grab the new download <strong><a href="http://www.ionstar.org/?page_id=8">HERE</a> </strong>and have fun with it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ionstar.org/?feed=rss2&#038;p=111</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Dialogs and Modality</title>
		<link>http://www.ionstar.org/?p=70</link>
		<comments>http://www.ionstar.org/?p=70#comments</comments>
		<pubDate>Sun, 30 May 2010 01:48:27 +0000</pubDate>
		<dc:creator>Christian Herold</dc:creator>
				<category><![CDATA[SQUID]]></category>

		<guid isPermaLink="false">http://www.ionstar.org/?p=70</guid>
		<description><![CDATA[The latest version introduces a new type of control, the Dialog class. Dialogs are Windows that provide a way to dispatch a DialogResult. Take a look at the source code: public abstract class Dialog : Window { private DialogResult _dialogResult;<span class="ellipsis">&#8230;</span> <a href="http://www.ionstar.org/?p=70"><div class="see-more">See more &#8250;</div><!-- end of .see-more --></a>]]></description>
			<content:encoded><![CDATA[<p>The latest version introduces a new type of control, the <strong>Dialog </strong>class.<br />
Dialogs are Windows that provide a way to dispatch a <strong>DialogResult</strong>.</p>
<p>Take a look at the source code:</p>
<pre class="brush:csharp"> public abstract class Dialog : Window
    {
        private DialogResult _dialogResult;

        public delegate void DialogResultEventHandler(Dialog sender, DialogResult result);
        public event DialogResultEventHandler OnDialogResult;

        protected DialogResult DialogResult
        {
            get
            {
                return _dialogResult;
            }
            set
            {
                if (_dialogResult == value) return;

                _dialogResult = value;

                if (OnDialogResult != null)
                    OnDialogResult(this, _dialogResult);
            }
        }

        public override void Show(Desktop target)
        {
            _dialogResult = DialogResult.None;
            base.Show(target);
        }
    }</pre>
<p>As you can see, it&#8217;s a rather naked class, but the event is valuable once you start using modal dialogs, such as confirmation dialogs, notification popups, etc.</p>
<p>For obvious reasons, we cannot stall the game loop in order to wait for user input.<br />
Instead we use a straight forward delegate to catch the dialog result.<br />
Lets take a look at  how you make use of this.</p>
<p>We start by writing our own little Dialog:</p>
<pre class="brush:csharp">    public class MyDialog : Dialog
    {
        protected override void Initialize()
        {
            // set some default size
            Size = new Point(200, 100);

            Button buttonCancel = new Button();
            buttonCancel.Text = "Cancel";
            buttonCancel.Size = new Point(200, 35);
            buttonCancel.Dock = DockStyle.Bottom;
            Controls.Add(buttonCancel);

            Button buttonOK = new Button();
            buttonOK.Text = "OK";
            buttonOK.Size = new Point(200, 35);
            buttonOK.Dock = DockStyle.Bottom;
            Controls.Add(buttonOK);

            // set the dialog result as needed
            buttonCancel.OnMouseClick += delegate(Control sender) { DialogResult = DialogResult.Cancel; };
            buttonOK.OnMouseClick += delegate(Control sender) { DialogResult = DialogResult.OK; };
        }
    }</pre>
<p>Phew, that was straight forward.</p>
<p>And here is how we open the dialog and handle possible results :</p>
<pre class="brush:csharp">        MyDialog dialog = new MyDialog();
        dialog.Modal = true;
        // handle the result
        dialog.OnDialogResult+=new Dialog.DialogResultEventHandler(dialog_OnDialogResult);
        dialog.Show(this);

        void dialog_OnDialogResult(Dialog sender, DialogResult result)
        {
            // do something
        }</pre>
<p>And that&#8217;s it already!<br />
Note that the Dialog will have to be closed in order to access the rest of the GUI again:</p>
<pre class="brush:csharp">        void dialog_OnDialogResult(Dialog sender, DialogResult result)
        {
            // do something with result
            // and close it
            sender.Close();
        }</pre>
<p>You can open as many modal dialogs as you like, and they have to be closed in order of appearance. Exactly like you&#8217;re used to from your operating system.</p>
<p>Take a good look at the <strong>MessageBox</strong> class in the latest version of the demo application. It shows how to inherit Dialog and create a resemblence of the  Windows.Forms.MessageBox functionality.</p>
<p>Just grab the latest version and have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ionstar.org/?feed=rss2&#038;p=70</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
