Example #1
0
        private void Init(IColorPreset colorPreset)
        {
            LabelText = "Advanced";

            hoverSprite.SpriteName = "circle-16";
            hoverSprite.ImageType  = Image.Type.Sliced;
        }
Example #2
0
        private void Init(IColorPreset colorPreset)
        {
            hoverSprite.SpriteName = "circle-16";
            hoverSprite.ImageType  = Image.Type.Sliced;

            focusSprite.SpriteName = "circle-16";
            focusSprite.ImageType  = Image.Type.Sliced;
            focusSprite.Tint       = colorPreset.Passive;

            label = CreateChild <Label>("label", 10);
            {
                label.Anchor    = AnchorType.Fill;
                label.Offset    = new Offset(16f, 0f);
                label.Alignment = TextAnchor.MiddleLeft;
                label.FontSize  = 16;
            }

            UseDefaultHoverAni();

            focusAni = new Anime();
            focusAni.AnimateFloat(a => focusSprite.Alpha = a)
            .AddTime(0f, () => focusSprite.Alpha)
            .AddTime(0.01f, 1f)
            .Build();

            unfocusAni = new Anime();
            unfocusAni.AnimateFloat(a => focusSprite.Alpha = a)
            .AddTime(0f, () => focusSprite.Alpha)
            .AddTime(0.01f, 0f)
            .Build();
        }
Example #3
0
        private void Init(IColorPreset colorPreset)
        {
            CreateIconSprite(depth: 10);

            glowSprite = CreateChild <UguiSprite>("glow", 3);
            {
                glowSprite.Size       = new Vector2(96f, 96f);
                glowSprite.Color      = colorPreset.PrimaryFocus;
                glowSprite.SpriteName = "glow-128";
                glowSprite.Alpha      = 0;
            }

            UseDefaultFocusAni();
            UseDefaultHighlightAni();
            UseDefaultHoverAni();

            highlightAni.AnimateFloat(a => glowSprite.Alpha = a)
            .AddTime(0f, () => glowSprite.Alpha)
            .AddTime(0.25f, 1f)
            .Build();
            unhighlightAni.AnimateFloat(a => glowSprite.Alpha = a)
            .AddTime(0f, () => glowSprite.Alpha)
            .AddTime(0.25f, 0f)
            .Build();
        }
