示例#1
0
文件: Program.cs 项目: Nezz/SharpDX
        protected override void Draw(DemoTime time)
        {
            base.Draw(time);

            // Draw the TextLayout
            RenderTarget2D.DrawTextLayout(new DrawingPointF(0,0), TextLayout, SceneColorBrush, DrawTextOptions.None );
        }
示例#2
0
        protected override void Draw(DemoTime time)
        {
            base.Draw(time);

            // Draw the TextLayout
            RenderTarget2D.DrawGeometry(TesselatedGeometry, SceneColorBrush, 1, null);
        }
        protected override void Draw(DemoTime time)
        {
            base.Draw(time);

            Device.ClearRenderTargetView(BackBufferView, new Color4(1,0.1f,0.1f,0.1f));

            // Make the text boucing on the screen limits
            if ((fontDimension.Right + xDir) > Config.Width)
                xDir = -1;
            else if ((fontDimension.Left + xDir) <= 0)
                xDir = 1;

            if ((fontDimension.Bottom + yDir) > Config.Height)
                yDir = -1;
            else if ((fontDimension.Top + yDir) <= 0)
                yDir = 1;

            fontDimension.Left += (int)xDir;
            fontDimension.Top += (int)yDir;
            fontDimension.Bottom += (int)yDir;
            fontDimension.Right += (int)xDir;

            // Draw the text
            font.DrawText(null, DisplayText, fontDimension, FontDrawFlags.Center | FontDrawFlags.VerticalCenter, new Color4(1, 1, 1, 1));
        }
示例#4
0
        protected override void Draw(DemoTime time)
        {
            base.Draw(time);

            RenderTarget2D.Clear(Color.White);

            RenderTarget2D.DrawText("Hello World using DirectWrite!", TextFormat, ClientRectangle, SceneColorBrush);
        }
示例#5
0
        protected override void Draw(DemoTime time)
        {
            base.Draw(time);

            // Draw the TextLayout
            RenderTarget2D.DrawBitmap(_bitmap, 1.0f, BitmapInterpolationMode.Linear);
        }
 /// <summary>
 ///   In a derived class, implements logic to update any relevant sample state.
 /// </summary>
 protected virtual void Update(DemoTime time)
 {
 }
 /// <summary>
 ///   In a derived class, implements logic to render the sample.
 /// </summary>
 protected virtual void Draw(DemoTime time)
 {
 }
示例#8
0
 /// <summary>
 ///   In a derived class, implements logic to render the sample.
 /// </summary>
 protected virtual void Draw(DemoTime time)
 {
 }
示例#9
0
 /// <summary>
 ///   In a derived class, implements logic to update any relevant sample state.
 /// </summary>
 protected virtual void Update(DemoTime time)
 {
 }