Author Topic: AltGUI + AltSketch - new power for the NGUI – Just Draw It!  (Read 5106 times)


  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 2
    • View Profile
Hi NGUI Community!

AltSoftLab Team is pleased to present our AltGUI Framework based (and included in AltGUI SDK) on the AltSketch Vector Graphics Library with integration into NGUI as independent powerful controls. So now you can forget about font atlases, vertex and texture buffers and too much complicated mathematics! Just Draw your controls with pens & brushes! Make control updates (redrawing) only when it's realy needs (not every frame)! Use a wide variety of powerful libraries (HTML, SVG, Chart/Plot, advanced Text Editors, interactive GIS with trackings, Geometry Transformations, etc.) that already exists in AltGUI SDK & create/port the new ones. Also you can create and test AltGUI controls without Unity Editor as separate application (because AltGUI Core is not depends on any integration and backend UI) and then use it in Unity. And of course you can use AltNETType (our port to .NET of FreeType font engine - you can no more to care about native FreeType libraries on different platforms) dirrectly on the fly creating all characters of TrueType fonts of any language and any glyph variety; native formats image load/save and transform operations; ZIP-ed virtual file storage; and many more other features. Please look down into more details.

AltGUI Web Demo contains hundreds of examples of AltGUI & AltSketch in different ways of uses.

Some screenshots are represented below. Look more in AltSoftLab Screenshots Gallery

AltGUI Full SDK is already available on AltSoftLab. AltGUI Unity SDK will be available soon on Unity Asset Store. Unity SDK is a subset of Full SDK, but has the same pricing.


 AltGUI & AltSketch are pure C# CLS compliant 100% managed .NET 2.0 Subset, without unsafe blocks GUI Framework and Vector Graphics Library with Software and Hardware Render Backends for Games, Scientific Applications & other uses of Computer Graphics. All core functionality collected in two lightweight libraries AltSketch.dll and AltGUI.dll. It depends only on System assembly and has own Alt.Data & Alt.Xml multiplatform realizations.

 AltSketch has System.Drawing (GDI+) like program interface and Software & Hardware Render Backends (solid and texure AA visual data triangulation), contains a subsystem AltNETType - port of wonderful font rendering library Freetype (not need any predefined font atlases with limited chars amount/size/style) and subsystem AltNETImage for Image manipulations (loading, saving, transformations). With AltSketch you can load any fonts or images in a popular graphic formats on the fly just from files, streams, buffers, etc. Using AltSketch you can draw Graphics with Brushes and Pens like you do it with any drawing library. As AltSketch has several integrations with most popular GUI systems and Mobile platforms, you can develop and test a drawing part of your 3D application/game as independent program, and then easy integrate it into your main solution. It is flexible and useful development method in case of main project bulking and test complexity, or useful for team development process.

 AltGUI has a Virtual File System support with Zip containers for resources loading. All AltGUI functionality & extensions works via VirtualFS and all resources can be loaded as from real file system, so from Zip containers (from files or memory streams).

 AltGUI – NGUI integrated Professional GUI Framework with Windows Forms like API and hundreds of controls. With AltGUI you can develop, use and distribute controls for NGUI (and native AltGUI and AltOS) applications (yours receivers just must have AltGUI SDK). With AltGUI you no more need any specific not flexible and hard coded operations with vertex and texture buffers/objects – just draw your controls with pens, brushes, fonts, boolean geometries, etc. with the single API like it processed with System.Drawing (GDI+) in Windows Forms or draw funcs and shapes in WPF. AltGUI can be used directly without any other GUI (useful in developing process). AltGUI controls can be used in NGUI like Windows Forms controls can be used in WPF or WPF controls can be used in Windows Forms. Using AltGUI you can create professional applications with powerful UI.

 Because AltGUI has Windows.Forms like API and functionality (in conjunction with AltSketch that is similar to System.Drawing GDI+) it's easy to understand it and port to AltGUI a wide variety of useful libraries and solutions.

 AltGUI SDK includes wide variety of extensions: ported to AltGUI popular libraries (GUI, Plot, GIS, Computer Science, Physics, Graphics etc.):
  • HTML Renderer
  • ICSharpCode TextEditor
  • GMap.NET
  • NPlot
  • OxyPlot
  • PieChart
  • ZedGraph
  • PDFsharp
  • Box2D
  • Farseer Physics
  • AForge.NET
  • Gwen GUI
  • etc.


 Okay, do you want to know how it's possible to create AltGUI controls usable for NGUI and so on? Let's go.

 AltGUI for NGUI have 2 major UI elements:
  • AltSketch Paint
  • AltGUI Control Host (derived from AltSketch Paint)
