Ejemplo n.º 1
0
        public static void initializeShapes(int width, int height)
        {
            currHLocationRatio = 0;
            m_Speed = .004F;

            m_FlashCounter = -1;

            m_StaticShapes = new List<Shape>();
            m_DynamicShapes = new List<Shape>();

            float wiimoteLine1YRatio = 3F / 10.0F;
            float wiimoteLine2YRatio = 8F/ 10.0F;

            float shapeRatio = 1.0F/3.0F;

            float shapeXRatio = 1.0F / 32.0F;
            float shapeYRatio = 1.0F / 4.0F;

            int fSize;
            // scale the font size in some portion to the video image
            fSize = 4 * (width / 128);

            FontOverlay = new Font("Times New Roman", fSize, System.Drawing.FontStyle.Bold,
                System.Drawing.GraphicsUnit.Point);

            m_Width = width;
            m_Height = height;
            m_WidthRatio = shapeXRatio;
            m_HeightRatio = shapeYRatio;
            m_WiimoteLine1YRatio = wiimoteLine1YRatio;
            m_WiimoteLine2YRatio = wiimoteLine2YRatio;

            LineShape wiimoteLine1 = new LineShape();
            wiimoteLine1.createShape(System.Drawing.Pens.DarkOrange, 0, wiimoteLine1YRatio - 0.01F, 1, wiimoteLine1YRatio - 0.01F);
            m_StaticShapes.Add(wiimoteLine1);

            LineShape wiimoteLine1b = new LineShape();
            wiimoteLine1b.createShape(System.Drawing.Pens.DarkOrange, 0, wiimoteLine1YRatio + 0.01F, 1, wiimoteLine1YRatio + 0.01F);
            m_StaticShapes.Add(wiimoteLine1b);

            LineShape wiimoteLine2 = new LineShape();
            wiimoteLine2.createShape(System.Drawing.Pens.DarkOrange, 0, wiimoteLine2YRatio - 0.01F, 1, wiimoteLine2YRatio - 0.01F);
            m_StaticShapes.Add(wiimoteLine2);

            LineShape wiimoteLine2b = new LineShape();
            wiimoteLine2b.createShape(System.Drawing.Pens.DarkOrange, 0, wiimoteLine2YRatio + 0.01F, 1, wiimoteLine2YRatio + 0.01F);
            m_StaticShapes.Add(wiimoteLine2b);

            RectangleShape wiimoteLine1Rect = new RectangleShape();
            wiimoteLine1Rect.createShape(System.Drawing.Pens.Red, 0.49F, wiimoteLine1YRatio - 0.12F);
            m_StaticShapes.Add(wiimoteLine1Rect);

            RectangleShape wiimoteLine2Rect = new RectangleShape();
            wiimoteLine2Rect.createShape(System.Drawing.Pens.Red, 0.49F, wiimoteLine2YRatio - 0.12F);
            m_StaticShapes.Add(wiimoteLine2Rect);

            // scale the font size in some portion to the video image
            fSize = 4 * (m_Width / 64);

            Font LabelFontOverlay = new Font("Times New Roman", fSize, System.Drawing.FontStyle.Bold,
                System.Drawing.GraphicsUnit.Point);

            StringShape wiimote1Label = new StringShape();
            wiimote1Label.createShape(System.Drawing.Pens.Red, 0.925F, wiimoteLine1YRatio- 0.25F, "L", LabelFontOverlay);
            m_StaticShapes.Add(wiimote1Label);

            StringShape wiimote1Label2 = new StringShape();
            wiimote1Label2.createShape(System.Drawing.Pens.Red, 0.925F, wiimoteLine2YRatio - 0.25F, "R", LabelFontOverlay);
            m_StaticShapes.Add(wiimote1Label2);

            ShapeCSVParser parser = new ShapeCSVParser();
            parser.loadShapeData(m_DynamicShapes);
        }
