ColorGlove.Pooled.center_depth C# (CSharp) Method

center_depth() public method

public center_depth ( ) : int
return int
        public int center_depth() { return center_depth_; }
    }

Usage Example

        // Draws a crosshair at the specific point in the overlay buffer
        private static void DrawCrosshairAt(Pooled gesture, ProcessorState state)
        {
            System.Drawing.Point xy = gesture.center();
            int depth = gesture.center_depth();

            int box_length = 20;
            int x, y;
            System.Drawing.Color paint = System.Drawing.Color.Black;

            x = xy.X - box_length / 2;
            for (int i = 0; i < box_length; i++)
            {
                PaintAt(x + i, xy.Y - 1, paint, state);
                PaintAt(x + i, xy.Y, paint, state);
                PaintAt(x + i, xy.Y + 1, paint, state);
            }

            y = xy.Y - box_length / 2;
            for (int i = 0; i < box_length; i++)
            {
                PaintAt(xy.X - 1, y + i, paint, state);
                PaintAt(xy.X, y + i, paint, state);
                PaintAt(xy.X + 1, y + i, paint, state);
            }

            state.overlay_start_.Value = true;
        }