AltSketch Paint is the base drawing visual control. It makes all for the drawing process and can be used dirrectly as separated UI Element. There are 2 major parameters for it:
  • Max FPS - defines maximum refresh calls per second. For invalidating AltSketch Paint you must to call its function Invalidate(). Without this call AltSketch Paint will redraw only on start or when it resized. But if you call Invalidate() on every Update, it will redraw self no more then MaxFPS times per second. So you can call Invalidate so often, as you want - it invalidates not often than MaxFPS times per second. It's useful for the most UI controls, because it's state changes not so often, but can contain many drawing operations. By default we set this parapeter to 60 fps (just the middle of 30 and 120). You can change it to any other value per control.
  • Render Type - Software or Hardware. As you could understand we use buffered graphics for controls. You can draw any compound graphics with just 1 draw call per frame. All control render makes to a Texture. In Unity AltSketch can render in 2 ways: Software rendering to Texture2D using AltSketch powerful and fast internal Software render, or Hardware rendering to RenderTexture. Software Render in many cases faster than HW (because it’s no reason of triangulation and other addition procedures). Also no HW Draw Calls used. So SW render used by default for controls. You can change it in the Object Inspector per control. Also you can change it on the fly.
    You can attach script to AltSketch Paint control and connect to onPaint event to process painting process. In Update func of script you can call Invalidate() func of AltPaint when you need to redraw your AltSketch Paint element. In the AltGUI SDK look at AltSketch Paint example - it's very simple.

 The second major element is AltGUI Control Host. It uses AltSketch Paint for render itself and can process the most variety of UI events (keyboard, pointer, etc.). And it serves as host for AltGUI controls. The main property of this control is 'Child'. You can put AltGUI Control Host control to the scene, attach script that creates AltGUI control and set its instance to AltGUI Control Host 'Child' property. AltGUI control don't know anything about AltGUI Control Host, but can live in it usefully receiving all events.
  1. public class MyScript : MonoBehaviour
  2. {
  3.     void Start ()
  4.     {
  5.         gameObject.GetComponent<AltGUIControlHostNGUI>().Child = new MyAltGUIControl();
  6.     }
  7. }
Another way is to create NGUI control is to derive it from AltGUI Control Host and initialize 'Child' property in OnStart() function of it. Also you can add some cross-calls and Unity Editor properties to it to make this UI control more professional and useful. AltGUI SDK contains several such controls ready to use dirrectly in NGUI:

 So we already know all about host controls for the both UI systems. The last thing we must to do is just to create a new AltGUI control. It's very easy:
  1.     public class MyAltGUIControl : Alt.GUI.UserControl // or can be derived from Alt.GUI.Control
  2.     {
  3.         public MyControl()
  4.         {
  5.             //  your code
  6.         }
  8.         protected override void OnPaint(Alt.GUI.PaintEventArgs e)
  9.         {
  10.             base.OnPaint(e);
  12.             //  your code
  13.         }
  15.         protected override void OnPaintBackground(Alt.GUI.PaintEventArgs pevent)
  16.         ...
  17.         protected override void OnResize(Alt.GUI.ResizeEventArgs e)
  18.         ...
  19.         protected override void OnKeyDown(Alt.GUI.KeyEventArgs e)
  20.         ...
  21.         protected override void OnKeyUp(Alt.GUI.KeyEventArgs e)
  22.         ...
  23.         protected override void OnKeyPress(Alt.GUI.KeyPressEventArgs e)
  24.         ...
  25.         protected override void OnMouseDown(Alt.GUI.MouseEventArgs e)
  26.         ...
  27.         protected override void OnMouseUp(Alt.GUI.MouseEventArgs e)
  28.         ...
  29.         protected override void OnMouseMove(Alt.GUI.MouseEventArgs e)
  30.         ...
  31.         protected override void OnMouseWheel(Alt.GUI.MouseEventArgs e)
  32.         ...
  33.         protected override void OnMouseClick(Alt.GUI.MouseEventArgs e)
  34.         ...
  35.         protected override void OnMouseDoubleClick(Alt.GUI.MouseEventArgs e)
  36.         ...
  37.         protected override void OnMouseEnter(System.EventArgs e)
  38.         ...
  39.         protected override void OnMouseLeave(System.EventArgs e)
  40.         ...
  41.         protected override void OnMouseHover(System.EventArgs e)
  42.         ...
  44.         //  And hundreds additional event overrides...
  45.     }
