protected override void OnAppearing() { base.OnAppearing(); LoadingImage.PlayAnimation(); ChangeLayout(); }
protected override void OnAppearing() { base.OnAppearing(); LoadingImage.Play(); this.ChangeLayout(); }
private async void ShowLoading(string text) { LoadingText.Text = text; if (!isloading) { isloading = true; Loading.Visibility = Visibility.Visible; while (isloading) { await LoadingImage.Rotate(20f, 50f, 0).Then().Rotate(-20f, 50f, 0).SetDelay(200).SetDurationForAll(1000).StartAsync(); } } }
private Manager() { #region Creates Loading Threads var loaderThreadForThumbnails = new Thread(async() => { await LoaderThreadThumbnails(); }) { IsBackground = true, Priority = ThreadPriority.BelowNormal }; // otherwise, the app won't quit with the UI... loaderThreadForThumbnails.Start(); var loaderThreadForNormalSize = new Thread(async() => { await LoaderThreadNormalSize(); }) { IsBackground = true, Priority = ThreadPriority.BelowNormal }; // otherwise, the app won't quit with the UI... loaderThreadForNormalSize.Start(); #endregion #region Loading Images from Resources var resourceDictionary = new ResourceDictionary { Source = new Uri("Popcorn.ImageLoader;component/Resources.xaml", UriKind.Relative) }; LoadingImage = resourceDictionary["ImageLoading"] as DrawingImage; LoadingImage.Freeze(); ErrorThumbnail = resourceDictionary["ImageError"] as DrawingImage; ErrorThumbnail.Freeze(); #endregion # region Create Loading Animation
public void ShowLoadingStatus(string message) { LoadingImage.Visibility = System.Windows.Visibility.Visible; LoadingImage.UpdateLayout(); this.SetStatusText(message); }
void Start() { manager = GameObject.FindGameObjectWithTag ( "Manager" ); startupManager = manager.GetComponent<StartupManager> (); socketsManager = manager.GetComponent<SocketsManager> (); onlineMusicBrowser = GameObject.FindGameObjectWithTag ( "OnlineMusicBrowser" ).GetComponent <OnlineMusicBrowser>(); paneManager = manager.GetComponent <PaneManager> (); loadingImage = GameObject.FindGameObjectWithTag ( "LoadingImage" ).GetComponent<LoadingImage>(); currentSlideshowImage = GameObject.FindGameObjectWithTag ( "SlideshowImage" ).GetComponent<GUITexture>(); currentSong = GameObject.FindGameObjectWithTag ( "CurrentSong" ).GetComponent<GUIText>(); musicViewerPosition.width = Screen.width; musicViewerPosition.height = Screen.height; bottomBarPosition = new Rect (( musicViewerPosition.width - 240 ) / 2 , musicViewerPosition.height - 18, 240, 54 ); optionsWindowRect.x = musicViewerPosition.width/2 - optionsWindowRect.width/2; optionsWindowRect.y = musicViewerPosition.height/2 - optionsWindowRect.height/2; audioVisualizer = GameObject.FindGameObjectWithTag ("AudioVisualizer").GetComponent<AudioVisualizer> (); timemark = GameObject.FindGameObjectWithTag ( "Timemark" ).GetComponent<GUIText> (); GameObject.FindGameObjectWithTag ( "TimebarImage" ).guiTexture.pixelInset = new Rect ( -musicViewerPosition.width/2, musicViewerPosition.height/2 - 3, musicViewerPosition.width, 6 ); LoadSettings ( false ); centerStyle = new GUIStyle (); centerStyle.alignment = TextAnchor.MiddleCenter; labelStyle = new GUIStyle (); labelStyle.alignment = TextAnchor.MiddleCenter; labelStyle.wordWrap = true; folderStyle = new GUIStyle (); folderStyle.alignment = TextAnchor.MiddleLeft; folderStyle.border = new RectOffset ( 6, 6, 4, 4 ); folderStyle.hover.background = guiSkin.button.hover.background; folderStyle.active.background = guiSkin.button.active.background; folderStyle.fontSize = 22; fileStyle = new GUIStyle (); fileStyle.alignment = TextAnchor.MiddleLeft; fileStyle.border = new RectOffset ( 6, 6, 6, 4 ); fileStyle.padding = new RectOffset ( 6, 6, 3, 3 ); fileStyle.margin = new RectOffset ( 4, 4, 4, 4 ); fileStyle.hover.background = guiSkin.button.hover.background; fileStyle.active.background = guiSkin.button.active.background; fileStyle.fontSize = 22; fileBrowserFileStyle = new GUIStyle (); fileBrowserFileStyle.alignment = TextAnchor.MiddleLeft; currentSongStyle = new GUIStyle (); currentSongStyle.font = secretCode; currentSongStyle.fontSize = 31; songStyle = new GUIStyle (); songStyle.alignment = TextAnchor.MiddleLeft; songStyle.fontSize = 16; buttonStyle = new GUIStyle (); buttonStyle.fontSize = 22; buttonStyle.alignment = TextAnchor.MiddleCenter; buttonStyle.border = new RectOffset ( 6, 6, 6, 4 ); buttonStyle.padding = new RectOffset ( 6, 6, 3, 3 ); buttonStyle.margin = new RectOffset ( 4, 4, 4, 4 ); buttonStyle.hover.background = guiSkin.button.hover.background; hideGUIStyle = new GUIStyle (); hideGUIStyle.normal.background = hideGUINormal; hideGUIStyle.hover.background = hideGUIHover; hideGUIStyle.onNormal.background = hideGUIOnNormal; hideGUIStyle.onHover.background = hideGUIOnHover; showVisualizerStyle = new GUIStyle (); showVisualizerStyle.normal.background = showAudioVisualizerNormal; showVisualizerStyle.hover.background = showAudioVisualizerHover; showVisualizerStyle.onNormal.background = showAudioVisualizerOnNormal; showVisualizerStyle.onHover.background = showAudioVisualizerOnHover; doubleSpeedStyle = new GUIStyle (); doubleSpeedStyle.normal.background = audioSpeedDoubleNormal; doubleSpeedStyle.hover.background = audioSpeedDoubleHover; doubleSpeedStyle.onNormal.background = audioSpeedNormalNormal; doubleSpeedStyle.onHover.background = audioSpeedNormalHover; halfSpeedStyle = new GUIStyle (); halfSpeedStyle.normal.background = audioSpeedHalfNormal; halfSpeedStyle.hover.background = audioSpeedHalfHover; halfSpeedStyle.onNormal.background = audioSpeedNormalNormal; halfSpeedStyle.onHover.background = audioSpeedNormalHover; echoStyle = new GUIStyle (); echoStyle.normal.background = echoNormal; echoStyle.hover.background = echoHover; echoStyle.onNormal.background = echoOnNormal; echoStyle.onHover.background = echoOnHover; InvokeRepeating ( "Refresh", 0, 2 ); StartCoroutine ( SetArtwork ()); }
void Start() { debugLog = GameObject.FindGameObjectWithTag("DebugLog").GetComponent <DebugLog>(); deckManager = GameObject.FindGameObjectWithTag("Manager").GetComponent <DeckManager>(); serversManager = GameObject.FindGameObjectWithTag("Manager").GetComponent <ServersManager>(); preferencesManager = GameObject.FindGameObjectWithTag("Manager").GetComponent <PreferencesManager>(); externalInformation = GameObject.FindGameObjectWithTag("ExternalInformation").GetComponent <ExternalInformation>(); networkManager = GameObject.FindGameObjectWithTag("NetworkManager").GetComponent <NetworkManager>(); loadingImage = gameObject.GetComponent <LoadingImage>(); homePaneRect = new Rect(0, 0, Screen.width, Screen.height); controlWindowRect = new Rect(Screen.width / 2 - 386, 204, 772, 360); gameWindowRect = new Rect(0, 0, Screen.width, Screen.height); chatWindowRect = new Rect(Screen.width - 300, 150, 305, Screen.height / 2); bottomRect = new Rect(10, Screen.height - 300, Screen.width - 20, 300); bottomActiveZone = new Rect(0, 0, Screen.width, 280); labelLeftLargeStyle = new GUIStyle(); labelLeftLargeStyle.fontSize = 48; labelLeftLargeStyle.alignment = TextAnchor.MiddleLeft; labelLeftLargeStyle.padding = new RectOffset(0, 0, 3, 3); labelLeftLargeStyle.margin = new RectOffset(4, 4, 4, 4); labelLeftMediumStyle = new GUIStyle(); labelLeftMediumStyle.fontSize = 24; labelLeftMediumStyle.alignment = TextAnchor.MiddleLeft; labelLeftMediumStyle.padding = new RectOffset(0, 0, 3, 3); labelLeftMediumStyle.margin = new RectOffset(4, 4, 4, 4); labelLeftSmallStyle = new GUIStyle(); labelLeftSmallStyle.fontSize = 16; labelLeftSmallStyle.wordWrap = true; labelLeftSmallStyle.alignment = TextAnchor.MiddleLeft; labelLeftSmallStyle.padding = new RectOffset(0, 0, 3, 3); labelLeftSmallStyle.margin = new RectOffset(4, 4, 4, 4); labelCenterLargeStyle = new GUIStyle(); labelCenterLargeStyle.fontSize = 48; labelCenterLargeStyle.alignment = TextAnchor.MiddleCenter; labelCenterLargeStyle.padding = new RectOffset(0, 0, 3, 3); labelCenterLargeStyle.margin = new RectOffset(4, 4, 4, 4); labelCenterMediumStyle = new GUIStyle(); labelCenterMediumStyle.fontSize = 24; labelCenterMediumStyle.alignment = TextAnchor.MiddleCenter; labelCenterMediumStyle.padding = new RectOffset(0, 0, 3, 3); labelCenterMediumStyle.margin = new RectOffset(4, 4, 4, 4); labelCenterSmallStyle = new GUIStyle(); labelCenterSmallStyle.fontSize = 16; labelCenterSmallStyle.alignment = TextAnchor.MiddleCenter; labelCenterSmallStyle.padding = new RectOffset(0, 0, 3, 3); labelCenterSmallStyle.margin = new RectOffset(4, 4, 4, 4); buttonLeftLargeStyle = new GUIStyle(); buttonLeftLargeStyle.fontSize = 48; buttonLeftLargeStyle.alignment = TextAnchor.MiddleLeft; buttonLeftLargeStyle.normal.background = guiSkin.button.normal.background; buttonLeftLargeStyle.hover.background = guiSkin.button.hover.background; buttonLeftLargeStyle.active.background = guiSkin.button.active.background; buttonLeftLargeStyle.border = new RectOffset(6, 6, 6, 4); buttonLeftLargeStyle.padding = new RectOffset(6, 6, 3, 3); buttonLeftLargeStyle.margin = new RectOffset(4, 4, 4, 4); buttonLeftMediumStyle = new GUIStyle(); buttonLeftMediumStyle.fontSize = 24; buttonLeftMediumStyle.alignment = TextAnchor.MiddleLeft; buttonLeftMediumStyle.normal.background = guiSkin.button.normal.background; buttonLeftMediumStyle.hover.background = guiSkin.button.hover.background; buttonLeftMediumStyle.active.background = guiSkin.button.active.background; buttonLeftMediumStyle.border = new RectOffset(6, 6, 6, 4); buttonLeftMediumStyle.padding = new RectOffset(6, 6, 3, 3); buttonLeftMediumStyle.margin = new RectOffset(4, 4, 4, 4); buttonLeftSmallStyle = new GUIStyle(); buttonLeftSmallStyle.fontSize = 16; buttonLeftSmallStyle.alignment = TextAnchor.MiddleLeft; buttonLeftSmallStyle.normal.background = guiSkin.button.normal.background; buttonLeftSmallStyle.hover.background = guiSkin.button.hover.background; buttonLeftSmallStyle.active.background = guiSkin.button.active.background; buttonLeftSmallStyle.border = new RectOffset(6, 6, 6, 4); buttonLeftSmallStyle.padding = new RectOffset(6, 6, 3, 3); buttonLeftSmallStyle.margin = new RectOffset(4, 4, 4, 4); buttonCenterLargeStyle = new GUIStyle(); buttonCenterLargeStyle.fontSize = 48; buttonCenterLargeStyle.alignment = TextAnchor.MiddleCenter; buttonCenterLargeStyle.normal.background = guiSkin.button.normal.background; buttonCenterLargeStyle.hover.background = guiSkin.button.hover.background; buttonCenterLargeStyle.active.background = guiSkin.button.active.background; buttonCenterLargeStyle.border = new RectOffset(6, 6, 6, 4); buttonCenterLargeStyle.padding = new RectOffset(6, 6, 3, 3); buttonCenterLargeStyle.margin = new RectOffset(4, 4, 4, 4); buttonCenterMediumStyle = new GUIStyle(); buttonCenterMediumStyle.fontSize = 24; buttonCenterMediumStyle.alignment = TextAnchor.MiddleCenter; buttonCenterMediumStyle.normal.background = guiSkin.button.normal.background; buttonCenterMediumStyle.hover.background = guiSkin.button.hover.background; buttonCenterMediumStyle.active.background = guiSkin.button.active.background; buttonCenterMediumStyle.border = new RectOffset(6, 6, 6, 4); buttonCenterMediumStyle.padding = new RectOffset(6, 6, 3, 3); buttonCenterMediumStyle.margin = new RectOffset(4, 4, 4, 4); buttonCenterSmallStyle = new GUIStyle(); buttonCenterSmallStyle.fontSize = 16; buttonCenterSmallStyle.alignment = TextAnchor.MiddleCenter; buttonCenterSmallStyle.normal.background = guiSkin.button.normal.background; buttonCenterSmallStyle.hover.background = guiSkin.button.hover.background; buttonCenterSmallStyle.active.background = guiSkin.button.active.background; buttonCenterSmallStyle.border = new RectOffset(6, 6, 6, 4); buttonCenterSmallStyle.padding = new RectOffset(6, 6, 3, 3); buttonCenterSmallStyle.margin = new RectOffset(4, 4, 4, 4); textFieldStyle = new GUIStyle(); textFieldStyle.font = guiSkin.font; textFieldStyle.font.material.color = Color.black; textFieldStyle.border = new RectOffset(4, 4, 4, 4); textFieldStyle.padding = new RectOffset(3, 3, 3, 3); textFieldStyle.margin = new RectOffset(5, 5, 5, 5); textFieldStyle.normal.background = guiSkin.textField.normal.background; textFieldStyle.hover.background = guiSkin.textField.hover.background; toggleStyle = new GUIStyle(); toggleStyle.normal.background = guiSkin.customStyles[1].active.background; toggleStyle.hover.background = guiSkin.customStyles[1].normal.background; toggleStyle.onNormal.background = guiSkin.customStyles[0].active.background; toggleStyle.onHover.background = guiSkin.customStyles[0].normal.background; toggleStyle.border = new RectOffset(5, 5, 5, 5); toggleStyle.padding = new RectOffset(2, 2, 2, 2); toggleStyle.margin = new RectOffset(5, 5, 5, 5); toggleStyle.overflow = new RectOffset(0, 0, 2, 0); toggleStyle.fixedWidth = 24; toggleStyle.fixedHeight = 24; windowStyle = new GUIStyle(); windowStyle.border = new RectOffset(6, 6, 6, 4); windowStyle.normal.background = guiSkin.customStyles[0].hover.background; windowStyle.onNormal.background = guiSkin.customStyles[0].hover.background; emptyStyle = new GUIStyle(); emptyStyle.fontSize = 48; emptyStyle.alignment = TextAnchor.MiddleLeft; emptyStyle.border = new RectOffset(6, 6, 6, 4); emptyStyle.padding = new RectOffset(6, 6, 3, 3); emptyStyle.margin = new RectOffset(4, 4, 4, 4); hiddenCenterLargeStyle = new GUIStyle(); hiddenCenterLargeStyle.fontSize = 48; hiddenCenterLargeStyle.alignment = TextAnchor.MiddleCenter; hiddenCenterLargeStyle.hover.background = guiSkin.button.normal.background; hiddenCenterLargeStyle.active.background = guiSkin.button.active.background; hiddenCenterLargeStyle.onNormal.background = guiSkin.button.active.background; hiddenCenterLargeStyle.border = new RectOffset(6, 6, 6, 4); hiddenCenterLargeStyle.padding = new RectOffset(6, 6, 3, 3); hiddenCenterLargeStyle.margin = new RectOffset(4, 4, 4, 4); hiddenCenterMediumStyle = new GUIStyle(); hiddenCenterMediumStyle.fontSize = 24; hiddenCenterMediumStyle.alignment = TextAnchor.MiddleCenter; hiddenCenterMediumStyle.hover.background = guiSkin.button.normal.background; hiddenCenterMediumStyle.active.background = guiSkin.button.active.background; hiddenCenterMediumStyle.border = new RectOffset(6, 6, 6, 4); hiddenCenterMediumStyle.padding = new RectOffset(6, 6, 3, 3); hiddenCenterMediumStyle.margin = new RectOffset(4, 4, 4, 4); hiddenCenterSmallStyle = new GUIStyle(); hiddenCenterSmallStyle.fontSize = 16; hiddenCenterSmallStyle.alignment = TextAnchor.MiddleCenter; hiddenCenterSmallStyle.hover.background = guiSkin.button.normal.background; hiddenCenterSmallStyle.active.background = guiSkin.button.active.background; hiddenCenterSmallStyle.border = new RectOffset(6, 6, 6, 4); hiddenCenterSmallStyle.padding = new RectOffset(6, 6, 3, 3); hiddenCenterSmallStyle.margin = new RectOffset(4, 4, 4, 4); hiddenLeftLargeStyle = new GUIStyle(); hiddenLeftLargeStyle.fontSize = 48; hiddenLeftLargeStyle.alignment = TextAnchor.MiddleLeft; hiddenLeftLargeStyle.hover.background = guiSkin.button.normal.background; hiddenLeftLargeStyle.active.background = guiSkin.button.active.background; hiddenLeftLargeStyle.onNormal.background = guiSkin.button.active.background; hiddenLeftLargeStyle.border = new RectOffset(6, 6, 6, 4); hiddenLeftLargeStyle.padding = new RectOffset(6, 6, 3, 3); hiddenLeftLargeStyle.margin = new RectOffset(4, 4, 4, 4); hiddenLeftMediumStyle = new GUIStyle(); hiddenLeftMediumStyle.fontSize = 24; hiddenLeftMediumStyle.alignment = TextAnchor.MiddleLeft; hiddenLeftMediumStyle.hover.background = guiSkin.button.normal.background; hiddenLeftMediumStyle.active.background = guiSkin.button.active.background; hiddenLeftMediumStyle.border = new RectOffset(6, 6, 6, 4); hiddenLeftMediumStyle.padding = new RectOffset(6, 6, 3, 3); hiddenLeftMediumStyle.margin = new RectOffset(4, 4, 4, 4); hiddenLeftSmallStyle = new GUIStyle(); hiddenLeftSmallStyle.fontSize = 16; hiddenLeftSmallStyle.alignment = TextAnchor.MiddleLeft; hiddenLeftSmallStyle.hover.background = guiSkin.button.normal.background; hiddenLeftSmallStyle.active.background = guiSkin.button.active.background; hiddenLeftSmallStyle.border = new RectOffset(6, 6, 6, 4); hiddenLeftSmallStyle.padding = new RectOffset(6, 6, 3, 3); hiddenLeftSmallStyle.margin = new RectOffset(4, 4, 4, 4); cardBlueStyle = new GUIStyle(); cardBlueStyle.fontSize = 48; cardBlueStyle.alignment = TextAnchor.MiddleLeft; cardBlueStyle.hover.background = guiSkin.customStyles[0].active.background; cardBlueStyle.active.background = guiSkin.customStyles[0].hover.background; cardBlueStyle.border = new RectOffset(6, 6, 6, 4); cardBlueStyle.padding = new RectOffset(6, 6, 3, 3); cardBlueStyle.margin = new RectOffset(4, 4, 4, 4); cardRedStyle = new GUIStyle(); cardRedStyle.fontSize = 48; cardRedStyle.alignment = TextAnchor.MiddleLeft; cardRedStyle.hover.background = guiSkin.customStyles[1].active.background; cardRedStyle.active.background = guiSkin.customStyles[1].hover.background; cardRedStyle.border = new RectOffset(6, 6, 6, 4); cardRedStyle.padding = new RectOffset(6, 6, 3, 3); cardRedStyle.margin = new RectOffset(4, 4, 4, 4); cardPurpleStyle = new GUIStyle(); cardPurpleStyle.fontSize = 48; cardPurpleStyle.alignment = TextAnchor.MiddleLeft; cardPurpleStyle.hover.background = guiSkin.customStyles[2].active.background; cardPurpleStyle.active.background = guiSkin.customStyles[2].hover.background; cardPurpleStyle.border = new RectOffset(6, 6, 6, 4); cardPurpleStyle.padding = new RectOffset(6, 6, 3, 3); cardPurpleStyle.margin = new RectOffset(4, 4, 4, 4); fieldCardStyle = cardBlueStyle; guicolor = new Color(1, 1, 1, 0); }
protected override void OnAppearing() { base.OnAppearing(); LoadingImage.Play(); }
protected internal virtual void drawMapTiles(Graphics paramGraphics, int paramInt, Rectangle paramRectangle) { int i = TileFactory.getTileSize(paramInt); Dimension dimension = TileFactory.getMapSize(paramInt); int j = paramRectangle.width / i + 2; int k = paramRectangle.height / i + 2; TileFactoryInfo tileFactoryInfo = TileFactory.Info; int m = (int)Math.Floor(paramRectangle.X / tileFactoryInfo.getTileSize(0)); int n = (int)Math.Floor(paramRectangle.Y / tileFactoryInfo.getTileSize(0)); for (int i1 = 0; i1 <= j; i1++) { for (int i2 = 0; i2 <= k; i2++) { int i3 = i1 + m; int i4 = i2 + n; if (paramGraphics.ClipBounds.intersects(new Rectangle(i3 * i - paramRectangle.x, i4 * i - paramRectangle.y, i, i))) { Tile tile = TileFactory.getTile(i3, i4, paramInt); if (!tile.Loaded) { tile.addUniquePropertyChangeListener("loaded", this.tileLoadListener); } int i5 = i3 * TileFactory.getTileSize(paramInt) - paramRectangle.x; int i6 = i4 * TileFactory.getTileSize(paramInt) - paramRectangle.y; if (isTileOnMap(i3, i4, dimension)) { if (Opaque) { paramGraphics.Color = Background; paramGraphics.fillRect(i5, i6, i, i); } } else if (tile.Loaded) { paramGraphics.drawImage(tile.Image, i5, i6, null); } else { int i7 = (TileFactory.getTileSize(paramInt) - LoadingImage.getWidth(null)) / 2; int i8 = (TileFactory.getTileSize(paramInt) - LoadingImage.getHeight(null)) / 2; paramGraphics.Color = Color.GRAY; paramGraphics.fillRect(i5, i6, i, i); paramGraphics.drawImage(LoadingImage, i5 + i7, i6 + i8, null); } if (DrawTileBorders) { paramGraphics.Color = Color.black; paramGraphics.drawRect(i5, i6, i, i); paramGraphics.drawRect(i5 + i / 2 - 5, i6 + i / 2 - 5, 10, 10); paramGraphics.Color = Color.white; paramGraphics.drawRect(i5 + 1, i6 + 1, i, i); string str = i3 + ", " + i4 + ", " + Zoom; paramGraphics.Color = Color.BLACK; paramGraphics.drawString(str, i5 + 10, i6 + 30); paramGraphics.drawString(str, i5 + 10 + 2, i6 + 30 + 2); paramGraphics.Color = Color.WHITE; paramGraphics.drawString(str, i5 + 10 + 1, i6 + 30 + 1); } } } } }