Example #4
0
        /// <summary>
        /// Initializes all required modules for the game.
        /// </summary>
        protected virtual void InitializeModules()
        {
            UnityThread.Initialize();

            Dependencies.CacheAs <IGame>(this);

            Dependencies.CacheAs <IPlatformHost>(platformHost = PlatformHost.CreateHost());
            Dependencies.CacheAs <DeepLinker>(deepLinker      = platformHost.CreateDeepLinker());

            Dependencies.CacheAs <IEnvConfiguration>(envConfiguration = new EnvConfiguration(EnvType.Production));

            Dependencies.CacheAs <IModeManager>(modeManager = new ModeManager());

            Dependencies.CacheAs <INotificationBox>(notificationBox = new NotificationBox());

            Dependencies.CacheAs <IGameConfiguration>(gameConfiguration     = new GameConfiguration());
            Dependencies.CacheAs <IMapConfiguration>(mapConfiguration       = new MapConfiguration());
            Dependencies.CacheAs <IMapsetConfiguration>(mapsetConfiguration = new MapsetConfiguration());

            Dependencies.CacheAs <IFontManager>(fontManager       = new FontManager());
            Dependencies.CacheAs <IAtlas <Sprite> >(spriteAtlas   = new ResourceSpriteAtlas());
            Dependencies.CacheAs <IAtlas <AudioClip> >(audioAtlas = new ResourceAudioAtlas());

            Dependencies.CacheAs <IMusicCacher>(musicCacher           = new MusicCacher());
            Dependencies.CacheAs <IBackgroundCacher>(backgroundCacher = new BackgroundCacher());
            Dependencies.CacheAs <IWebImageCacher>(webImageCacher     = new WebImageCacher());
            Dependencies.CacheAs <IWebMusicCacher>(webMusicCacher     = new WebMusicCacher());

            Dependencies.CacheAs <IMusicController>(musicController = MusicController.Create());

            Dependencies.CacheAs <ISoundTable>(soundTable = new DefaultSoundTable(audioAtlas));
            Dependencies.CacheAs <ISoundPool>(soundPool   = new SoundPool(soundTable));

            Dependencies.CacheAs <IMapsetStore>(mapsetStore   = new MapsetStore(modeManager));
            Dependencies.CacheAs <IMapSelection>(mapSelection = new MapSelection(musicCacher, backgroundCacher, gameConfiguration, mapsetConfiguration, mapConfiguration));
            Dependencies.CacheAs <IMapManager>(mapManager     = new MapManager(mapsetStore, notificationBox, mapSelection));
            Dependencies.CacheAs <IMetronome>(metronome       = new Metronome()
            {
                AudioController = musicController
            });
            Dependencies.CacheAs <IMusicPlaylist>(musicPlaylist = new MusicPlaylist());

            Dependencies.CacheAs <IDownloadStore>(downloadStore = new DownloadStore());
            Dependencies.CacheAs <IApi>(api = new Api(envConfiguration, notificationBox, deepLinker));

            Dependencies.CacheAs <IUserManager>(userManager = new UserManager(api, Dependencies));
            Dependencies.CacheAs <IRecordStore>(recordStore = new RecordStore());

            Dependencies.CacheAs <IRootMain>(rootMain                 = RootMain.Create(Dependencies));
            Dependencies.CacheAs <IRoot3D>(root3D                     = Root3D.Create(Dependencies));
            Dependencies.CacheAs <IColorPreset>(colorPreset           = new ColorPreset());
            Dependencies.CacheAs <IAnimePreset>(animePreset           = new AnimePreset());
            Dependencies.CacheAs <IScreenNavigator>(screenNavigator   = new ScreenNavigator(rootMain));
            Dependencies.CacheAs <IOverlayNavigator>(overlayNavigator = new OverlayNavigator(rootMain));
            Dependencies.CacheAs <IDropdownProvider>(dropdownProvider = new DropdownProvider(rootMain));

            Dependencies.CacheAs <ITemporaryStore>(temporaryStore = new TemporaryStore());
        }
        private void Init(IColorPreset colorPreset)
        {
            Color = colorPreset.DarkBackground;

            menuHolder = CreateChild <MenuHolder>("menu", 0);
            {
                menuHolder.Anchor   = AnchorType.TopStretch;
                menuHolder.Pivot    = PivotType.Top;
                menuHolder.RawWidth = 0f;
                menuHolder.Y        = 0f;
                menuHolder.Height   = 56f;
            }
            versionDisplay = CreateChild <VersionDisplay>("version", 1);
            {
                versionDisplay.Anchor   = AnchorType.TopStretch;
                versionDisplay.Pivot    = PivotType.Top;
                versionDisplay.RawWidth = 0f;
                versionDisplay.Y        = -56f;
                versionDisplay.Height   = 72f;
            }
            contentScroll = CreateChild <UguiScrollView>("content", 2);
            {
                contentScroll.Anchor = AnchorType.Fill;
                contentScroll.Offset = new Offset(0f, 128f, 0f, 0f);

                contentScroll.Background.Alpha = 0f;

                metaContainer = contentScroll.Container.CreateChild <MetaContainer>("meta");
                {
                    metaContainer.Anchor = AnchorType.TopStretch;
                    metaContainer.Pivot  = PivotType.Top;
                    metaContainer.Y      = -32f;
                    metaContainer.Height = 360f;
                    metaContainer.SetOffsetHorizontal(64f);
                }
                rankingContainer = contentScroll.Container.CreateChild <RankingContainer>("ranking");
                {
                    rankingContainer.Anchor = AnchorType.TopStretch;
                    rankingContainer.Pivot  = PivotType.Top;
                    rankingContainer.Y      = -424f;
                    rankingContainer.Height = 360f;
                    rankingContainer.SetOffsetHorizontal(64f);
                }
                actionsContainer = contentScroll.Container.CreateChild <ActionsContainer>("actions");
                {
                    actionsContainer.Anchor = AnchorType.TopStretch;
                    actionsContainer.Pivot  = PivotType.Top;
                    actionsContainer.Y      = -816f;
                    actionsContainer.Height = 48f;
                    actionsContainer.SetOffsetHorizontal(64f);
                }

                // Calculate height of the scrollview content.
                contentScroll.Container.Height = GetContentHeight();
            }
        }
