public void Init(Texture2D appIcon, string postFix, float scaleFactor, int guiDepth, FresviiGUIGroupMessage frameGroupMessage) { if (Application.platform == RuntimePlatform.IPhonePlayer) { guiStyleTitle.font = null; guiStyleTitle.fontStyle = FontStyle.Bold; guiStyleBackButton.font = null; guiStyleCreateButton.font = null; } this.appIcon = appIcon; this.frameGroupMessage = frameGroupMessage; this.guiDepth = guiDepth; createIcon = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.MessageCompose + postFix, false); title = FresviiGUIText.Get("Messages"); palette = FresviiGUIColorPalette.Palette; texCoordsMenu = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.NavigationBarBackground); texCoordsBorderLine = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.NavigationBarUnderLine); height *= scaleFactor; guiStyleTitle.fontSize = (int)(guiStyleTitle.fontSize * scaleFactor); guiStyleTitle.normal.textColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.NavigationBarTitle); hMargin *= scaleFactor; vMargin *= scaleFactor; appIconPosition = FresviiGUIUtility.RectScale(appIconPosition, scaleFactor); colorNormal = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.NavigationBarNormal); appIconButtonPosition = FresviiGUIUtility.RectScale(appIconButtonPosition, scaleFactor); createButtonPosition = FresviiGUIUtility.RectScale(createButtonPosition, scaleFactor); guiStyleCreateButton.fontSize = (int)(guiStyleCreateButton.fontSize * scaleFactor); createIconColor = guiStyleCreateButton.normal.textColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.NavigationBarNormal); this.backIcon = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.BackIconTextureName + postFix, false); backButtonPosition = new Rect(vMargin, 0.5f * (height - backIcon.height), backIcon.width, backIcon.height); backButtonHitPosition = new Rect(0, 0, backButtonPosition.x + backButtonPosition.width + vMargin, height); }
public void Init(Fresvii.AppSteroid.Models.Group group, float scaleFactor, FresviiGUIGroupMessage frameGroupMessage) { this.Group = group; this.frameGroupMessage = frameGroupMessage; if (Application.platform == RuntimePlatform.IPhonePlayer) { guiStyleMemberNames.font = null; guiStyleMemberNames.fontStyle = FontStyle.Bold; guiStyleTimeSpan.font = null; guiStyleComment.font = null; guiStyleDelete.font = null; } userIconPosition = FresviiGUIUtility.RectScale(userIconPosition, scaleFactor); memberNamesPosition = FresviiGUIUtility.RectScale(memberNamesPosition, scaleFactor); timeSpanPosition = FresviiGUIUtility.RectScale(timeSpanPosition, scaleFactor); commentPosition = FresviiGUIUtility.RectScale(commentPosition, scaleFactor); unreadIconPosition = FresviiGUIUtility.RectScale(unreadIconPosition, scaleFactor); iconMargin *= scaleFactor; sideMargin = userIconPosition.x; cardHeight *= scaleFactor; guiStyleMemberNames.fontSize = (int)(guiStyleMemberNames.fontSize * scaleFactor); palette = FresviiGUIColorPalette.Palette; guiStyleMemberNames.normal.textColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.CardUserName); texCoordsBackground = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.CardBackground); bgColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.CardBackground); texCoordsSeperateLine = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.GroupCardTopShadowLine); guiStyleTimeSpan.fontSize = (int)(guiStyleTimeSpan.fontSize * scaleFactor); guiStyleComment.fontSize = (int)(guiStyleComment.fontSize * scaleFactor); guiStyleTimeSpan.normal.textColor = guiStyleComment.normal.textColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.CardText2); textureCoordsDelete = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.CardDeleteBackground); deleteButtonWidth *= scaleFactor; guiStyleDelete.fontSize = (int)(guiStyleDelete.fontSize * scaleFactor); guiStyleDelete.normal.textColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.CardText1); SetUserIcons(); }