コード例 #1
0
ファイル: Main.cs プロジェクト: thakgit/StiLib
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            frameinfo = new FrameInfo();
            text      = new Text(GraphicsDevice, Services, "Content", "Arial");

            point     = new Primitive(GraphicsDevice, PrimitivePara.Point(Vector3.UnitX, Color.White));
            line      = new Primitive(GraphicsDevice, PrimitivePara.Line(Vector3.UnitX * 3, -Vector3.UnitX * 5, Color.Blue, Vector3.UnitY * 8, Color.Red));
            linestrip = new Primitive(GraphicsDevice, PrimitivePara.LineStrip(true, Vector3.Zero, Color.Yellow, -Vector3.UnitX * 7, Vector3.UnitY * 6, Vector3.UnitX * 4, -Vector3.UnitY * 2));
            triangle  = new Primitive(GraphicsDevice, PrimitivePara.Triangle(-Vector3.UnitY * 2, Color.Tomato, -Vector3.UnitX, Vector3.UnitX, Vector3.UnitY, true));
            rectangle = new Primitive(GraphicsDevice, PrimitivePara.Rectangle(Vector3.UnitY * 2, Color.MistyRose, 4f, 3f, true));
            quadrate  = new Primitive(GraphicsDevice, PrimitivePara.Quadrate(Vector3.UnitX * 4, Color.Chocolate, 3f, true));
            ellipse   = new Primitive(GraphicsDevice, PrimitivePara.Ellipse(4f, 3f, Color.Purple, Vector3.UnitY * 5, Color.TransparentWhite, 100, true));
            circle    = new Primitive(GraphicsDevice, PrimitivePara.Circle(3f, Color.Tan, -Vector3.UnitY * 8, Color.Green, 100, true));
            grid      = new Primitive(GraphicsDevice, PrimitivePara.Grid(1.0f, 1.5f, 12, 15, -Vector3.UnitY * 3, Color.LightSalmon, Color.PowderBlue));
        }