Ejemplo n.º 1
0
        public override void AddElement(Data.Element element)
        {
            var elementNameToFilePath = new Dictionary <string, string>();

            foreach (var i in Config.MainConfig.Elements)
            {
                elementNameToFilePath.Add(i.Word, i.ImagePath);
            }

            var bmp     = new System.Drawing.Bitmap(elementNameToFilePath[element.Name]);
            var texture = new Texture(bmp);
            var w       = 30;
            var h       = (int)((double)bmp.Height / (double)bmp.Width * w);
            var sprite  = new ImageSprite(texture, new Rect(new Vector2D(0, 0), new Vector2D(w, h)), new Color(1, 1, 1, 1));

            layer.Add(sprite, 10);
            mySprites.element.Add(sprite);

            SetPosition(this.position);
        }
Ejemplo n.º 2
0
 virtual public void AddElement(Data.Element element)
 {
 }