Example #6
0
        private void Init(IColorPreset colorPreset)
        {
            button = CreateChild <BoxButton>("button");
            {
                button.Anchor = AnchorType.Fill;
                button.Offset = new Offset(16f, 8f, 16f, 8f);
                button.Color  = colorPreset.Passive;

                button.OnTriggered += () => actionEntry?.Invoke();
            }
        }
Example #7
0
        private void Init(IColorPreset colorPreset)
        {
            background.Color      = Color.black;
            background.SpriteName = "circle-8";
            background.ImageType  = Image.Type.Sliced;

            foreground.Color      = colorPreset.PrimaryFocus;
            foreground.SpriteName = "circle-8";
            foreground.ImageType  = Image.Type.Sliced;

            SetNoTransition();
            SetVertical();
        }
Example #8
0
        private void Init(IColorPreset colorPreset)
        {
            OnChanged += Model.ScheduleSearch;
            OnSubmitted += Model.ApplySearch;

            backgroundSprite.Color = new Color(1f, 1f, 1f, 0.0625f);
            backgroundSprite.Anchor = AnchorType.Fill;
            backgroundSprite.Offset = Offset.Zero;

            CreateIconSprite(spriteName: "icon-search");

            OnEnableInited();
        }
Example #9
0
        private void Init(IColorPreset colorPreset)
        {
            Alpha = 0f;

            var actionButton = CreateChild <BoxButton>("actions");
            {
                actionButton.Anchor    = AnchorType.Fill;
                actionButton.Offset    = Offset.Zero;
                actionButton.Tint      = colorPreset.Passive;
                actionButton.LabelText = "Map Actions";

                actionButton.OnTriggered += () => Model.ShowMapActions(Model.SelectedMap.Value?.OriginalMap);
            }
        }
Example #10
0
        private void Init(IColorPreset colorPreset)
        {
            loginButton = CreateChild <BoxButton>("login", 4);
            {
                loginButton.Anchor = AnchorType.TopStretch;
                loginButton.Pivot  = PivotType.Top;
                loginButton.SetOffsetHorizontal(48f);
                loginButton.Y         = -16;
                loginButton.Height    = 36f;
                loginButton.Color     = colorPreset.Positive;
                loginButton.LabelText = "OAuth log in";

                loginButton.OnTriggered += DoLogin;
            }
        }
Example #11
0
        private void Init(IColorPreset colorPreset, IScreenNavigator screenNavigator)
        {
            detailButton = CreateChild <BoxButton>("detail", 0);
            {
                detailButton.Anchor    = AnchorType.MiddleStretch;
                detailButton.RawWidth  = -96f;
                detailButton.Y         = 50f;
                detailButton.Height    = 36f;
                detailButton.LabelText = "Detail";
                detailButton.Color     = colorPreset.Positive;

                detailButton.OnTriggered += Model.ShowUserDetail;
            }
            visitButton = CreateChild <BoxButton>("visit", 1);
            {
                visitButton.Anchor    = AnchorType.MiddleStretch;
                visitButton.RawWidth  = -96f;
                visitButton.Y         = 10f;
                visitButton.Height    = 36f;
                visitButton.LabelText = "Visit";
                visitButton.Color     = colorPreset.Warning;

                visitButton.OnTriggered += Model.VisitUserPage;
            }
            logoutButton = CreateChild <BoxButton>("logout", 2);
            {
                logoutButton.Anchor    = AnchorType.MiddleStretch;
                logoutButton.RawWidth  = -96f;
                logoutButton.Y         = -30f;
                logoutButton.Height    = 36f;
                logoutButton.LabelText = "Log out";
                logoutButton.Color     = colorPreset.Negative;

                logoutButton.OnTriggered += Model.LogoutUser;
            }
            accountLabel = CreateChild <Label>("account", 3);
            {
                accountLabel.Anchor   = AnchorType.MiddleStretch;
                accountLabel.RawWidth = 0f;
                accountLabel.Y        = -81f;
                accountLabel.Height   = 30;
                accountLabel.WrapText = true;
                accountLabel.FontSize = 16;
            }

            OnEnableInited();
        }
