示例#1
0
        public static void TiledFont()
        {
            using (var tiledImage = new MagickImage("xc:lightblue", 400, 175))
            {
                var textImage = new MagickImage("pattern:checkerboard", 400, 175);
                //textImage.Annotate("ddd", Gravity.Center);

                //var text = new DrawableText(0, 0, "DrawnText");
                var circle        = new DrawableCircle(tiledImage.Width / 2, 0, 5, 5);
                var drawText      = new DrawableText(tiledImage.Width / 2, tiledImage.Height / 2, "What");
                var drawTextColor = new DrawableTextDecoration(TextDecoration.Overline);

                textImage.Draw(circle, drawText);
                textImage.Write("textImage.png");

                tiledImage.Write("tileFont.png");
            }


            var settings = new MagickReadSettings();

            settings.Width         = 400;
            settings.Height        = 175;
            settings.FontPointsize = 72;
        }
示例#2
0
        static void Main(string[] args)
        {
            DrawableCircle    circle    = new DrawableCircle(0, 0, 3);
            DrawableLine      line      = new DrawableLine(0, 0, 1, 1);
            DrawableRectangle rectangle = new DrawableRectangle(5, 5, 2, 2);
            DrawableRing      ring      = new DrawableRing(3, 4, 5, 2);
            DrawableRound     round     = new DrawableRound(2, 8, 8);

            VectorGraphicsEditor.Draw(circle, line, rectangle, ring, round);
        }
示例#3
0
        protected override void OnLoadContent()
        {
            // Test paralax
            para   = new Parallax();
            ratioX = 0;

            AddChild(para);

            CCS = new CurrentChampionState(1000, 100);

            //AddChild(new GameUI(CCS),10);

            ESCMenu menu = new ESCMenu();

            AddChild(menu, 5);
            menu.SetPositionInScreenPercent(50, 50);

            champSprite = new DrawableChampionSprite(ChampionAnimation.idle, ChampionTypes.ManMega, ChampionsInfo)
            {
                Position = new Vector2(200f, 300f)
            };

            AddChild(champSprite);

            AS = new ActionSequence(ActionSequence.INFINITE_SEQUENCE,
                                    new ActionMoveBy(new TimeSpan(0, 0, 1), new Vector2(100, 100)),
                                    new ActionMoveBy(new TimeSpan(0, 0, 1), new Vector2(-100, -100)));

            champSprite.PerformAction(AS);

            DrawableTriangle tr = new DrawableTriangle(true);

            tr.Ascendant = false;
            tr.Tint      = Color.Blue;
            tr.Scale     = new Vector2(1f, 2f);


            //Test particle

            /*ParticleSystem sys = new ParticleSystem(Content, 1000, null);
             * sys.Position = new Vector2(100, 100);
             * AddChild(sys);*/

            //AddChild(new PingCounter(() => Client.Instance.GetPing().TotalMilliseconds));
            //inputManager.RegisterEvent(InputActions.Spell1, new EventHandler(Jump));

            inputManager.RegisterEvent(InputActions.Spell3, new EventHandler(Jump));
            inputManager.RegisterEvent(InputActions.GoRight, (sender, e) => {
                ratioX += 2;
                para.SetCurrentRatio(ratioX, 0f);
            });
            inputManager.RegisterEvent(InputActions.GoLeft, (sender, e) => {
                ratioX -= 2;
                para.SetCurrentRatio(ratioX, 0f);
            });

            //inputManager.RegisterEvent(InputActions.Jump, new EventHandler(Jump2));

            DrawableCircle circle = new DrawableCircle();

            circle.SetPositionRelativeToObject(champSprite, new Vector2(-150, -30));
            AddChild(circle);

            //AddChild(new DeathScreen(10),11);
        }