public void onEvent(ThemeSelectedEvent evt)
        {
            mSelectedTheme = evt.theme;
            mScreenController.openScreen(ScreenController.Screen.DIFFICULTY);

            Bitmap bitmap          = GameUtility.ScaleDown(Resource.Drawable.background, GameUtility.ScreenWidth(), GameUtility.ScreenHeight());
            Bitmap backgroundImage = GameThemes.getBackgroundImage(mSelectedTheme);

            backgroundImage = GameUtility.Crop(backgroundImage, GameUtility.ScreenHeight(), GameUtility.ScreenWidth());
            Drawable[] backgrounds = new Drawable[2];
            backgrounds[0] = new BitmapDrawable(Application.Context.Resources, bitmap);
            backgrounds[1] = new BitmapDrawable(Application.Context.Resources, backgroundImage);

            TransitionDrawable crossfader = new TransitionDrawable(backgrounds);

            mBackgroundImage.SetImageDrawable(crossfader);
            crossfader.StartTransition(2000);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view      = LayoutInflater.From(Application.Context).Inflate(Resource.Layout.theme_select_fragment, container, false);
            View emoticons = view.FindViewById(Resource.Id.theme_emoticons_container);
            View animals   = view.FindViewById(Resource.Id.theme_animals_container);
            View monsters  = view.FindViewById(Resource.Id.theme_monsters_container);

            Theme themeEmoticons = GameThemes.createEmoticonsTheme();

            setStars((ImageView)animals.FindViewById(Resource.Id.theme_emoticons), themeEmoticons, "emoticons");

            Theme themeAnimals = GameThemes.createAnimalsTheme();

            setStars((ImageView)animals.FindViewById(Resource.Id.theme_animals), themeAnimals, "animals");

            Theme themeMonsters = GameThemes.createMosterTheme();

            setStars((ImageView)monsters.FindViewById(Resource.Id.theme_monsters), themeMonsters, "monsters");

            emoticons.Click += (sender, e) =>
            {
                Shared.EventBus.Notify(new ThemeSelectedEvent(themeEmoticons));
            };

            animals.Click += (sender, e) =>
            {
                Shared.EventBus.Notify(new ThemeSelectedEvent(themeAnimals));
            };

            monsters.Click += (sender, e) =>
            {
                Shared.EventBus.Notify(new ThemeSelectedEvent(themeMonsters));
            };

            animateShow(animals);
            animateShow(monsters);

            return(view);
        }
示例#3
0
        public Theme(GameThemes theme)
        {
            this.Colors = new List<ConsoleColor>();
            switch (theme)
            {
                case GameThemes.Black:
                    this.Background = ConsoleColor.Black;
                    this.Foreground = ConsoleColor.White;
                    this.TextColor = ConsoleColor.Cyan;
                    for (int i = 1; i <= 15; i++)
                        if (i != (int)ConsoleColor.DarkBlue
                            && i != (int)ConsoleColor.DarkGray
                            && i != (int)ConsoleColor.DarkMagenta) this.Colors.Add((ConsoleColor)i);
                    break;

                case GameThemes.Yellow:
                    this.Background = ConsoleColor.Yellow;
                    this.Foreground = ConsoleColor.Gray;
                    this.TextColor = ConsoleColor.DarkCyan;
                    for (int i = 1; i <= 13; i++) this.Colors.Add((ConsoleColor)i);
                    break;

                case GameThemes.Blue:
                    this.Background = ConsoleColor.Blue;
                    this.Foreground = ConsoleColor.Cyan;
                    this.TextColor = ConsoleColor.White;
                    for (int i = 1; i <= 15; i++) if (i != (int)ConsoleColor.Blue
                        && i != (int)ConsoleColor.DarkBlue
                        && i != (int)ConsoleColor.DarkCyan
                        && i != (int)ConsoleColor.DarkMagenta
                        && i != (int)ConsoleColor.DarkGreen
                        && i != (int)ConsoleColor.DarkRed
                        && i != (int)ConsoleColor.Cyan) this.Colors.Add((ConsoleColor)i);
                    break;

                case GameThemes.Cyan:
                    this.Background = ConsoleColor.Cyan;
                    this.Foreground = ConsoleColor.Blue;
                    this.TextColor = ConsoleColor.White;
                    for (int i = 1; i <= 15; i++) if (i != (int)ConsoleColor.Cyan) this.Colors.Add((ConsoleColor)i);
                    break;

                case GameThemes.WhiteYellow:
                    this.Background = ConsoleColor.White;
                    this.Foreground = ConsoleColor.DarkYellow;
                    this.TextColor = ConsoleColor.DarkMagenta;
                    for (int i = 1; i <= 13; i++) this.Colors.Add((ConsoleColor)i);
                    break;

                case GameThemes.WhiteMagenta:
                    this.Background = ConsoleColor.White;
                    this.Foreground = ConsoleColor.DarkMagenta;
                    this.TextColor = ConsoleColor.DarkYellow;
                    for (int i = 1; i <= 13; i++) this.Colors.Add((ConsoleColor)i);
                    break;

                default:
                    this.Background = ConsoleColor.White;
                    this.Foreground = ConsoleColor.Black;
                    this.TextColor = ConsoleColor.DarkCyan;
                    for (int i = 1; i <= 13; i++) this.Colors.Add((ConsoleColor)i);
                    break;
            }
        }
