Ejemplo n.º 1
0
        public override void dynamicInitialize()
        {
            ScrollOptionsComponent list = components["Scroll Options"] as ScrollOptionsComponent;

            if (MediaComponent.Playlist.Count > 0)
            {
                if (MediaComponent.Playlist.Count > list.Count)
                {
                    for (int i = list.Count; i < MediaComponent.Playlist.Count; i++)
                    {
                        list.addOption(new OptionType("", new Vector2(30, 100 + 30 * i), Color.Red, OptionAction.nothing, false, false, "Menus/Highlighter", new Vector2(30, 100 + 30 * i)));
                    }
                }
                else if (MediaComponent.Playlist.Count < list.Count)
                {
                    list.clearOptions(MediaComponent.Playlist.Count - 1);
                }

                list.Texts = MediaComponent.Playlist;
                list.setEvents(RemoveSong);
            }
            else
            {
                list.clearOptions(0, true);
                list.addOption(new OptionType("<No Songs Added>", new Vector2(30, 100), Color.Red, OptionAction.nothing, false, false, "Menus/Highlighter", new Vector2(30, 100)));
            }

            list.initializeTransitions();

            base.dynamicInitialize();
        }
Ejemplo n.º 2
0
        public void setDisplayList(string fontAsset, string highlighterAsset, Rectangle boudingBox, Color color, Vector2 highlighterLocation, int optionFactor, ITransition intro, ITransition revert, ITransition select, ITransition exit)
        {
            factor = optionFactor;

            ScrollOptionsComponent optionList = new ScrollOptionsComponent(fontAsset, boudingBox);

            OptionType option = new OptionType("<Select All>", new Vector2(boudingBox.X, boudingBox.Y), color, new Rectangle(boudingBox.X, boudingBox.Y, boudingBox.Width, factor),
                                               OptionAction.nothing, highlighterAsset, highlighterLocation);

            option.Selected += AddAll;

            optionList.addOption(option);

            optionList.setTransitions(intro, revert, select, exit);

            addComponent(optionList);
        }
Ejemplo n.º 3
0
        private void setOptions()
        {
            ScrollOptionsComponent list = new ScrollOptionsComponent("Fonts/MaturaOptions", new Rectangle(30, 100, 212, 320));

            list.addOption(new OptionType("<No Songs Added>", new Vector2(30, 100), Color.Red, OptionAction.nothing, false, false, "Menus/Highlighter", new Vector2(30, 100)));

            list.setTransitions(new MoveCollection(new Vector2(-200, 0), 15, true), new MoveCollection(new Vector2(200, 0), 15, false));

            addComponent(list);

            OptionsComponent options = new OptionsComponent("Fonts/MaturaOptions");

            options.addOption(new OptionType("Back", new Vector2(136, 430), Color.Red, OptionAction.previous, true, true, "Menus/Highlighter", new Vector2(137, 430)));

            options.setAlignment(TextAlignment.center);
            options.setTransitions(new MoveCollection(new Vector2(-200, 0), 15, true), new MoveCollection(new Vector2(200, 0), 15, false));
            addComponent(options);
        }
Ejemplo n.º 4
0
        public void setSongs(string collectionName, SongCollection songCollection)
        {
            songs = songCollection;

            if (components.ContainsKey("Title"))
            {
                TitleComponent title = components["Title"] as TitleComponent;

                title.Text = collectionName;
            }

            if (components.ContainsKey("Scroll Options"))
            {
                ScrollOptionsComponent optionList = components["Scroll Options"] as ScrollOptionsComponent;

                int i;

                for (i = 1; i <= songs.Count; i++)
                {
                    try
                    {
                        optionList.getOption(i).Text = songs[i - 1].Name;
                    }
                    catch
                    {
                        OptionType option = new OptionType(optionList.getOption(0));

                        option.Text = songs[i - 1].Name;

                        option.Position = new Vector2(option.Position.X, option.Position.Y + i * factor);

                        option.Selected -= AddAll;
                        option.Selected += AddSong;

                        optionList.addOption(option);
                    }
                }

                if (i < optionList.Count - 1)
                {
                    optionList.clearOptions(i);
                }
            }
        }
Ejemplo n.º 5
0
        public void setDisplayList(string fontAsset, string highlighterAsset, Rectangle boudingBox, Color color, Vector2 highlighterLocation, int optionFactor, ITransition intro, ITransition revert, ITransition select, ITransition exit)
        {
            ScrollOptionsComponent optionList = new ScrollOptionsComponent(fontAsset, boudingBox);

            for (int i = 0; i < songs.Count; i++)
            {
                OptionType option = new OptionType(songs[i].Name, new Vector2(boudingBox.X, boudingBox.Y + optionFactor * i),
                                                   color, new Rectangle(boudingBox.X, boudingBox.Y + optionFactor * i, boudingBox.Width, optionFactor),
                                                   OptionAction.nothing, "Collection Songs", highlighterAsset, new Vector2(highlighterLocation.X, highlighterLocation.Y + i * optionFactor));

                option.Selected += AddSong;

                optionList.addOption(option);
            }

            optionList.setTransitions(intro, revert, select, exit);

            addComponent(optionList);
        }