public void SetRightButtonLabel(FresviiGUIMatchMaking.Mode state) { if (state == FresviiGUIMatchMaking.Mode.Setting) { rightLabelContent = new GUIContent(FresviiGUIText.Get("Start")); title = FresviiGUIText.Get("SelectOpponents"); } else if (state == FresviiGUIMatchMaking.Mode.Matching) { rightLabelContent = new GUIContent(FresviiGUIText.Get("Cancel")); title = FresviiGUIText.Get("WaitingForPlayers"); } else { title = FresviiGUIText.Get("SelectOpponents"); rightLabelContent = new GUIContent(""); } }
public void Init(Texture2D appIcon, string postFix, float scaleFactor, int guiDepth, FresviiGUIMatchMaking frameMatchMaking) { if (Application.platform == RuntimePlatform.IPhonePlayer) { guiStyleTitle.font = null; guiStyleSubTitle.font = null; guiStyleTitle.fontStyle = FontStyle.Bold; guiStyleBackButton.font = null; guiStyleCancelButton.font = null; } this.appIcon = appIcon; this.frameMatchMaking = frameMatchMaking; this.guiDepth = guiDepth; this.scaleFactor = scaleFactor; title = FresviiGUIText.Get("SelectOpponents"); palette = FresviiGUIColorPalette.Palette; texCoordsMenu = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.NavigationBarBackground); texCoordsBorderLine = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.NavigationBarUnderLine); height *= scaleFactor; guiStyleTitle.fontSize = (int)(guiStyleTitle.fontSize * scaleFactor); guiStyleSubTitle.fontSize = (int)(guiStyleSubTitle.fontSize * scaleFactor); guiStyleTitle.normal.textColor = guiStyleSubTitle.normal.textColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.NavigationBarTitle); guiStyleTitle.padding = FresviiGUIUtility.RectOffsetScale(guiStyleTitle.padding, scaleFactor); guiStyleSubTitle.padding = FresviiGUIUtility.RectOffsetScale(guiStyleSubTitle.padding, scaleFactor); hMargin *= scaleFactor; vMargin *= scaleFactor; appIconPosition = FresviiGUIUtility.RectScale(appIconPosition, scaleFactor); appIconButtonPosition = FresviiGUIUtility.RectScale(appIconButtonPosition, scaleFactor); guiStyleCancelButton.fontSize = (int)(guiStyleCancelButton.fontSize * scaleFactor); guiStyleCancelButton.normal.textColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.NavigationBarNormal); rightLabelContent = new GUIContent(""); rightLabelPosition.width = guiStyleCancelButton.CalcSize(rightLabelContent).x + hMargin; texCoodsProgressBar = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.CardProgressBar); }
public void Init(float scaleFactor, FresviiGUIFrame parentFrame, FresviiGUIMatchMaking frameMatchMaking) { this.parentFrame = parentFrame; this.transform.parent = parentFrame.transform; this.frameMatchMaking = frameMatchMaking; if (Application.platform == RuntimePlatform.IPhonePlayer) { guiStyleUserName.font = null; guiStyleUserName.fontStyle = FontStyle.Bold; guiStyleText.font = null; guiStyleTag.font = null; guiStylePlayerStatus.font = null; } userIconPosition = FresviiGUIUtility.RectScale(userIconPosition, scaleFactor); tagPosition = FresviiGUIUtility.RectScale(tagPosition, scaleFactor); userNamePosition = FresviiGUIUtility.RectScale(userNamePosition, scaleFactor); playerNamePosition = FresviiGUIUtility.RectScale(playerNamePosition, scaleFactor); palyerStatusPosition = FresviiGUIUtility.RectScale(palyerStatusPosition, scaleFactor); sideMargin = userIconPosition.x; cardHeight *= scaleFactor; guiStyleUserName.fontSize = (int)(guiStyleUserName.fontSize * scaleFactor); guiStyleText.fontSize = (int)(guiStyleText.fontSize * scaleFactor); guiStyleTag.fontSize = (int)(guiStyleTag.fontSize * scaleFactor); guiStyleTag.padding = FresviiGUIUtility.RectOffsetScale(guiStyleTag.padding, scaleFactor); guiStylePlayerStatus.fontSize = (int)(guiStylePlayerStatus.fontSize * scaleFactor); palette = FresviiGUIColorPalette.Palette; guiStylePlayerStatus.normal.textColor = guiStyleUserName.normal.textColor = guiStyleText.normal.textColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.CardUserName); texCoordsBackground = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.CardBackground); if (frameMatchMaking.State == FresviiGUIMatchMaking.Mode.Setting) { contentUserName = new GUIContent(FresviiGUIText.Get("InviteFriend")); } else if (frameMatchMaking.State == FresviiGUIMatchMaking.Mode.Matching) { contentUserName = new GUIContent(FresviiGUIText.Get("AutoMatch")); } guiStyleTag.normal.textColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.CardBackground); tagString = FresviiGUIText.Get("You"); }