Esempio n. 1
0
        protected BaseBoxTool()
        {
            Usage = ToolUsage.Both;
            State = new BoxState();

            _printer = new TextPrinter(TextQuality.Low);
            _printerFont = new Font(FontFamily.GenericSansSerif, 16, GraphicsUnit.Pixel);
        }
Esempio n. 2
0
        protected BaseBoxTool()
        {
            Usage = ToolUsage.Both;
            State = new BoxState();

            _printer     = new TextPrinter(TextQuality.Low);
            _printerFont = new Font(FontFamily.GenericSansSerif, 16, GraphicsUnit.Pixel);
        }
Esempio n. 3
0
        private void DrawStringInScreenCoord(OpenTK.Graphics.TextPrinter printer, string text, Font font, Color c, float x, float y)
        {
            printer.Begin();

            GL.PushMatrix();
            GL.Translate(x, y, 0);

            printer.Print(text, font, c);

            GL.PopMatrix();

            printer.End();
        }
Esempio n. 4
0
        private void DrawStringInWorldCoord(OpenTK.Graphics.TextPrinter printer, string text, Font font, Color c, float x, float y)
        {
            printer.Begin();

            //GL.PopMatrix();
            //GL.Translate(x, y, 0);
            // GL.MatrixMode(MatrixMode.Modelview);

            //  OpenTK.Matrix4 lookat = OpenTK.Matrix4.LookAt(0, 5, 5, 0, 0, 0, 0, 1, 0);
            GL.MatrixMode(MatrixMode.Modelview);
            GL.LoadIdentity();
            GL.Rotate(angle, 0.0f, 1.0f, 0.0f);

            printer.Print(text, font, c);


            //GL.PushMatrix();

            printer.End();
        }
Esempio n. 5
0
 static TextPrinter()
 {
     printer = new OpenTK.Graphics.TextPrinter(OpenTK.Graphics.TextQuality.Medium);
     DefaultFont = new Font("Comic", 14, FontStyle.Bold, GraphicsUnit.Pixel);
     //TextFont = new Font("Arial", 14, FontStyle.Regular, GraphicsUnit.Pixel);
 }
Esempio n. 6
0
        /// <summary>
        /// Game constructor
        /// </summary>
        /// <param name="windowSize">size of the game window</param>
        public Game(Size windowSize)
            : base(windowSize.Width, windowSize.Height)
        {
            centerOfViewPort = new Point(viewPort.Width / 2, viewPort.Height / 2);
            distanceToViewPort = Math.Round((double)viewPort.Width / 2 / Math.Tan((fieldOfView / 2).ToRadians()), 0);
            angleBetweenRays = new Angle(fieldOfView / (double)viewPort.Width);
            this.windowSize = windowSize;

            // Setup the player in the world
            player = new Player(wallsGrid)
            {
                Angle = new Angle(playerStartAngle),
                Position = new Vector2d { X = 168, Y = 112 }
            };

            // Setup textprinter used for font rendering
            textPrinter = new OpenTK.Graphics.TextPrinter(OpenTK.Graphics.TextQuality.Medium);
            debuggerFont = new Font(new FontFamily("Lucida Console"), 8.0f);
        }