Example #12
0
        private void Init(IColorPreset colorPreset)
        {
            backgroundSprite.Sprite = null;
            backgroundSprite.Anchor = AnchorType.BottomStretch;
            backgroundSprite.Y      = 2f;
            backgroundSprite.Height = 4f;
            backgroundSprite.Alpha  = 0.75f;

            hoverSprite.Offset = Offset.Zero;
            hoverSprite.Sprite = null;
            hoverSprite.Tint   = Color.white;

            focusSprite.SpriteName = "glow-bar";
            focusSprite.Anchor     = AnchorType.BottomStretch;
            focusSprite.SetOffsetHorizontal(-15f);
            focusSprite.Y      = 2f;
            focusSprite.Height = 34f;

            valueLabel.SetOffsetLeft(8f);
            placeholderLabel.SetOffsetLeft(8f);

            UseDefaultFocusAni();

            hoverInAni = new Anime();
            hoverInAni.AnimateFloat(a => hoverSprite.Alpha = a)
            .AddTime(0f, () => hoverSprite.Alpha)
            .AddTime(0.25f, 0.25f)
            .Build();

            hoverOutAni = new Anime();
            hoverOutAni.AnimateFloat(a => hoverSprite.Alpha = a)
            .AddTime(0f, () => hoverSprite.Alpha)
            .AddTime(0.25f, 0f)
            .Build();

            focusAni.AnimateFloat((w) => focusSprite.Width = w)
            .AddTime(0f, () => focusSprite.Width)
            .AddTime(0.25f, () => Width + 30f)
            .Build();

            unfocusAni.AnimateFloat((w) => focusSprite.Width = w)
            .AddTime(0f, () => focusSprite.Width)
            .AddTime(0.25f, 0f)
            .Build();
        }
Example #13
0
        private void Init(IColorPreset colorPreset)
        {
            username = CreateChild <LoginInput>("username", 1);
            {
                username.Anchor = AnchorType.TopStretch;
                username.Pivot  = PivotType.Top;
                username.SetOffsetHorizontal(32);
                username.Y           = -16f;
                username.Height      = 36f;
                username.Placeholder = "username";
            }
            password = CreateChild <LoginInput>("password", 2);
            {
                password.Anchor = AnchorType.TopStretch;
                password.Pivot  = PivotType.Top;
                password.SetOffsetHorizontal(32f);
                password.Y           = -60f;
                password.Height      = 36f;
                password.InputType   = InputField.InputType.Password;
                password.Placeholder = "password";
            }
            remember = CreateChild <LabelledToggle>("remember", 3);
            {
                remember.Anchor    = AnchorType.Top;
                remember.Pivot     = PivotType.Top;
                remember.Position  = new Vector3(0f, -104f);
                remember.Size      = new Vector2(170f, 24f);
                remember.LabelText = "Remember me";
            }
            loginButton = CreateChild <BoxButton>("login", 4);
            {
                loginButton.Anchor = AnchorType.TopStretch;
                loginButton.Pivot  = PivotType.Top;
                loginButton.SetOffsetHorizontal(48f);
                loginButton.Y         = -148f;
                loginButton.Height    = 36f;
                loginButton.Color     = colorPreset.Positive;
                loginButton.LabelText = "Log in";

                loginButton.OnTriggered += DoLogin;
            }

            OnEnableInited();
        }
