Exemple #1
0
        public void SetNewLevel(LevelSelectButton _button, ManageStars.Rating _rating)
        {
            button = _button;
            rating = _rating;

            levelName = new SuperText("Level " + (button.buttonLevel + 1), font, 0.2f);
            levelName.CharacterSize = 50;
            levelName.Position      = position + new Vector2(23, 205);

            screenShot.Texture = AssetManager.GetScreenShot(button.buttonLevel);

            lines = new List <RectangleShape>();
            foreach (Vector2 v in cornerPositions)
            {
                lines.Add(GenerateLine(v, button.position, 2));
            }

            SetAllAphas(highlighted? 100 : 50);
        }
Exemple #2
0
        public LevelInfo(LevelSelectButton _button, Vector2f _position, ManageStars.Rating _rating)
        {
            position            = _position;
            background          = new Sprite(AssetManager.GetTexture(AssetManager.TextureName.LevelInfo));
            background.Origin   = new Vector2f(background.Texture.Size.X * 0.5f, background.Texture.Size.X * 0.5f);
            background.Position = (Vector2f)position + background.Origin;

            screenShot          = new Sprite(AssetManager.GetScreenShot(_button.buttonLevel));
            screenShot.Position = position + new Vector2(20, 20);

            defaultLineColor = new Color(255, 255, 255);
            float cornerDist = 10;

            cornerPositions = new List <Vector2>();
            cornerPositions.Add(position + new Vector2(cornerDist, cornerDist));
            cornerPositions.Add(position + new Vector2(background.Texture.Size.X, 0) + new Vector2(-cornerDist, cornerDist));
            cornerPositions.Add(position + new Vector2(0, background.Texture.Size.Y) + new Vector2(cornerDist, -cornerDist));
            cornerPositions.Add(position + new Vector2(background.Texture.Size.X, background.Texture.Size.Y) + new Vector2(-cornerDist, -cornerDist));

            SetNewLevel(_button, _rating);
        }