protected virtual void GenerateDefaultPlayTexture()
        {
            playTexture = new Texture2D(State.Device, controlButton.Bounds.Width, controlButton.Bounds.Height, false, SurfaceFormat.Bgra5551);

            int          sixth  = controlButton.Bounds.Width / 6;
            List <Point> points = new List <Point>();

            points.Add(new Point(sixth, sixth));
            points.Add(new Point(sixth, controlButton.Bounds.Width - sixth));
            points.Add(new Point(controlButton.Bounds.Width - sixth, controlButton.Bounds.Width / 2));

            UI2DRenderer.GetPolygonTexture(points, UI2DRenderer.PolygonShape.Convex, ref playTexture);

            controlButton.TextureColor = buttonColor;
        }
Beispiel #2
0
        protected virtual void CreateDefaultButtonArrows()
        {
            upLeftTexture    = new Texture2D(State.Device, upLeftButton.Bounds.Width, upLeftButton.Bounds.Height, false, SurfaceFormat.Bgra5551);
            downRightTexture = new Texture2D(State.Device, downRightButton.Bounds.Width, downRightButton.Bounds.Height, false, SurfaceFormat.Bgra5551);

            int          sixth  = downRightButton.Bounds.Width / 6;
            List <Point> points = new List <Point>();

            upLeftButton.TextureColor    = buttonColor;
            downRightButton.TextureColor = buttonColor;

            if (orientation == GoblinEnums.Orientation.Vertical)
            {
                points.Add(new Point(upLeftButton.Bounds.Width / 2, sixth));
                points.Add(new Point(upLeftButton.Bounds.Width - sixth, upLeftButton.Bounds.Height - sixth));
                points.Add(new Point(sixth, upLeftButton.Bounds.Height - sixth));

                UI2DRenderer.GetPolygonTexture(points, UI2DRenderer.PolygonShape.Convex, ref upLeftTexture);

                points.Clear();
                points.Add(new Point(sixth, sixth));
                points.Add(new Point(downRightButton.Bounds.Width - sixth, sixth));
                points.Add(new Point(downRightButton.Bounds.Width / 2, downRightButton.Bounds.Height - sixth));

                UI2DRenderer.GetPolygonTexture(points, UI2DRenderer.PolygonShape.Convex, ref downRightTexture);
            }
            else
            {
                points.Add(new Point(sixth, upLeftButton.Bounds.Height / 2));
                points.Add(new Point(upLeftButton.Bounds.Width - sixth, sixth));
                points.Add(new Point(upLeftButton.Bounds.Width - sixth, upLeftButton.Bounds.Height - sixth));

                UI2DRenderer.GetPolygonTexture(points, UI2DRenderer.PolygonShape.Convex, ref upLeftTexture);

                points.Clear();
                points.Add(new Point(sixth, sixth));
                points.Add(new Point(downRightButton.Bounds.Width - sixth, downRightButton.Bounds.Height / 2));
                points.Add(new Point(sixth, downRightButton.Bounds.Height - sixth));

                UI2DRenderer.GetPolygonTexture(points, UI2DRenderer.PolygonShape.Convex, ref downRightTexture);
            }
        }