示例#4
0
        public Theme(GameThemes theme)
        {
            this.Colors = new List <ConsoleColor>();
            switch (theme)
            {
            case GameThemes.Black:
                this.Background = ConsoleColor.Black;
                this.Foreground = ConsoleColor.White;
                this.TextColor  = ConsoleColor.Cyan;
                for (int i = 1; i <= 15; i++)
                {
                    if (i != (int)ConsoleColor.DarkBlue &&
                        i != (int)ConsoleColor.DarkGray &&
                        i != (int)ConsoleColor.DarkMagenta)
                    {
                        this.Colors.Add((ConsoleColor)i);
                    }
                }
                break;

            case GameThemes.Yellow:
                this.Background = ConsoleColor.Yellow;
                this.Foreground = ConsoleColor.Gray;
                this.TextColor  = ConsoleColor.DarkCyan;
                for (int i = 1; i <= 13; i++)
                {
                    this.Colors.Add((ConsoleColor)i);
                }
                break;

            case GameThemes.Blue:
                this.Background = ConsoleColor.Blue;
                this.Foreground = ConsoleColor.Cyan;
                this.TextColor  = ConsoleColor.White;
                for (int i = 1; i <= 15; i++)
                {
                    if (i != (int)ConsoleColor.Blue &&
                        i != (int)ConsoleColor.DarkBlue &&
                        i != (int)ConsoleColor.DarkCyan &&
                        i != (int)ConsoleColor.DarkMagenta &&
                        i != (int)ConsoleColor.DarkGreen &&
                        i != (int)ConsoleColor.DarkRed &&
                        i != (int)ConsoleColor.Cyan)
                    {
                        this.Colors.Add((ConsoleColor)i);
                    }
                }
                break;

            case GameThemes.Cyan:
                this.Background = ConsoleColor.Cyan;
                this.Foreground = ConsoleColor.Blue;
                this.TextColor  = ConsoleColor.White;
                for (int i = 1; i <= 15; i++)
                {
                    if (i != (int)ConsoleColor.Cyan)
                    {
                        this.Colors.Add((ConsoleColor)i);
                    }
                }
                break;

            case GameThemes.WhiteYellow:
                this.Background = ConsoleColor.White;
                this.Foreground = ConsoleColor.DarkYellow;
                this.TextColor  = ConsoleColor.DarkMagenta;
                for (int i = 1; i <= 13; i++)
                {
                    this.Colors.Add((ConsoleColor)i);
                }
                break;

            case GameThemes.WhiteMagenta:
                this.Background = ConsoleColor.White;
                this.Foreground = ConsoleColor.DarkMagenta;
                this.TextColor  = ConsoleColor.DarkYellow;
                for (int i = 1; i <= 13; i++)
                {
                    this.Colors.Add((ConsoleColor)i);
                }
                break;

            default:
                this.Background = ConsoleColor.White;
                this.Foreground = ConsoleColor.Black;
                this.TextColor  = ConsoleColor.DarkCyan;
                for (int i = 1; i <= 13; i++)
                {
                    this.Colors.Add((ConsoleColor)i);
                }
                break;
            }
        }