Example #1
0
        public Button(string text, Font font, Vector2D position, Action click)
        {
            this.click = click;

            {
                var ts = new TextSprite(text, font, new Vector2D(0, 0), TextSprite.Type.Separation, null);
                layer.Add(ts, 20);

                var size = ts.GetRect().Size;
                ts.Rect.Position = new Vector2D((1600 - size.X) / 2, position.Y);

                textSpriteNewGame = ts;
            }
            {
                var font2 = new Font(
                    font.fontPath,
                    font.fontSize,
                    new Color(1, 1, 1, 1),
                    new Font.FontFrame[] {
                    new Font.FontFrame(4, new Color(1.0, 1.0, 1.0, 1.0)),
                    new Font.FontFrame(1, new Color(0.5, 1.0, 1.0, 1.0))
                },
                    font.lineTextMargin);
                var x  = position.X;
                var y  = position.Y;
                var ts = new TextSprite(text, font2, new Vector2D(0, 0), TextSprite.Type.Separation, null);
                layer.Add(ts, 30);

                var size = ts.GetRect().Size;
                ts.Rect.Position = new Vector2D((1600 - size.X) / 2, position.Y);

                textSpriteNewGameEffect        = ts;
                textSpriteNewGameEffect.IsDraw = false;
            }
        }
Example #2
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;
            }
        }
Example #3
0
 public SkillCards()
 {
     {
         var sprite = new PlaneSprite(new Rect(new Vector2D(0, 0), new Vector2D(1600, 900)), new Color(0.5, 0, 0, 0));
         sprite.IsDraw = false;
         layer.Add(sprite, 0);
         BackGroundSprite = sprite;
     }
 }
Example #4
0
        public TitleScene()
        {
            {
                var bmp     = new System.Drawing.Bitmap(Config.MainConfig.TitleScene.TitleBackgroundImage);
                var texture = new Texture(bmp);
                var w       = 1600;
                var h       = (int)((double)texture.Size.Y / (double)texture.Size.X * 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, 5);
            }

            {
                bgm = new SoundPlayer(Config.MainConfig.TitleScene.TitleBGM, 0.5f, true, Emugen.Sound.SoundPlayer.SoundType.BGM);
            }

            {
                var position = new Vector2D(0, 0);
                var font     = new Font(
                    Config.MainConfig.MainFontPath,
                    45,
                    new Color(1, 1, 1, 1),
                    new Font.FontFrame[] {
                    new Font.FontFrame(4, new Color(1, 0, 0.5, 1.0))
                },
                    5);
                var button = new UI.Common.Button("New Game", font, new Vector2D(0, 600), () => {
                    new Emugen.Sound.SoundPlayer(Config.MainConfig.TitleScene.SelectSE, 0.5f, false, Emugen.Sound.SoundPlayer.SoundType.SE);
                    bgm.Stop();
                    WindowManager.nextScene = new Scene.TalkScene(Config.MainConfig.TitleScene.NewGameStartScript);
                });
                layer.Add(button, 20);
                mySprites.ButtonNewGame = button;
            }

            {
                var position = new Vector2D(0, 0);
                var font     = new Font(
                    Config.MainConfig.MainFontPath,
                    45,
                    new Color(1, 1, 1, 1),
                    new Font.FontFrame[] {
                    new Font.FontFrame(4, new Color(1, 0, 0.5, 1.0))
                },
                    5);
                var button = new UI.Common.Button("Exit", font, new Vector2D(0, 600 + 100), () => {
                    new Emugen.Sound.SoundPlayer(Config.MainConfig.TitleScene.SelectSE, 0.5f, false, Emugen.Sound.SoundPlayer.SoundType.SE);
                    bgm.Stop();

                    Emugen.Thread.Sleep.Do(100);
                    Emugen.OpenTK.WindowManager.Close();
                });
                layer.Add(button, 20);
                mySprites.ButtonExit = button;
            }
        }
Example #5
0
        public Damage(int value, Vector2D position, AutoDisposer autoDisposer)
        {
            this.SetupUpdateAndAutoDispose(autoDisposer);
            this.position = position;

            {
                var font = new Font(
                    Config.MainConfig.MainFontPath,
                    35,
                    new Color(1, 1, 1, 1),
                    new Font.FontFrame[] {
                    new Font.FontFrame(5, new Color(1, 1, 1, 1)),
                    //new Font.FontFrame(2, new Color(1, 0.5, 0.5, 0.5)),
                    new Font.FontFrame(5, new Color(1, 0, 0, 0))
                },
                    0);
                var x  = position.X;
                var y  = position.Y;
                var ts = new TextSprite(value.ToString(), font, new Vector2D(x, y));
                layer.Add(ts, 20);

                ts.Rect.Position.X -= ts.GetRect().Size.X / 2;

                textSprite = ts;
            }
        }
Example #6
0
        public Choice(string[] texts)
        {
            var i = 0;

            foreach (var text in texts)
            {
                var item = new Item();
                {
                    var x = 500;
                    var y = 300 + i * 60;

                    var font = new Font(Config.MainConfig.MainFontPath, 26, new Color(1, 1, 1, 1), new Font.FontFrame[] {
                        new Font.FontFrame(2, new Color(1, 0, 0, 0)),
                    }, 0);
                    var ts = new TextSprite(text, font, new Vector2D(x, y));


                    layer.Add(ts, 20);


                    item.TextSprite = ts;
                }
                {
                    var x      = 500;
                    var y      = 300 + i * 60;
                    var sprite = new PlaneLineSprite(new Rect(new Vector2D(x, y), new Vector2D(600, 50)), new Color(0.5, 1, 1, 1));
                    layer.Add(sprite, 20);
                    item.PlaneLineSprite = sprite;
                }
                {
                    var x      = 500;
                    var y      = 300 + i * 60;
                    var sprite = new PlaneSprite(new Rect(new Vector2D(x, y), new Vector2D(600, 50)), new Color(0.5, 0, 0, 0));
                    layer.Add(sprite, 5);
                    item.BackPlaneSprite = sprite;
                }
                item.Text = text;

                items.Add(item);

                i++;
            }
        }
Example #7
0
        public void Add(Data.Character character)
        {
            var num     = cards.Count;
            var wMargin = 200;
            var y       = 600;
            var x       = 50;

            var sprite = new PlayerCard(new Vector2D(x + wMargin * num, y), character);

            layer.Add(sprite, 10);
            cards.Add(sprite);
        }
Example #8
0
        public void Add(Data.Character character)
        {
            var num     = cards.Count;
            var wMargin = 200;
            var y       = 600;
            var x       = 50;

            var bmp    = new System.Drawing.Bitmap(character.imagePath);
            var sprite = new EnemyCard(bmp, new Vector2D(x + wMargin * num, y), character.Name, character);

            layer.Add(sprite, 10);
            cards.Add(sprite);
            character.enemyCard = sprite;
            SetupCardPos();
        }