Example #14
0
        private void Init(IColorPreset colorPreset)
        {
            Color = colorPreset.Passive;

            titleLabel = CreateChild <Label>("title", 0);
            {
                titleLabel.Anchor = AnchorType.LeftStretch;
                titleLabel.Pivot  = PivotType.Left;
                titleLabel.SetOffsetVertical(0f);
                titleLabel.X         = 16f;
                titleLabel.IsBold    = true;
                titleLabel.FontSize  = 16;
                titleLabel.Alignment = TextAnchor.MiddleLeft;
                titleLabel.Text      = "Providers";
            }
            statusLabel = CreateChild <Label>("status", 1);
            {
                statusLabel.Anchor = AnchorType.RightStretch;
                statusLabel.Pivot  = PivotType.Right;
                statusLabel.SetOffsetVertical(0f);
                statusLabel.X         = -16f;
                statusLabel.IsBold    = true;
                statusLabel.FontSize  = 16;
                statusLabel.Alignment = TextAnchor.MiddleRight;
            }
            grid = CreateChild <UguiGrid>("grid", 2);
            {
                grid.Anchor = AnchorType.Fill;
                grid.Offset = new Offset(100f, 0f, 200f, 0f);

                foreach (var provider in (ApiProviderType[])Enum.GetValues(typeof(ApiProviderType)))
                {
                    var button = grid.CreateChild <ProviderButton>(provider.ToString(), grid.ChildCount);
                    button.SetProvider(provider);
                }
            }

            InvokeAfterTransformed(1, () =>
            {
                grid.CellSize = new Vector2(ProviderButtonWidth, this.Height);
            });

            OnEnableInited();
        }
Example #15
0
        private void Init(IColorPreset colorPreset)
        {
            OnPointerDown += () =>
            {
                isControlling = true;

                upAni.Stop();
                downAni.PlayFromStart();
            };
            OnPointerUp += () =>
            {
                isControlling = false;

                downAni.Stop();
                upAni.PlayFromStart();
            };
            OnChange += (value) =>
            {
                var audio = MusicController.Audio;
                if (isControlling && audio != null)
                {
                    MusicController.Seek(value * audio.Duration);
                }
            };

            background.Color = Color.black;
            foreground.Color = colorPreset.SecondaryFocus;
            thumb.Active     = false;

            downAni = new Anime();
            downAni.AnimateFloat(y => ScaleY = y)
            .AddTime(0f, () => ScaleY)
            .AddTime(0.25f, 2f)
            .Build();

            upAni = new Anime();
            upAni.AnimateFloat(y => ScaleY = y)
            .AddTime(0f, () => ScaleY)
            .AddTime(0.25f, 1f)
            .Build();
        }
Example #16
0
        private void Init(IColorPreset colorPreset)
        {
            CacheHighlightProperties();

            highlightSprite = CreateChild <UguiSprite>("highlight", HighlightSpriteDepth);
            {
                highlightSprite.Anchor = HighlightSpriteAnchor;
                highlightSprite.Pivot  = HighlightSpritePivot;
                if (IsHighlightSpriteVertical)
                {
                    highlightSprite.Size = new Vector2(NonStretchingSize, 0f);
                }
                else
                {
                    highlightSprite.Size = new Vector2(0f, NonStretchingSize);
                }
                highlightSprite.Position = Vector2.zero;
                highlightSprite.Color    = colorPreset.PrimaryFocus;
                highlightSprite.Alpha    = 0f;
            }
        }
Example #17
0
        private void Init(IColorPreset colorPreset)
        {
            showAni = new Anime();
            showAni.AnimateFloat(a => this.Alpha = a)
            .AddTime(1.5f, 0f, EaseType.QuadEaseOut)
            .AddTime(1.75f, 1f)
            .Build();
            showAni.AnimateFloat(scale => Scale = new Vector3(scale, scale, 1f))
            .AddTime(0f, 1f)
            .AddTime(1.5f, 2f, EaseType.QuadEaseOut)
            .AddTime(1.75f, 1f)
            .Build();

            hideAni = new Anime();
            hideAni.AddEvent(0f, () => showAni.Stop());
            hideAni.AnimateFloat(a => this.Alpha = a)
            .AddTime(0f, 1f, EaseType.QuadEaseOut)
            .AddTime(0.5f, 0f)
            .Build();

            Rotate = true;
        }
