Added C#/Unity versions


This version is quite alike to the GameMaker one, consisting of 2 (3) static functions total:

  • WindowIconTools.SetIcon(texture2d or null, kind)
    Changes small or big icon for the window.
    In non-Unity C#, you provide an array of bgra bytes, width, and height instead of a texture.
  • WindowIconTools.SetOverlayIcon(texture2d or null, opt. description)
    Changes the overlay icon in the taskbar.
  • WindowIconTools.SetProgress(progressState, numCompleted, numTotal)
    This is an equivalent of the other extension I made and is only here because it didn't really "cost" anything to add.

You can also peck at the sample project if you want - it has an example of using a render texture to continuously update the icon.


Things I learnt along the way:

  • Unity stores texture pixels upside-down.
  • You can't set a texture to import in BGRA format.
  • Getting a handle of game window is a mess and always have been.
  • Getting arguments or function order wrong for externs may not throw any error and is generally very confusing.

Files

window_set_icon.gmez 41 kB
Aug 13, 2020
window_set_icon.yymp 49 kB
Aug 13, 2020
WindowIconToolsUnity.unitypackage 2.9 kB
Aug 16, 2020
WindowIconTools.cs 10 kB
Aug 16, 2020

Get window_set_icon (GameMaker,C#,Unity)

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.