nKast

pixel perf-ect

13. August 2024 14:04
by nKast
0 Comments

What's new in KNI v3.13

13. August 2024 14:04 by nKast | 0 Comments

  The new version of KNI 3.13.9001 brings bug fixes, performance improvements and implementetion of missing features. A more detailed list of the changes is available on the changelog.

Download KNI v3.13 today.
See migrate to v3.13 on how to upgrade your current projects.

BlazorGL

  The BlazorGL target was introduced in v3.8 two years ago, with very basic functionality. Early adopters provided valuable feedback to identify what the common usage cases are, and set the priorities to incremental improvements for each release.
  HiDef graphics profile is partially supported in this version through WebGL2, which brings 32bit indexes, 4K textures and larger buffers.
  SetData(...) with startIndex in Buffers and DrawUserPrimitives(...) with vertexOffset are implemented, allowing for complex rendering scenarios.
  GamePad input is implemented.
  

Templates

  Some cleanup was done in the templates that of was necessary to focus on future improvements.  The Visual studio 2019 templates were removed in this release. Currently we have VS2022 templates. The plan is, to eventually port those to dotnet templates.
  Also the Xamarin templates for Android/iOS were removed and if future versions the Xamarin targets will be removed from the nuget packages. If you haven't already, you should port your Xamarin projects to net8.

Performance

  There are a number of minor performance improvements in this release. One that was actually surprising, is the effect of switching to glDrawRangeElements on mobile/GLes devices. To ensure that you see that improvement on your custom drawing code, you have to use the extended overload of DrawIndexedPrimitives(...).


  Memory allocations of MediaPlayer has been reduced on DesktopGL. The reuse of buffers has also reduced the audible gap of looped songs.

The performance tests can be found in the KniBenchmarks project on github.
Framework versions: KNI 3.13.9001, MonoGame 3.8.1.303
All tests were performed on the following system:

CPU/GPU: ARM Mali-G52 MC2 (2Ghz)

Kni.Extended and FlatRedBall

  Recently we have seen great things from MonoGame.Extended. The new maintainer @AristurtleDev, is determined to address outstanding issues, cleaned up the code and provide helpful documentation. The latest release support FNA & KNI out of the box.

    Another great additions to the ecosystem is GumUI and FlatRedBall. The detailed bug reports from the maintainer @vchelaru was vital to drive many of the improvements in this release. FlatRedBall & GumUI is currently one of the few C# Game Engines/Editors with the option to build games and rich interactive experiences for the Web.

Sponsors

While KNI is free and open-source, maintaining and expanding the framework requires ongoing effort and resources. We rely on the support of our community to continue delivering top-notch updates, features, and support.
By becoming a Sponsor, you can directly contribute to the growth and sustainability of the KNI Game Framework. 

 

16. February 2009 13:25
by nKast
0 Comments

Στοιβάζοντας movieclips στο Flash

16. February 2009 13:25 by nKast | 0 Comments

Αν είσαι Flash developer τοτε οι παρακάτω γραμμές κώδικα θα πρέπει κάτι να σου θυμίζουν:

var xPos:Number = 0;
for( var childNode:Xml in rootNode.elements() )

var tmpmc:Movieclip = new MenuBtn();
tmpmc.label.text = childNode.get("Label");
menuPlaceholder.addChild(tmpmc);
//...
tmpmc.x = xPos;
xPos += tmpmc.height + 6;
}


Κατι παρόμοιο έχεις συναντήσει είτε οταν φτιάχνεις ενα δυναμικό μενού που αντλεί στοιχεία απο ενα xml, είτε ενα γκάλερυ για φωτογραφίες.

Αυτή η προσέγγιση όμως πάντα με προβλημάτιζε, έτσι έφτιαξα μια μικρή βιβλιοθήκη που χειρίζεται τέτοιες καταστάσεις με ποιό κομψό τρόπο. Ακολουθεί ενα μικρό demo του τί μπορεί να κάνει..

Get Adobe Flash player

Το πρωτο παράδειγμα θα μπορούσε να γραφεί κάπως ετσι:

var sh:StackHorizontal = new StackHorizontal(menuPlaceholder,6);
for( var childNode:Xml in rootNode.elements() )
{
var tmpmc:Movieclip = new MenuBtn();
tmpmc.label.text = childNode.get("Label);
sh.addChild(tmpmc);
//... 
}

Πολύ καλύτερα, ε;
Προσέξτε οτι δεν καλώ την addChild του menuPlaceholder αλλα της sh.

Η βιβλιοθήκη είναι γραμμένη εξωλοκλήρου σε HaXe και μπορείτε να την βρείτε στο www.codeplex.com/nkHaxeLibrary. Είναι λίγο φτωχή για την ώρα, αλλα με τον καιρό θα εμπλουτιστεί. Θα ακολουθήσουν νέα παραδείγματα καθώς θα προσθέτω νέες κλάσεις.