Example #18
0
        private void Init(IColorPreset colorPreset)
        {
            Color = colorPreset.DarkBackground;

            rankSearchFilter = CreateChild <CategorySearchFilter>("rank-search", 0);
            {
                rankSearchFilter.Anchor = AnchorType.LeftStretch;
                rankSearchFilter.Pivot  = PivotType.Left;
                rankSearchFilter.SetOffsetVertical(16f);
                rankSearchFilter.X     = 16f;
                rankSearchFilter.Width = 240;
            }
            sortSearchFilter = CreateChild <SortSearchFilter>("sort-search", 1);
            {
                sortSearchFilter.Anchor = AnchorType.LeftStretch;
                sortSearchFilter.Pivot  = PivotType.Left;
                sortSearchFilter.SetOffsetVertical(16f);
                sortSearchFilter.X     = rankSearchFilter.X + rankSearchFilter.Width + 16f;
                sortSearchFilter.Width = 295;
            }

            advancedButton = CreateChild <AdvancedButton>("advanced", 3);
            {
                advancedButton.Anchor = AnchorType.RightStretch;
                advancedButton.Pivot  = PivotType.Right;
                advancedButton.SetOffsetVertical(16f);
                advancedButton.X     = -16f;
                advancedButton.Width = 150f;
            }
            searchBarFilter = CreateChild <SearchBarFilter>("search-bar", 2);
            {
                searchBarFilter.Anchor = AnchorType.RightStretch;
                searchBarFilter.Pivot  = PivotType.Right;
                searchBarFilter.SetOffsetVertical(16f);
                searchBarFilter.X     = advancedButton.X - advancedButton.Width - 16f;
                searchBarFilter.Width = 420f;
            }
        }
        private void Init(IColorPreset colorPreset)
        {
            bgSprite = CreateChild <UguiSprite>("bg", -1);
            {
                bgSprite.Anchor = AnchorType.Fill;
                bgSprite.Offset = Offset.Zero;

                var gradient = bgSprite.AddEffect(new GradientEffect());
                gradient.Component.direction = UIGradient.Direction.Vertical;
                gradient.Component.color1    = colorPreset.Passive;
                gradient.Component.color2    = colorPreset.DarkBackground;
            }
            searchMenu = CreateChild <SearchMenu>("search-menu", 1);
            {
                searchMenu.Anchor = AnchorType.Fill;
                searchMenu.Pivot  = PivotType.Top;
                searchMenu.Offset = new Offset(0f, MenuBarHeight, 0f, 0f);
            }
            resultArea = CreateChild <UguiObject>("result-area", 1);
            {
                resultArea.Anchor = AnchorType.Fill;
                resultArea.Offset = new Offset(0f, searchMenu.FoldedHeight + MenuBarHeight, 0f, 0f);

                resultList = resultArea.CreateChild <ResultList>("list", 0);
                {
                    resultList.Anchor = AnchorType.Fill;
                    resultList.Offset = new Offset(8f, 0f);
                }
                resultLoader = resultArea.CreateChild <ResultLoader>("loader", 1);
                {
                    resultLoader.Anchor = AnchorType.Fill;
                    resultLoader.Offset = Offset.Zero;
                }
            }

            model.MapsetsRequest.OnNewValue += OnRequestChange;
        }
        private void Init(IColorPreset colorPreset)
        {
            Color = new Color(1f, 1f, 1f, 0.0625f);

            grid = CreateChild <UguiGrid>("grid");
            {
                grid.Anchor   = AnchorType.Fill;
                grid.Offset   = Offset.Zero;
                grid.CellSize = new Vector2(118f, 36f);

                timeInfo = grid.CreateChild <MetaDifficultyInfoCell>("time", 0);
                {
                    timeInfo.IconName = "icon-clock";
                    timeInfo.Tint     = colorPreset.SecondaryFocus;
                }
                objectsInfo = grid.CreateChild <MetaDifficultyInfoCell>("objects", 1);
                {
                    objectsInfo.IconName = "icon-mode-osu-32";
                    objectsInfo.Tint     = colorPreset.SecondaryFocus;
                }
            }

            OnEnableInited();
        }
