Ejemplo n.º 1
0
        public SkillCard(System.Drawing.Bitmap cardImage, Vector2D position, string viewName, string cost, Data.Character ownerCharacter, Data.ActionSkill actionSkill)
        {
            this.cardImage      = cardImage;
            this.position       = position;
            this.ownerCharacter = ownerCharacter;
            this.cost           = cost;
            this.actionSkill    = actionSkill;

            {
                var bmp     = cardImage;
                var texture = new Texture(bmp);
                var w       = 160;
                var h       = (int)((double)bmp.Height / (double)bmp.Width * w);
                var sprite  = new ImageSprite(texture, new Rect(new Vector2D(position.X, position.Y), new Vector2D(w, h)), new Color(1, 1, 1, 1));
                layer.Add(sprite, 10);

                size           = new Vector2D(w, h);
                mySprites.face = sprite;
            }

            {
                var x    = position.X - 5;
                var y    = position.Y + 200;
                var font = new Font(Config.MainConfig.MainFontPath, 16, new Color(1, 1, 1, 1), new Font.FontFrame[] {
                    new Font.FontFrame(2, new Color(1, 0, 0, 0)),
                }, 0);
                var ts = new TextSprite(viewName, font, new Vector2D(x, y));

                layer.Add(ts, 20);
                mySprites.viewName = ts;
            }
            {
                var x      = position.X;
                var y      = position.Y + 227;
                var w      = size.X;
                var h      = 1;
                var sprite = new PlaneSprite(new Rect(new Vector2D(x, y), new Vector2D(w, h)), new Color(0.3, 1, 1, 1));
                layer.Add(sprite, 10);
                mySprites.bar = sprite;
            }
            {
                var x    = position.X - 5;
                var y    = position.Y + 225;
                var font = new Font(Config.MainConfig.MainFontPath, 12, new Color(1, 1, 1, 1), new Font.FontFrame[] {
                    new Font.FontFrame(2, new Color(1, 0, 0, 0)),
                }, 0);
                var ts = new TextSprite(cost, font, new Vector2D(x, y));
                //var ts = new TextSprite(cost, "data/font/rounded-mgenplus-1cp-medium.ttf", 12, new Vector2D(x, y), new Color(1, 1, 1, 1));
                layer.Add(ts, 20);
                mySprites.ViewStatus = ts;
            }

            {
                var sprite = new PlaneLineSprite(new Rect(position, size), new Color(0.5, 1, 1, 1));
                layer.Add(sprite, 30);
                mySprites.mouseOn = sprite;
            }
        }
Ejemplo n.º 2
0
 public override void ActionEffect(Action action, Data.ActionSkill actionSkill)
 {
     SetPosition(this.position);
     if (actionSkill.Main.EffectWord.IndexOf("HPダメージ") == 0)
     {
         actionEffectUpdate = new ActionEffectUpdate("data/script/action_pc_攻撃.cs", action, autoDisposer);
     }
     else if (actionSkill.Main.EffectWord.IndexOf("HP回復") == 0)
     {
         actionEffectUpdate = new ActionEffectUpdate("data/script/action_pc_回復.cs", action, autoDisposer);
     }
 }
Ejemplo n.º 3
0
        public void Add(System.Drawing.Bitmap bmp, Data.Character character, Data.ActionSkill actionSkill)
        {
            var texture = new Texture(bmp);
            var w       = 180;
            //var w = 160;
            var h      = (int)((double)bmp.Height / (double)bmp.Width * w);
            var x      = 1;
            var y      = 1;
            var sprite = new SkillCard(bmp, new Vector2D(x, y), actionSkill.Name, actionSkill.Cost, character, actionSkill);

            layer.Add(sprite, 10);
            cards.Add(sprite);
            sprite.Update();

            sprite.SetEnable(false);
        }
Ejemplo n.º 4
0
 virtual public void ActionEffect(Action action, Data.ActionSkill actionSkill)
 {
 }