示例#1
0
        /// <summary>
        /// Creates a new LeftRight Switch.
        /// </summary>
        /// <param name="_position">Position where the Switch should be</param>
        /// <param name="texturePaths">TexturePaths of the Icons that should be inside the Switch. The First Element of the Array will be displayt first</param>
        public LeftRightSwitch(Vector2 _position, String[] texturePaths)
        {
            pointer = 0;
            position = _position;
            iconsInside = new Icon[texturePaths.Length];
            Left = new Button(new Vector2(position.X, position.Y), "Textures/CharacterSelection/LeftNotSelected", "Textures/CharacterSelection/LeftSelected");
            for (int i = 0; i < texturePaths.Length; i++)
                iconsInside[i] = new Icon(new Vector2(position.X + Left.getWidth(), position.Y), texturePaths[i]);
            Left.setPosition(new Vector2(position.X, position.Y + (iconsInside[pointer].getHeight() / 2) - Left.getHeight() / 2));

            Right = new Button(new Vector2(position.X + iconsInside[0].getWidth() + Left.getWidth(), position.Y + (iconsInside[pointer].getHeight() / 2) - Left.getHeight() / 2), "Textures/CharacterSelection/RightNotSelected", "Textures/CharacterSelection/RightSelected");
        }
示例#2
0
        public Pause(Player.EPlayerControlls _controlls)
        {
            controlls = _controlls;
            count = 0;
            isPressed = true;

            Vector2 position = new Vector2(0, 0);
            gresScreen = new Icon( position, "Textures/Pause/greyScreen");

            float distY = 100 * Settings.getInterfaceScale();
            resume = new Button(position, "Textures/Pause/resumeNot", "Textures/Pause/resumeSelected");
            exit = new Button(position, "Textures/Pause/exitNot", "Textures/Pause/exitSelected");

            position = new Vector2(Settings.getResolutionX() / 2 - resume.getWidth()/2, Settings.getResolutionY() / 2 - resume.getHeight() - distY);
            resume.setPosition(position);
            position = new Vector2(Settings.getResolutionX() / 2 - exit.getWidth() / 2, Settings.getResolutionY() / 2 + distY);
            exit.setPosition(position);
        }