Example #21
0
        private void Init(IColorPreset colorPreset)
        {
            OnTriggered += () =>
            {
                Model.Options.ApiProvider.Value = provider;
            };

            highlightSprite.Color = colorPreset.SecondaryFocus;

            CreateIconSprite();

            InvokeAfterTransformed(2, () =>
            {
                float size          = Mathf.Min(this.Width, this.Height) - 16;
                iconSprite.Size     = new Vector2(size, size);
                iconSprite.Position = Vector2.zero;
            });

            UseDefaultFocusAni();
            UseDefaultHoverAni();
            UseDefaultHighlightAni();

            OnEnableInited();
        }
        private void Init(IColorPreset colorPreset)
        {
            container.Anchor = AnchorType.TopRight;
            container.Pivot  = PivotType.TopRight;
            container.X      = -16f;
            container.Y      = -16f;
            container.Width  = 400f;
            container.Height = 140f;

            mask = container.CreateChild <UguiSprite>("mask", 0);
            {
                mask.Anchor     = AnchorType.Fill;
                mask.RawSize    = Vector2.zero;
                mask.Position   = Vector2.zero;
                mask.SpriteName = "box";
                mask.Color      = Color.black;

                imageDisplay = mask.CreateChild <MapImageDisplay>("imageDisplay", 0);
                {
                    imageDisplay.Anchor  = AnchorType.Fill;
                    imageDisplay.RawSize = Vector2.zero;
                }
                gradient = mask.CreateChild <UguiSprite>("gradient", 1);
                {
                    gradient.Anchor     = AnchorType.Fill;
                    gradient.Offset     = new Offset(0f, -22f, 0f, 0f);
                    gradient.SpriteName = "gradation-bottom";
                    gradient.Color      = new Color(0f, 0f, 0f, 0.9f);
                }
                title = mask.CreateChild <Label>("title", 2);
                {
                    title.Anchor = AnchorType.BottomStretch;
                    title.SetOffsetHorizontal(16f);
                    title.Y        = 92f;
                    title.Height   = 30f;
                    title.IsBold   = true;
                    title.WrapText = true;
                    title.FontSize = 18;
                }
                artist = mask.CreateChild <Label>("artist", 3);
                {
                    artist.Anchor = AnchorType.BottomStretch;
                    artist.SetOffsetHorizontal(16f);
                    artist.Y        = 70f;
                    artist.Height   = 30f;
                    artist.WrapText = true;
                    artist.FontSize = 16;
                }
                randomButton = mask.CreateChild <ControlButton>("random", 4);
                {
                    randomButton.Anchor   = AnchorType.BottomLeft;
                    randomButton.X        = 36f;
                    randomButton.Y        = 36f;
                    randomButton.Size     = new Vector2(48f, 48f);
                    randomButton.IconName = "icon-random";
                    randomButton.IconSize = 24f;

                    randomButton.OnTriggered += model.RandomizeMusic;
                }
                prevButton = mask.CreateChild <ControlButton>("prev", 5);
                {
                    prevButton.Anchor   = AnchorType.Bottom;
                    prevButton.X        = -56f;
                    prevButton.Y        = 36f;
                    prevButton.Size     = new Vector2(48f, 48f);
                    prevButton.IconName = "icon-backward";
                    prevButton.IconSize = 24f;

                    prevButton.OnTriggered += model.PrevMusic;
                }
                playButton = mask.CreateChild <ControlButton>("play", 6);
                {
                    playButton.Anchor   = AnchorType.Bottom;
                    playButton.Y        = 36f;
                    playButton.Size     = new Vector2(48f, 48f);
                    playButton.IconName = "icon-play";
                    playButton.IconSize = 32f;

                    playButton.OnTriggered += model.TogglePlaying;
                }
                nextButton = mask.CreateChild <ControlButton>("next", 7);
                {
                    nextButton.Anchor   = AnchorType.Bottom;
                    nextButton.X        = 56f;
                    nextButton.Y        = 36f;
                    nextButton.Size     = new Vector2(48f, 48f);
                    nextButton.IconName = "icon-forward";
                    nextButton.IconSize = 24f;

                    nextButton.OnTriggered += model.NextMusic;
                }
                timeBar = mask.CreateChild <TimeBar>("timebar", 8);
                {
                    timeBar.Anchor = AnchorType.BottomStretch;
                    timeBar.Pivot  = PivotType.Bottom;
                    timeBar.SetOffsetHorizontal(0f);
                    timeBar.Y      = 0f;
                    timeBar.Height = 8f;
                }
            }

            OnEnableInited();
        }