public static void SaveUGUI(GameObject UI) { CImage[] sprites = UI.GetComponentsInChildren <CImage>(true); for (int j = 0; j < sprites.Length; j++) { CImage sprite = sprites[j]; if (!sprite.sprite) { continue; } sprite.AtlasName = sprite.sprite.texture.name.ToLower();; sprite.SpriteName = sprite.sprite.name; } CText[] texts = UI.GetComponentsInChildren <CText>(true); for (int j = 0; j < texts.Length; j++) { CText t = texts[j]; if (!t.font) { continue; } t.FontName = t.font.name; } AssetDatabase.Refresh(); AssetDatabase.SaveAssets(); }
public RectangleF GetTextBounds(CText text, float Height) { CFonts.Height = Height; CFonts.SetFont(text.Fon); CFonts.Style = text.Style; return(new RectangleF(text.X, text.Y, CFonts.GetTextWidth(CLanguage.Translate(text.Text)), CFonts.GetTextHeight(CLanguage.Translate(text.Text)))); }
override public void destroy() { base.destroy(); btnNextScreen.destroy(); btnNextScreen = null; optionsBttn.destroy(); optionsBttn = null; mBoard.destroy(); mBoard = null; monster.destroy(); monster = null; building.destroy(); building = null; screenDim.destroy(); screenDim = null; timeLeft.destroy(); timeLeft = null; skills.destroy(); skills = null; backMenuBttn.destroy(); backMenuBttn = null; tryAgainBttn.destroy(); tryAgainBttn = null; scoreText.destroy(); scoreText = null; }
public CActivePage() : base(ECallPages.P_ACTIVE, "Connected...") { _duration = new CText("00:00"); _duration.PosY = 2; _duration.Align = EAlignment.justify_right; CTimeoutDecorator decor = new CTimeoutDecorator(_duration, 1000, true); decor.OnTimeout += new VoidDelegate(decor_OnTimeout); add(decor); _hold = new CLink("Hold"); _hold.Softkey += new BoolIntDelegate(_hold_Softkey); _hold.PosY = 7; add(_hold); _3pty = new CLink("3Pty"); _3pty.Align = EAlignment.justify_right; _3pty.PosY = 8; //add(_3pty); _xfer = new CLink("Transfer"); //_xfer.Softkey += new BoolIntDelegate(_xfer_Softkey); _xfer.PosY = 9; add(_xfer); this.Digitkey += new BoolIntDelegate(CActivePage_Digitkey); }
public static void WriteCText(this NetBuffer message, CText cText) { message.Write(cText.format); message.Write(cText.origin); message.Write(cText.position); message.Write(cText.color.ToVector3()); }
public CInitPage() : base((int)EPages.P_INIT) { this.forgetPage(true); CLink link = new CLink("Initializing", (int)EPages.P_INIT); link.Align = EAlignment.justify_center; link.PosY = 2; link.LinkKey = link.PosY; this.add(link); CText text = new CText("Sipek Phone", EAlignment.justify_center); text.PosY = 3; this.add(text); CText txt = new CText("....."); txt.PosY = 5; txt.PosX = 10; CHorizontalScroller scrollingtext = new CHorizontalScroller(txt, 10, 200); // add(scrollingtext); // solve problem with remaining dots this.Ok += new VoidDelegate(okhandler); }
public CMessageBoxPage() : base((int)EPages.P_MESSAGEBOX, "Send Message To...") { _titleText = new CText("Buddy"); _titleText.PosY = 1; add(_titleText); _textBox = new CTextBox(""); _textBox.PosY = 2; add(_textBox); _editBox = new CEditBox(">", ""); _editBox.PosY = 5; add(_editBox); CLink sendLink = new CLink("Send"); sendLink.PosY = 10; sendLink.Align = EAlignment.justify_right; sendLink.Softkey += new BoolIntDelegate(sendLink_Softkey); this.add(sendLink); _buddyName = new CLink(""); _buddyName.PosY = 3; add(_buddyName); this.Ok += new VoidDelegate(CMessageBoxPage_Ok); }
private void _CreateRoundsTable() { //Create lists _RoundsTable = new List <CRoundsTableRow>(); for (int i = 0; i < 5; i++) { var rtr = new CRoundsTableRow { TextPlayer = new List <CText>(), TextScores = new List <CText>() }; _RoundsTable.Add(rtr); } //Create statics and texts for rounds foreach (CRoundsTableRow roundRow in _RoundsTable) { //Round-number CText text = GetNewText(_Texts[_TextRoundNumber]); _AddText(text); roundRow.Number = text; for (int row = 0; row < 2; row++) { for (int column = 0; column < 3; column++) { //Player text = GetNewText(_Texts[_TextRoundPlayer]); _AddText(text); roundRow.TextPlayer.Add(text); //Score text = GetNewText(_Texts[_TextRoundScore]); _AddText(text); roundRow.TextScores.Add(text); } } } }
public static void init() { if (mInitialized) { return; } mInitialized = true; dialogs = new List <Dialog>(); shadow = new CSprite(); //Esta tambien el shadow solo que llena toda la pantalla shadow.setImage(Resources.Load <Sprite>("Sprites/dialogShadow/shadow")); shadow.setName("Dialog - Background"); shadow.setSortingLayerName("UI"); shadow.setXY(0, CGameConstants.SCREEN_HEIGHT / 3 * 2); shadow.setWidth(CGameConstants.SCREEN_WIDTH); shadow.setVisible(false); characterPortrait = new CSprite(); characterPortrait.setName("Character - Portrait"); characterPortrait.setSortingLayerName("UI"); characterPortrait.setXY(shadow.getX() + MARGIN, shadow.getY() + MARGIN); characterPortrait.setVisible(false); characterPortrait.setSortingOrder(1); text = new CText(""); text.setFontSize(500.0f); text.setVisible(false); text.setXY(CGameConstants.SCREEN_WIDTH / 4 + MARGIN, shadow.getY() + MARGIN); text.setWidth(CGameConstants.SCREEN_WIDTH / 4 * 3 - MARGIN * 2); }
protected void LoadAsset(GameObject go) { CText[] texts = go.GetComponentsInChildren <CText>(true); for (int i = 0; i < texts.Length; ++i) { CText t = texts[i]; if (t.FontName == Global.uifont.name) { t.font = Global.uifont; } else { t.font = Global.uifont_title; } } List <CImage> imagelist = new List <CImage>(); CImage[] images = go.GetComponentsInChildren <CImage>(true); for (int i = 0; i < images.Length; ++i) { CImage ci = images[i]; if (string.IsNullOrEmpty(ci.AtlasName)) { continue; } imagelist.Add(ci); CreateSPInstance(ci.AtlasName); } AddTimer(OnAllSpritesCompleteEvent, imagelist, 0, 0); }
override public void init() { base.init(); mBackground = new CSprite(); mBackground.setImage(Resources.Load <Sprite> ("Sprites/ui/menu/fondo")); mBackground.setXY(0, 0); mBackground.setSortingLayerName("Background"); mBackground.setName("background"); mButtonPlay = new CButtonSprite("Play"); mButtonPlay.setFrames(Resources.LoadAll <Sprite>("Sprites/ui/menu/button")); mButtonPlay.setName("PlayImage"); mButtonPlay.setXY(CGameConstants.SCREEN_WIDTH / 2 + 700, CGameConstants.SCREEN_HEIGHT / 2 - 150); mButtonPlay.setScale(500); exitButton = new CButtonSprite("Exit"); exitButton.setFrames(Resources.LoadAll <Sprite>("Sprites/ui/menu/button")); exitButton.setName("ExitImage"); exitButton.setXY(mButtonPlay.getX(), CGameConstants.SCREEN_HEIGHT / 3 * 2 - 10); logo = new CText(" "); logo.setXY(CGameConstants.SCREEN_WIDTH / 2, CGameConstants.SCREEN_HEIGHT / 4 * 1); logo.setFontSize(1000f); logo.setPivot(0.5f, 0.5f); logo.setWidth(CGameConstants.SCREEN_WIDTH); logo.setAlignment(TMPro.TextAlignmentOptions.Center); }
public CDoubleDecorator(CEditField decoratee) : base(null) { // create list that will hold two controls (text and edit) CComponentList list = new CComponentList(); // set list position list.PosY = decoratee.PosY; // take prompt data from decoratee and put it into text control int pos = decoratee.PosY; _text = new CText(decoratee.Prompt); _text.PosY = pos; // put decoratee (edit) under text control and erase prompt decoratee.PosY = pos + 1; decoratee.Prompt = ""; // add both controls list.add(_text); list.add(decoratee); // set list as decoratee _component = list; }
private void _DrawTileArtistTexts() { int i = 0; foreach (CText text in _Artists) { if (i < _Covers.Count && _Covers[i].Selected) { _DrawSelectedTileArtistText(text); } else if (i < _Covers.Count) { CText drawtext = new CText(text); drawtext.Color.A = 0.5f; drawtext.X = MaxRect.X + _TileCoverW + _TileTextIndent; drawtext.Y -= _ListDragDiffY; drawtext.Draw(); } else { text.Text = ""; } i++; } }
public CSongMenuDetails(SThemeSongMenu theme, int partyModeID) : base(theme, partyModeID) { _Artist = new CText(_Theme.SongMenuDetails.TextArtist, _PartyModeID); _Title = new CText(_Theme.SongMenuDetails.TextTitle, _PartyModeID); _SongLength = new CText(_Theme.SongMenuDetails.TextSongLength, _PartyModeID); _TileBleedCount = _Theme.SongMenuDetails.TileBleedCount; _TileSpacing = _Theme.SongMenuDetails.TileSpacing; _TileTextIndent = _Theme.SongMenuDetails.TileTextIndent; _Tile = new CStatic(_Theme.SongMenuDetails.StaticTile, _PartyModeID); _TileSelected = new CStatic(_Theme.SongMenuDetails.StaticTileSelected, _PartyModeID); _ScrollBar = new CStatic(_Theme.SongMenuDetails.StaticScrollBar, _PartyModeID); _ScrollBarPointer = new CStatic(_Theme.SongMenuDetails.StaticScrollBarPointer, _PartyModeID); _Artist = new CText(_Theme.SongMenuDetails.TextArtist, _PartyModeID); _Title = new CText(_Theme.SongMenuDetails.TextTitle, _PartyModeID); _SongLength = new CText(_Theme.SongMenuDetails.TextSongLength, _PartyModeID); _VideoBG = new CStatic(_Theme.SongMenuDetails.StaticVideoBG, _PartyModeID); _BigCover = new CStatic(_Theme.SongMenuDetails.StaticBigCover, _PartyModeID); _TextBG = new CStatic(_Theme.SongMenuDetails.StaticTextBG, _PartyModeID); _DuetIcon = new CStatic(_Theme.SongMenuDetails.StaticDuetIcon, _PartyModeID); _VideoIcon = new CStatic(_Theme.SongMenuDetails.StaticVideoIcon, _PartyModeID); _MedleyCalcIcon = new CStatic(_Theme.SongMenuDetails.StaticMedleyCalcIcon, _PartyModeID); _MedleyTagIcon = new CStatic(_Theme.SongMenuDetails.StaticMedleyTagIcon, _PartyModeID); _SubElements.AddRange(new IMenuElement[] { _Artist, _Title, _SongLength, _DuetIcon, _VideoIcon, _MedleyCalcIcon, _MedleyTagIcon }); _DragTimer = new Stopwatch(); }
private void _InitTiles() { MaxRect = _Theme.SongMenuDetails.TileAreaRect; _ListTextWidth = MaxRect.W - _ListTextWidth; _CoverBGTexture = CBase.Themes.GetSkinTexture(_Theme.CoverBackground, _PartyModeID); _VideoBGBGTexture = CBase.Themes.GetSkinTexture(_Theme.CoverBigBackground, _PartyModeID); _BigCoverBGTexture = CBase.Themes.GetSkinTexture(_Theme.CoverBigBackground, _PartyModeID); _TileBGTexture = CBase.Themes.GetSkinTexture(_Theme.TileBackground, _PartyModeID); //Create cover tiles _Covers = new List <CStatic>(); _Tiles = new List <CStatic>(); _Artists = new List <CText>(); _Titles = new List <CText>(); _ListLength = (int)(MaxRect.H / (_Tile.H + (_TileSpacing / 2))); _TileCoverH = _Tile.H; _TileCoverW = _TileCoverH; float TileTextWidth = _Tile.W - _TileCoverW - (_TileTextIndent * 2); float TileTextArtistHeight = 22; float TileTextTitleHeight = 24; for (int i = 0; i < _ListLength; i++) { //Create Cover var rect = new SRectF(Rect.X, Rect.Y + (i * (_TileCoverH + _TileSpacing)), _TileCoverW, _TileCoverH, Rect.Z); var cover = new CStatic(_PartyModeID, _CoverBGTexture, _Color, rect); _Covers.Add(cover); //Create Tile var BGrect = new SRectF(MaxRect.X, MaxRect.Y + i * (_Tile.H + _TileSpacing), MaxRect.W, _Tile.H, Rect.Z + 0.5f); var tilebg = new CStatic(_PartyModeID, _TileBGTexture, new SColorF(0, 0, 0, 0.6f), BGrect); _Tiles.Add(tilebg); //Create text var artistRect = new SRectF(MaxRect.X + _TileCoverW + _TileTextIndent, Rect.Y + (_TileSpacing / 2) + i * (_Tile.H + _TileSpacing) + (_TileTextIndent / 2) + TileTextTitleHeight, TileTextWidth, TileTextArtistHeight, Rect.Z - 1); CText artist = new CText(artistRect.X, artistRect.Y, artistRect.Z, artistRect.H, artistRect.W, EAlignment.Left, EStyle.Bold, "Outline", _Artist.Color, ""); artist.MaxRect = new SRectF(artist.MaxRect.X, artist.MaxRect.Y, MaxRect.W + MaxRect.X - artist.Rect.X - 5f, artist.MaxRect.H, artist.MaxRect.Z); artist.ResizeAlign = EHAlignment.Center; _Artists.Add(artist); var titleRect = new SRectF(MaxRect.X + _TileCoverW + _TileTextIndent, (Rect.Y + (_TileSpacing / 2) + i * (_Tile.H + _TileSpacing)) + (_TileTextIndent / 2), TileTextWidth, TileTextTitleHeight, Rect.Z - 1); CText title = new CText(titleRect.X, titleRect.Y, titleRect.Z, titleRect.H, titleRect.W, EAlignment.Left, EStyle.Normal, "Outline", _Artist.Color, ""); title.MaxRect = new SRectF(title.MaxRect.X, title.MaxRect.Y, MaxRect.W + MaxRect.X - title.Rect.X - 5f, title.MaxRect.H, title.MaxRect.Z); title.ResizeAlign = EHAlignment.Center; _Titles.Add(title); } _ScrollRect = MaxRect; }
public CSurvivalState(CInfo stageInfo) { CGame.inst().setImage("Sprites/level_Background00"); CurrentStageData.clearData(); SoundList.instance.playLevelMusic(); tryAgainInfo = stageInfo; switch (stageInfo.Kaiju) { case 1: monster = new Dinosaur(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage); break; case 2: monster = new Kong(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage); break; case 3: monster = new Kraken(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage); break; } current_state = STATE_PLAYING; CurrentStageData.difficulty = 0; mBoard = new Board(1); building = new Enemy(0); timeLeft = new CText("Time: ", CText.alignment.TOP_CENTER); timeLeft.setX(0); timeLeft.setY(0); timeLeft.setColor(Color.black); scoreText = new CText("SCORE :", CText.alignment.TOP_CENTER); scoreText.setX(400); scoreText.setY(0); scoreText.setColor(Color.black); btnNextScreen = new CSprite(); btnNextScreen.setSortingLayer("TextUI"); mBoard.targetScore = stageInfo.TargetScore; // MOVE TO CLASS float scoreCoefficient = (float)70 / (float)mBoard.targetScore; skills = new SkillBar(stageInfo.Kaiju); mTimer = new Timer(); CurrentStageData.assignData(monster, mBoard, scoreCoefficient, skills); CurrentStageData.assignTimer(mTimer); screenDim = new CSprite(); screenDim.setSortingLayer("ScreenShade"); screenDim.setName("Sombra"); backMenuBttn = new CSprite(); backMenuBttn.setSortingLayer("TextUI"); tryAgainBttn = new CSprite(); tryAgainBttn.setSortingLayer("TextUI"); optionsBttn = new CSprite(); optionsBttn.setImage(Resources.Load <Sprite>("Sprites/Buttons/Pause_Button")); optionsBttn.setXY(680, 40); optionsBttn.setSortingLayer("TextUI"); }
private void DrawText(float t, float dt, CText text) { if (text.format == null) { return; } mSpriteBatch.DrawString(text.font, text.format, text.position, text.color, 0f, text.origin, 1f, SpriteEffects.None, 0f); }
public CIdlePage() : base((int)EPages.P_IDLE) { _timedate = new CText(""); _timedate.PosY = 0; _timedate.Caption = System.DateTime.Now.ToShortDateString() + " " + System.DateTime.Now.ToShortTimeString(); CTimeoutDecorator timeDecor = new CTimeoutDecorator(_timedate, 1000, true); timeDecor.OnTimeout += new VoidDelegate(timeDateHandler); this.add(timeDecor); CText title = new CText("SIPek", EAlignment.justify_center); title.PosY = 3; add(title); // status indicator _statusBar = new CStatusBar(EAlignment.justify_right); _statusBar.PosY = 0; add(_statusBar); _displayName = new CText(""); _displayName.PosY = 4; _displayName.Align = EAlignment.justify_center; add(_displayName); CLink mlinkPhonebook = new CLink("Buddies", (int)EPages.P_PHONEBOOK); mlinkPhonebook.PosY = 9; mlinkPhonebook.LinkKey = mlinkPhonebook.PosY; this.add(mlinkPhonebook); _linkRinger = new CLink("Ring Mode", (int)EPages.P_RINGMODE); _linkRinger.Align = EAlignment.justify_right; _linkRinger.PosY = 8; _linkRinger.LinkKey = _linkRinger.PosY; this.add(_linkRinger); CLink mlinkCalls = new CLink("Calls", (int)EPages.P_CALLLOG); mlinkCalls.Align = EAlignment.justify_right; mlinkCalls.PosY = 10; mlinkCalls.LinkKey = mlinkCalls.PosY; this.add(mlinkCalls); _linkAccounts = new CLink("Accounts", (int)EPages.P_ACCOUNTS); _linkAccounts.PosY = 7; this.add(_linkAccounts); // Initialize handlers Digitkey += new BoolIntDelegate(digitkeyHandler); Charkey += new BoolIntDelegate(CIdlePage_Charkey); Offhook += new VoidDelegate(IdlePage_Offhook); Menu += new VoidDelegate(IdlePage_Menu); Ok += new VoidDelegate(IdlePage_Ok); }
private void CreateButton() { var button = new CButton(); var buttonObj = button.CreateButtonWithDefaultSettings(); var text = new CText(); text.Alignment = TextAnchor.MiddleCenter; text.CreateTextWithDefaultSettings(buttonObj.transform); }
public static CText ReadCText(this NetBuffer message) { var ctext = new CText(); ctext.format = message.ReadString(); ctext.origin = message.ReadVector2(); ctext.position = message.ReadVector2(); ctext.color = new Color(message.ReadVector3()); return(ctext); }
//-------------------------------------- // PUBLIC METHODS //-------------------------------------- public void addArrow() { AddComponent <C2DRenderable>(AddEntity(), mSelHighlight = new CText { color = Color.Black, font = mFont, format = "--->", origin = Vector2.Zero, position = new Vector2(Game1.Inst.GraphicsDevice.Viewport.Width * 0.1f - 70, 0) }); }
public static void SetStyle(CText text, int styleIdx = 0) { //if (text.colorIdx >= colors.Length) // text.colorIdx = colors.Length - 1; //string[] styleStr = colors[text.colorIdx].Split(';'); //text.color = GetColor(styleStr[0]); //if (!text.shadowEff) // text.shadowEff = text.gameObject.AddComponent<UnityEngine.UI.Shadow>(); //if (!text.outlineEff) // text.outlineEff = text.gameObject.AddComponent<Outline>(); //text.shadowEff.enabled = false; //text.outlineEff.enabled = false; //if (styleStr.Length > 1) //{ // for (int i = 1; i < styleStr.Length; i++) // { // string[] osStr = styleStr[i].Split(':'); // if (osStr[0] == "s") // { // text.shadowEff.enabled = true; // text.shadowEff.effectColor = GetColor(osStr[1]); // } // else if (osStr[0] == "o") // { // text.outlineEff.enabled = true; // text.outlineEff.effectColor = GetColor(osStr[1]); // } // } //} if (!text) { return; } UnityEngine.UI.Shadow[] shadows = text.GetComponentsInChildren <UnityEngine.UI.Shadow>(); for (int i = 0; i < shadows.Length; i++) { DestroyImmediate(shadows[i]); } if (styleIdx == 1) { UnityEngine.UI.Shadow sd = text.gameObject.AddComponent <UnityEngine.UI.Shadow>(); sd.effectColor = GetColor(sdColor); } else if (styleIdx == 2) { UnityEngine.UI.Outline ol = text.gameObject.AddComponent <UnityEngine.UI.Outline>(); ol.effectColor = GetColor(olColor); } }
public static void SetTextColorFromColorText(CText text, string color) { for (int i = 0; i < colors.Length; i++) { if (colors[i] == color) { text.colorIdx = i; text.color = GetColor("", text.colorIdx); break; } } }
private void _DrawSelectedTileText(CText text, float scaleFactor, EStyle style) { CText ScaledText = _ScaleText(text, scaleFactor, style); ScaledText.Color.A = 1f; float X = MaxRect.X - (MaxRect.W * (SelectedTileZoomFactor - 1) / 2); X += (_TileCoverW + _TileTextIndent) * SelectedTileZoomFactor; ScaledText.X = (float)Math.Round(X); ScaledText.Y -= _ListDragDiffY; ScaledText.Draw(); }
public CLevelState(int stageNumber) { SoundList.instance.playLevelMusic(); CInfo stageInfo = LevelsInfo.getLevel(stageNumber); CGame.inst().setImage("Sprites/level_Background0" + stageInfo.building.ToString()); CurrentStageData.currentStage = stageNumber; switch (stageInfo.Kaiju) { case 1: monster = new Dinosaur(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage); break; case 2: monster = new Kong(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage); break; case 3: monster = new Kraken(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage); break; } current_state = STATE_PLAYING; CurrentStageData.difficulty = stageInfo.dif; mBoard = new Board(0); //monster = new Kong(1, 53, 76); building = new Enemy(stageInfo.building); mText = new CText("TEST", CText.alignment.TOP_CENTER); mText.setX(0); mText.setY(0); mText.setColor(Color.black); mBoard.movementsLeft = stageInfo.movements; // MOVE TO CLASS mBoard.targetScore = stageInfo.TargetScore; // MOVE TO CLASS float scoreCoefficient = (float)70 / (float)mBoard.targetScore; skills = new SkillBar(stageInfo.Kaiju); CurrentStageData.assignData(monster, mBoard, scoreCoefficient, skills); screenDim = new CSprite(); screenDim.setSortingLayer("ScreenShade"); screenDim.setName("Sombra"); backMenuBttn = new CSprite(); backMenuBttn.setSortingLayer("TextUI"); tryAgainBttn = new CSprite(); tryAgainBttn.setSortingLayer("TextUI"); btnNextScreen = new CSprite(); btnNextScreen.setSortingLayer("TextUI"); optionsBttn = new CSprite(); optionsBttn.setImage(Resources.Load <Sprite>("Sprites/Buttons/Pause_Button")); optionsBttn.setXY(680, 40); optionsBttn.setSortingLayer("TextUI"); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); GUI.backgroundColor = Color.grey; CText text = target as CText; GUI.changed = false; if (text.font != null) { //NGUILinkEditor.RegisterUndo("CImage Change", text); if (string.IsNullOrEmpty(text.FontName) || text.FontName != text.font.name) { text.FontName = text.font.name; } text.FontPath = AssetDatabase.GetAssetPath(text.font); } UnityEngine.Object obj; EditorGUILayout.TextField("FontName", text.FontName); EditorGUILayout.TextField("FontPath", text.FontPath); text.IsNeedEmoji = EditorGUILayout.ToggleLeft("NeedEmoji", text.IsNeedEmoji); text.Language = EditorGUILayout.TextField("Language", text.Language); EditorGUILayout.LabelField("预制颜色"); if (null != colors && colors.Length > 0) { //text.color = GetColor("", text.colorIdx); for (int i = 0; i < colors.Length; i++) { if (i % 4 == 0) { EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); } GUIStyle myStyle = GUI.skin.box; myStyle.fontStyle = FontStyle.Bold; myStyle.normal.textColor = GetColor("", i); myStyle.fixedWidth = 80; if (GUILayout.Button(colors[i], myStyle)) { if (text) { text.colorIdx = i; //text.color = GetColor("", text.colorIdx); //SetStyle(text, 1); //SetStyle(text); SetTextColorFromColorText(text, colors[i]); } } } } EditorUtility.SetDirty(text); }
public CSongMenuTileBoard(SThemeSongMenu theme, int partyModeID) : base(theme, partyModeID) { _Artist = new CText(_Theme.SongMenuTileBoard.TextArtist, _PartyModeID); _Title = new CText(_Theme.SongMenuTileBoard.TextTitle, _PartyModeID); _SongLength = new CText(_Theme.SongMenuTileBoard.TextSongLength, _PartyModeID); _CoverBig = new CStatic(_Theme.SongMenuTileBoard.StaticCoverBig, _PartyModeID); _TextBG = new CStatic(_Theme.SongMenuTileBoard.StaticTextBG, _PartyModeID); _DuetIcon = new CStatic(_Theme.SongMenuTileBoard.StaticDuetIcon, _PartyModeID); _VideoIcon = new CStatic(_Theme.SongMenuTileBoard.StaticVideoIcon, _PartyModeID); _MedleyCalcIcon = new CStatic(_Theme.SongMenuTileBoard.StaticMedleyCalcIcon, _PartyModeID); _MedleyTagIcon = new CStatic(_Theme.SongMenuTileBoard.StaticMedleyTagIcon, _PartyModeID); _SubElements.AddRange(new IMenuElement[] { _Artist, _Title, _SongLength, _DuetIcon, _VideoIcon, _MedleyCalcIcon, _MedleyTagIcon }); }
private CText _ScaleText(CText text, float scaleFactor, EStyle style) { SRectF ScaledRect = new SRectF(text.X, text.Y, text.W, text.H, text.Z); ScaledRect = ScaledRect.Scale(scaleFactor); CText ScaledText = new CText(ScaledRect.X, ScaledRect.Y, ScaledRect.Z, ScaledRect.H, ScaledRect.W, text.Align, style, "Outline", text.Color, ""); ScaledText.MaxRect = new SRectF(ScaledText.MaxRect.X, ScaledText.MaxRect.Y, MaxRect.W + MaxRect.X - ScaledText.Rect.X - 5f, ScaledText.MaxRect.H, ScaledText.MaxRect.Z); ScaledText.ResizeAlign = EHAlignment.Center; ScaledText.Text = text.Text; return(ScaledText); }
public CButtonSprite(string buttonText = null) { this.setName("Button - " + buttonText); this.setFrames(Resources.LoadAll <Sprite>("Sprites/ui")); this.gotoAndStop(1); this.setWidth(190); this.setHeight(50); this.setSortingLayerName("UI"); this.buttonText = new CText(buttonText); this.buttonText.setColor(Color.black); this.buttonText.setWidth(this.getWidth()); this.buttonText.setHeight(this.getHeight()); this.buttonText.setAlignment(TextAlignmentOptions.Midline); this.buttonText.setFontSize(300f); }
override public void destroy() { base.destroy(); mBackground.destroy(); mBackground = null; mButtonPlay.destroy(); mButtonPlay = null; exitButton.destroy(); exitButton = null; logo.destroy(); logo = null; }
public CTelephonyPage(ECallPages pageId, string pageName) : base((int)pageId, false,true) { setText(pageName); CText title = new CText(pageName); title.PosY = 0; add(title); // sessions link _sessions = new CLink("0/0"); _sessions.Align = EAlignment.justify_right; _sessions.Softkey += new BoolIntDelegate(sessionHandler); _sessions.PosY = 0; this.add(_sessions); _digits = new CText(""); _digits.Align = EAlignment.justify_center; _digits.PosY = 1; this.add(_digits); _name = new CText(""); _name.Align = EAlignment.justify_center; _name.PosY = 2; this.add(_name); _info = new CText(""); _info.Align = EAlignment.justify_center; _info.PosY = 7; this.add(_info); _endCall = new CLink("End Call"); _endCall.Align = EAlignment.justify_right; _endCall.Softkey += new BoolIntDelegate(endCallHandler); _endCall.PosY = 10; _endCall.LinkKey = _endCall.PosY; this.add(_endCall); // assign page handlers.... this.Onhook += new VoidDelegate(onhookHandler); this.Speaker += new VoidDelegate(onspeakerHandler); this.Menu += new VoidDelegate(menuHandler); }
public CMessageReceivedPage() : base((int)EPages.P_MESSAGERECEIVEDBOX, "Message Received") { _titleText = new CText(""); _titleText.PosY = 1; add(_titleText); _textBox = new CTextBox(""); _textBox.PosY = 3; add(_textBox); _replyLink = new CLink("Reply"); _replyLink.PosY = 9; _replyLink.Softkey += new BoolIntDelegate(_replyLink_Softkey); add(_replyLink); }
public override void Init() { base.Init(); _Rect = _Theme.songMenuTileBoard.TileRect; _NumW = _Theme.songMenuTileBoard.numW; _NumH = _Theme.songMenuTileBoard.numH; _SpaceW = _Theme.songMenuTileBoard.spaceW; _SpaceH = _Theme.songMenuTileBoard.spaceH; _PendingTime = 100L; _TileW = (int)((_Theme.songMenuTileBoard.TileRect.W - _SpaceW * (_NumW - 1)) / _NumW); _TileH = (int)((_Theme.songMenuTileBoard.TileRect.H - _SpaceH * (_NumH - 1)) / _NumH); _CoverTexture = CTheme.GetSkinTexture(_Theme.CoverBackgroundName); _CoverBigTexture = CTheme.GetSkinTexture(_Theme.CoverBigBackgroundName); _Tiles = new List<CStatic>(); for (int i = 0; i < _NumH; i++) { for (int j = 0; j < _NumW; j++) { SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW), _Theme.songMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z); CStatic tile = new CStatic(_CoverTexture, Color, rect); _Tiles.Add(tile); } } _ScrollRect = new SRectF(0, 0, CSettings.iRenderW, CSettings.iRenderH, _Theme.songMenuTileBoard.TileRect.Z); _PreviewSelected = -1; _Offset = 0; _CoverBig = _Theme.songMenuTileBoard.StaticCoverBig; _TextBG = _Theme.songMenuTileBoard.StaticTextBG; _DuetIcon = _Theme.songMenuTileBoard.StaticDuetIcon; _VideoIcon = _Theme.songMenuTileBoard.StaticVideoIcon; _MedleyCalcIcon = _Theme.songMenuTileBoard.StaticMedleyCalcIcon; _MedleyTagIcon = _Theme.songMenuTileBoard.StaticMedleyTagIcon; _Artist = _Theme.songMenuTileBoard.TextArtist; _Title = _Theme.songMenuTileBoard.TextTitle; _SongLength = _Theme.songMenuTileBoard.TextSongLength; }