In addition to overrides of event hadlers AltGUI cotrols contain events in the same notation:
  1.         Alt.GUI.PaintEventHandler Paint;
  2.         ...
  3.         Alt.GUI.KeyEventHandler KeyDown;
  4.         ...
  5.         Alt.GUI.MouseEventHandler MouseDown;
  6.         ...
Almost all properties/events/functions of each AltGUI control is <summary> documented and can be viewed by intellisense or Assembly View. All functionality and API is like Windows.Forms controls, so it's easy to understand it's work.

 Let's try AltGUI and enjoy it! ;)


 AltGUI has a wide variety native controls (Docking Windows, Menus, Advanced Editors, Lists, Trees, Data & Property Grids, Buttons, Tabs, File/Font/Color/Other Dialogs, etc.), Data bindings, hundreds of properties, events and funcs. All AltGUI controls can have HTML4/CSS2 backround. XAML, Animations, View Models, and pther functionality is under develop. Any AltGUI control can be used in NGUI.

 All that will be demonstrated soon in new demo with new AltGUI tool AltOS. AltOS is an like Virtual Environment for AltGUI native applications like SilverOS but more functional and flexible. All AltGUI applications working in AltOS in cooperative multitasking - all AltGUI applications working in one thread. Preemptive multitasking (each app working in its own thread) is in the roadmap.

 Also the most amazing AltGUI tool is AltStudio! It's the first developing tool based on absolutely Virtual GUI. AltStudio will be integrated into Unity Editor and will have a powerful Designer Tools for AltGUI and source code editor. And it's coming soon too with new AltGUI examples and applications!

 And of course AltOS and AltStudio tools will be the part of AltGUI SDK.

 So let’s make the Unity World better!

Some screenshots are represented below. Look more in AltSoftLab Screenshots Gallery

AltGUI Unity NGUI Integration - Vector Text Double Path Transform

AltGUI Unity NGUI Integration - GMap

AltGUI Unity NGUI Integration - HTML Panel

AltGUI Unity NGUI Integration - ICSharpCode TextEditor

AltGUI Unity NGUI Integration - NPlot

AltGUI Unity NGUI Integration - OxyPlot

AltGUI Unity NGUI Integration - 3D Pie Chart

AltGUI Unity NGUI Integration - QuickFont

AltGUI Unity NGUI Integration - OxyPlot Map

AltGUI Unity NGUI Integration - Farseer Physics

AltGUI Unity NGUI Integration - Box2D

AltGUI Unity NGUI Integration - SVG

AltGUI Unity NGUI Integration - Awesomium

AltGUI Unity NGUI Integration - AForge Filtered PictureBox
« Last Edit: June 08, 2015, 05:16:03 AM by AltSoftLab »


  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: AltGUI + AltSketch - new power for the NGUI – Just Draw It!
« Reply #1 on: June 07, 2015, 12:56:51 PM »
This looks pretty awesome and very powerful. Well done!


  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: AltGUI + AltSketch - new power for the NGUI – Just Draw It!
« Reply #2 on: June 08, 2015, 05:17:31 AM »
This looks pretty awesome and very powerful. Well done!

Thank you ArenMook! Soon many new features and more power!

AltSoftLab Team