/// <summary>
 /// Creates instance of the GameActionIconBox and store reference on action. Also adds MouseClick action GameActionClicked.
 /// </summary>
 /// <param name="action"></param>
 public GameActionIconBox(IGameAction action)
 {
     this.action = action;
     Load(action.IconPath());
     Size = new Miyagi.Common.Data.Size(25, 25);
     MouseClick += GameActionClicked;
 }
Beispiel #2
0
 /// <summary>
 /// Creates instance of the GameActionIconBox and store reference on action. Also adds MouseClick action GameActionClicked.
 /// </summary>
 /// <param name="action"></param>
 public GameActionIconBox(IGameAction action)
 {
     this.action = action;
     Load(action.IconPath());
     Size        = new Miyagi.Common.Data.Size(25, 25);
     MouseClick += GameActionClicked;
 }
Beispiel #3
0
        private static void LoadDefaultTexture(string texName, Backend backend, Stream stream)
        {
            if (backend.TextureExists(texName))
            {
                return;
            }

            var image   = (Bitmap)Image.FromStream(stream);
            var size    = new Miyagi.Common.Data.Size(image.Size.Width, image.Size.Height);
            var texture = backend.CreateTexture(texName, size);

            backend.WriteToTexture(image.ToByteArray(), texture);

            stream.Close();
        }