Ejemplo n.º 2
0
        public static void initializeShapes(int width, int height)
        {
            currHLocationRatio = 0;
            m_Speed            = .004F;

            m_FlashCounter = -1;

            m_StaticShapes  = new List <Shape>();
            m_DynamicShapes = new List <Shape>();


            float wiimoteLine1YRatio = 3F / 10.0F;
            float wiimoteLine2YRatio = 8F / 10.0F;

            float shapeRatio = 1.0F / 3.0F;

            float shapeXRatio = 1.0F / 32.0F;
            float shapeYRatio = 1.0F / 4.0F;

            int fSize;

            // scale the font size in some portion to the video image
            fSize = 4 * (width / 128);

            FontOverlay = new Font("Times New Roman", fSize, System.Drawing.FontStyle.Bold,
                                   System.Drawing.GraphicsUnit.Point);

            m_Width              = width;
            m_Height             = height;
            m_WidthRatio         = shapeXRatio;
            m_HeightRatio        = shapeYRatio;
            m_WiimoteLine1YRatio = wiimoteLine1YRatio;
            m_WiimoteLine2YRatio = wiimoteLine2YRatio;

            LineShape wiimoteLine1 = new LineShape();

            wiimoteLine1.createShape(System.Drawing.Pens.DarkOrange, 0, wiimoteLine1YRatio - 0.01F, 1, wiimoteLine1YRatio - 0.01F);
            m_StaticShapes.Add(wiimoteLine1);

            LineShape wiimoteLine1b = new LineShape();

            wiimoteLine1b.createShape(System.Drawing.Pens.DarkOrange, 0, wiimoteLine1YRatio + 0.01F, 1, wiimoteLine1YRatio + 0.01F);
            m_StaticShapes.Add(wiimoteLine1b);

            LineShape wiimoteLine2 = new LineShape();

            wiimoteLine2.createShape(System.Drawing.Pens.DarkOrange, 0, wiimoteLine2YRatio - 0.01F, 1, wiimoteLine2YRatio - 0.01F);
            m_StaticShapes.Add(wiimoteLine2);

            LineShape wiimoteLine2b = new LineShape();

            wiimoteLine2b.createShape(System.Drawing.Pens.DarkOrange, 0, wiimoteLine2YRatio + 0.01F, 1, wiimoteLine2YRatio + 0.01F);
            m_StaticShapes.Add(wiimoteLine2b);

            RectangleShape wiimoteLine1Rect = new RectangleShape();

            wiimoteLine1Rect.createShape(System.Drawing.Pens.Red, 0.49F, wiimoteLine1YRatio - 0.12F);
            m_StaticShapes.Add(wiimoteLine1Rect);

            RectangleShape wiimoteLine2Rect = new RectangleShape();

            wiimoteLine2Rect.createShape(System.Drawing.Pens.Red, 0.49F, wiimoteLine2YRatio - 0.12F);
            m_StaticShapes.Add(wiimoteLine2Rect);

            // scale the font size in some portion to the video image
            fSize = 4 * (m_Width / 64);

            Font LabelFontOverlay = new Font("Times New Roman", fSize, System.Drawing.FontStyle.Bold,
                                             System.Drawing.GraphicsUnit.Point);

            StringShape wiimote1Label = new StringShape();

            wiimote1Label.createShape(System.Drawing.Pens.Red, 0.925F, wiimoteLine1YRatio - 0.25F, "L", LabelFontOverlay);
            m_StaticShapes.Add(wiimote1Label);

            StringShape wiimote1Label2 = new StringShape();

            wiimote1Label2.createShape(System.Drawing.Pens.Red, 0.925F, wiimoteLine2YRatio - 0.25F, "R", LabelFontOverlay);
            m_StaticShapes.Add(wiimote1Label2);

            ShapeCSVParser parser = new ShapeCSVParser();

            parser.loadShapeData(m_DynamicShapes);
        }