public CText(CText text) { _Theme = new SThemeText(); _ThemeLoaded = false; _ButtonText = false; X = text._X; Y = text._Y; Z = text._Z; Height = text._Height; MaxWidth = text._MaxWidth; Bounds = new SRectF(text._Bounds); Align = text._Align; HAlign = text._HAlign; Style = text._Style; Fon = text._Fon; Color = new SColorF(text.Color); SColor = new SColorF(text.SColor); Reflection = text.Reflection; ReflectionSpace = text.ReflectionSpace; ReflectionHeight = text.ReflectionHeight; Text = text._Text; Selected = text.Selected; Visible = text.Visible; Alpha = text.Alpha; EditMode = text.EditMode; }
public PlaylistElement(PlaylistElement pe) { Cover = new CStatic(pe.Cover); Background = new CStatic(pe.Background); Text1 = new CText(pe.Text1); SelectSlide = new CSelectSlide(pe.SelectSlide); Content = pe.Content; }
private void PrepareTiles() { _Tiles.Clear(); for (int i = 0; i < _NumH; i++) { for (int j = 0; j < _NumW; j++) { SRectF rect = new SRectF(Rect.X + j * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z); CStatic tileStatic = new CStatic(_TextureEmptyTile, ColorEmptyTile, rect); CText tileText = new CText(rect.X + rect.W / 2, rect.Y + rect.H + _Theme.NameSpace, rect.Z, _Theme.NameHeight, rect.W, EAlignment.Center, _Theme.NameStyle, _Theme.NameFont, _Theme.NameColor, ""); _Tiles.Add(new CTile(tileStatic, tileText, -1)); } } }
public CLyric() { _Theme = new SThemeLyrics(); _ThemeLoaded = false; Color = new SColorF(); ColorProcessed = new SColorF(); _X = 0f; _Y = 0f; _Z = 0f; _MaxW = 1f; _H = 1f; _width = 1f; _Notes = new List <SNote>(); _Text = new CText(); _Style = ELyricStyle.Slide; }
public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) { string item = XmlPath + "/" + ElementName; _ThemeLoaded = true; _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/X", navigator, ref _X); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Y", navigator, ref _Y); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Z", navigator, ref _Z); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/W", navigator, ref _MaxW); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/H", navigator, ref _H); if (CHelper.GetValueFromXML(item + "/Color", navigator, ref _Theme.ColorName, String.Empty)) { _ThemeLoaded &= CTheme.GetColor(_Theme.ColorName, SkinIndex, ref Color); } else { _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/R", navigator, ref Color.R); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/G", navigator, ref Color.G); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/B", navigator, ref Color.B); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/A", navigator, ref Color.A); } if (CHelper.GetValueFromXML(item + "/SColor", navigator, ref _Theme.SColorName, String.Empty)) { _ThemeLoaded &= CTheme.GetColor(_Theme.SColorName, SkinIndex, ref ColorProcessed); } else { _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SR", navigator, ref ColorProcessed.R); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SG", navigator, ref ColorProcessed.G); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SB", navigator, ref ColorProcessed.B); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SA", navigator, ref ColorProcessed.A); } if (_ThemeLoaded) { _Theme.Name = ElementName; LoadTextures(); _Text = new CText(_X, _Y, _Z, _H, _MaxW, EAlignment.Left, EStyle.Bold, "Normal", Color, String.Empty); } return(_ThemeLoaded); }
public CButton() { _Theme = new SThemeButton(); Rect = new SRectF(); Color = new SColorF(); SColor = new SColorF(); Text = new CText(); Selected = false; Visible = true; Reflection = false; ReflectionSpace = 0f; ReflectionHeight = 0f; SReflection = false; SReflectionSpace = 0f; SReflectionHeight = 0f; }
public CButton() { _Theme = new SThemeButton(); Rect = new SRectF(); Color = new SColorF(); SColor = new SColorF(); Text = new CText(); Selected = false; Visible = true; Reflection = false; ReflectionSpace = 0f; ReflectionHeight = 0f; SReflection = false; SReflectionSpace = 0f; SReflectionHeight = 0f; }
public int AddText(CText text) { _Texts.Add(text); _AddInteraction(_Texts.Count - 1, EType.TText); return(_Texts.Count - 1); }
private void PrepareTiles() { _Tiles.Clear(); for (int i = 0; i < _NumH; i++) { for (int j = 0; j < _NumW; j++) { SRectF rect = new SRectF(Rect.X + j * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z); CStatic tileStatic = new CStatic(_TextureEmptyTile, ColorEmptyTile, rect); CText tileText = new CText(rect.X + rect.W / 2, rect.Y + rect.H + _Theme.NameSpace, rect.Z, _Theme.NameHeight, rect.W, EAlignment.Center, _Theme.NameStyle, _Theme.NameFont, _Theme.NameColor, ""); _Tiles.Add(new CTile(tileStatic, tileText, -1)); } } }
public int AddText(CText text) { _Texts.Add(text); AddInteraction(_Texts.Count - 1, EType.TText); return _Texts.Count - 1; }
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))); }
public static RectangleF GetTextBounds(CText text, float height) { Height = height; return new RectangleF(text.X, text.Y, GetTextWidth(CLanguage.Translate(text.Text)), GetTextHeight(CLanguage.Translate(text.Text))); }
public override void LoadTheme() { //Vocaluxe-Logo CDataBase.GetCreditsRessource("Logo_voc.png", ref _TexLogo); //Little stars for logo CDataBase.GetCreditsRessource("PerfectNoteStar.png", ref _TexPerfectNoteStar); //brunzel CDataBase.GetCreditsRessource("brunzel.png", ref _TexNameBrunzel); //Darkice CDataBase.GetCreditsRessource("Darkice.png", ref _TexNameDarkice); //flokuep CDataBase.GetCreditsRessource("flokuep.png", ref _TexNameFlokuep); //bohning CDataBase.GetCreditsRessource("bohning.png", ref _TexNameBohning); //mesand CDataBase.GetCreditsRessource("mesand.png", ref _TexNameMesand); //babene03 CDataBase.GetCreditsRessource("babene03.png", ref _TexNameBabene03); //pantero CDataBase.GetCreditsRessource("pantero.png", ref _TexNamePantero); //Pinky007 CDataBase.GetCreditsRessource("Pinky007.png", ref _TexNamePinky007); //Prepare Text int lastY = 280; for (int i = 0; i < paragraphs.Count; i++) { string line = ""; for (int e = 0; e < paragraphs[i].Length; e++) { if (paragraphs[i][e] != null) { string newline = line + " " + paragraphs[i][e]; CText text = new CText(75, lastY, -2, 30, -1, EAlignment.Left, EStyle.Bold, "Outline", new SColorF(1, 1, 1, 1), line); if (CDraw.GetTextBounds(text).Width < (CSettings.iRenderW - 220)) { line = line + " " + paragraphs[i][e]; //Check if all words are used if ((e + 1) == paragraphs[i].Length) { text.Text = line; paragraphTexts.Add(text); line = ""; lastY += 40; } } else { paragraphTexts.Add(text); line = " " + paragraphs[i][e]; lastY += 27; } } } } }
public CTile(CStatic av, CText tex, int pl) { Avatar = av; Name = tex; PlayerNr = pl; }
public CText(CText text) { _Theme = new SThemeText(); _ThemeLoaded = false; _ButtonText = false; X = text._X; Y = text._Y; Z = text._Z; Height = text._Height; MaxWidth = text._MaxWidth; Bounds = new SRectF(text._Bounds); Align = text._Align; HAlign = text._HAlign; Style = text._Style; Fon = text._Fon; Color = new SColorF(text.Color); SColor = new SColorF(text.SColor); Reflection = text.Reflection; ReflectionSpace = text.ReflectionSpace; ReflectionHeight = text.ReflectionHeight; Text = text._Text; Selected = text.Selected; Visible = text.Visible; Alpha = text.Alpha; EditMode = text.EditMode; }
public void Draw() { if (!Visible && CSettings.GameState != EGameState.EditTheme) { return; } STexture Texture = CTheme.GetSkinTexture(_Theme.TextureName); STexture TextureArrowLeft = CTheme.GetSkinTexture(_Theme.TextureArrowLeftName); STexture TextureArrowRight = CTheme.GetSkinTexture(_Theme.TextureArrowRightName); STexture STexture = CTheme.GetSkinTexture(_Theme.STextureName); STexture STextureArrowLeft = CTheme.GetSkinTexture(_Theme.STextureArrowLeftName); STexture STextureArrowRight = CTheme.GetSkinTexture(_Theme.STextureArrowRightName); STexture HTexture = CTheme.GetSkinTexture(_Theme.HTextureName); if (Selected) { if (Highlighted) { CDraw.DrawTexture(HTexture, Rect, HColor); } else { CDraw.DrawTexture(STexture, Rect, SColor); } } else { CDraw.DrawTexture(Texture, Rect, Color); } if (_Selection > 0 || CSettings.GameState == EGameState.EditTheme) { if (_ArrowLeftSelected) { CDraw.DrawTexture(STextureArrowLeft, RectArrowLeft, SColorArrow); } else { CDraw.DrawTexture(TextureArrowLeft, RectArrowLeft, ColorArrow); } } if (_Selection < _ValueNames.Count - 1 || CSettings.GameState == EGameState.EditTheme) { if (_ArrowRightSelected) { CDraw.DrawTexture(STextureArrowRight, RectArrowRight, SColorArrow); } else { CDraw.DrawTexture(TextureArrowRight, RectArrowRight, ColorArrow); } } if (_NumVisible < 1 || _ValueNames.Count == 0) { return; } float x = Rect.X + Rect.W * 0.1f; float dx = Rect.W * 0.8f / _NumVisible; //float y = Rect.Y + (Rect.H - TextH); int offset = _Selection - (int)_NumVisible / 2; if (_ValueNames.Count - _NumVisible - offset < 0) { offset = _ValueNames.Count - _NumVisible; } if (offset < 0) { offset = 0; } int numvis = _NumVisible; if (_ValueNames.Count < numvis) { numvis = _ValueNames.Count; } _ValueBounds.Clear(); for (int i = 0; i < numvis; i++) { CText Text = new CText(0, 0, 0, TextH, MaxW, EAlignment.Center, _Theme.TextStyle, _Theme.TextFont, TextColor, _ValueNames[i + offset]); SColorF Alpha = new SColorF(1f, 1f, 1f, 0.35f); if (i + offset == _Selection) { Text.Color = STextColor; Alpha = new SColorF(1f, 1f, 1f, 1f); } RectangleF bounds = CDraw.GetTextBounds(Text); Text.X = x + dx / 2f + dx * i; if (!WithTextures) { Text.Y = (int)(Rect.Y + (Rect.H - bounds.Height) / 2); } else { Text.Y = (int)(Rect.Y + (Rect.H - bounds.Height)); } Text.Z = Rect.Z; Text.Draw(); if (WithTextures) { float dh = Text.Y - Rect.Y - Rect.H * 0.1f; SRectF rect = new SRectF(Text.X - dh / 2, Rect.Y + Rect.H * 0.05f, dh, dh, Rect.Z); CDraw.DrawTexture(_Textures[i + offset], rect, Alpha); _ValueBounds.Add(rect); } else { _ValueBounds.Add(new SRectF(Text.X - bounds.Width / 2f, Text.Y, bounds.Width, bounds.Height, Rect.Z)); } } }
public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) { string item = XmlPath + "/" + ElementName; _ThemeLoaded = true; _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/X", navigator, ref _X); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Y", navigator, ref _Y); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Z", navigator, ref _Z); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/W", navigator, ref _MaxW); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/H", navigator, ref _H); if (CHelper.GetValueFromXML(item + "/Color", navigator, ref _Theme.ColorName, String.Empty)) { _ThemeLoaded &= CTheme.GetColor(_Theme.ColorName, SkinIndex, ref Color); } else { _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/R", navigator, ref Color.R); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/G", navigator, ref Color.G); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/B", navigator, ref Color.B); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/A", navigator, ref Color.A); } if (CHelper.GetValueFromXML(item + "/SColor", navigator, ref _Theme.SColorName, String.Empty)) { _ThemeLoaded &= CTheme.GetColor(_Theme.SColorName, SkinIndex, ref ColorProcessed); } else { _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SR", navigator, ref ColorProcessed.R); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SG", navigator, ref ColorProcessed.G); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SB", navigator, ref ColorProcessed.B); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SA", navigator, ref ColorProcessed.A); } if (_ThemeLoaded) { _Theme.Name = ElementName; LoadTextures(); _Text = new CText(_X, _Y, _Z, _H, _MaxW, EAlignment.Left, EStyle.Bold, "Normal", Color, String.Empty); } return _ThemeLoaded; }
public CLyric() { _Theme = new SThemeLyrics(); _ThemeLoaded = false; Color = new SColorF(); ColorProcessed = new SColorF(); _X = 0f; _Y = 0f; _Z = 0f; _MaxW = 1f; _H = 1f; _width = 1f; _Notes = new List<SNote>(); _Text = new CText(); _Style = ELyricStyle.Slide; }
public RectangleF GetTextBounds(CText text) { return GetTextBounds(text, text.Height); }
public static RectangleF GetTextBounds(CText text) { return _Draw.GetTextBounds(text); }
private void LoadThemeBasics(XPathNavigator navigator, int SkinIndex) { string value = String.Empty; // Backgrounds CBackground background = new CBackground(); int i = 1; while (background.LoadTheme("//root/" + _ThemeName, "Background" + i.ToString(), navigator, SkinIndex)) { AddBackground(background); background = new CBackground(); i++; } // Statics CStatic stat = new CStatic(); i = 1; while (stat.LoadTheme("//root/" + _ThemeName, "Static" + i.ToString(), navigator, SkinIndex)) { AddStatic(stat); stat = new CStatic(); i++; } // Texts CText text = new CText(); i = 1; while (text.LoadTheme("//root/" + _ThemeName, "Text" + i.ToString(), navigator, SkinIndex)) { AddText(text); text = new CText(); i++; } }
public static RectangleF GetTextBounds(CText text, float Height) { return _Draw.GetTextBounds(text, Height); }
public virtual void LoadTheme() { string file = Path.Combine(CTheme.GetThemeScreensPath(), _ThemeName + ".xml"); XPathDocument xPathDoc = null; XPathNavigator navigator = null; bool loaded = false; try { xPathDoc = new XPathDocument(file); navigator = xPathDoc.CreateNavigator(); loaded = true; } catch (Exception e) { loaded = false; if (navigator != null) navigator = null; if (xPathDoc != null) xPathDoc = null; CLog.LogError("Error loading theme file " + file + ": " + e.Message); } bool VersionCheck = false; if (loaded) VersionCheck = CheckVersion(_ScreenVersion, navigator); int SkinIndex = CTheme.GetSkinIndex(); if (loaded && VersionCheck && SkinIndex != -1) { LoadThemeBasics(navigator, SkinIndex); if (_ThemeBackgrounds != null) { for (int i = 0; i < _ThemeBackgrounds.Length; i++) { CBackground background = new CBackground(); if (background.LoadTheme("//root/" + _ThemeName, _ThemeBackgrounds[i], navigator, SkinIndex)) { _htBackgrounds.Add(_ThemeBackgrounds[i], AddBackground(background)); } else { CLog.LogError("Can't load Background \"" + _ThemeBackgrounds[i] + "\" in screen " + _ThemeName); } } } if (_ThemeStatics != null) { for (int i = 0; i < _ThemeStatics.Length; i++) { CStatic stat = new CStatic(); if (stat.LoadTheme("//root/" + _ThemeName, _ThemeStatics[i], navigator, SkinIndex)) { _htStatics.Add(_ThemeStatics[i], AddStatic(stat)); } else { CLog.LogError("Can't load Static \"" + _ThemeStatics[i] + "\" in screen " + _ThemeName); } } } if (_ThemeTexts != null) { for (int i = 0; i < _ThemeTexts.Length; i++) { CText text = new CText(); if (text.LoadTheme("//root/" + _ThemeName, _ThemeTexts[i], navigator, SkinIndex)) { _htTexts.Add(_ThemeTexts[i], AddText(text)); } else { CLog.LogError("Can't load Text \"" + _ThemeTexts[i] + "\" in screen " + _ThemeName); } } } if (_ThemeButtons != null) { for (int i = 0; i < _ThemeButtons.Length; i++) { CButton button = new CButton(); if (button.LoadTheme("//root/" + _ThemeName, _ThemeButtons[i], navigator, SkinIndex)) { _htButtons.Add(_ThemeButtons[i], AddButton(button)); } else { CLog.LogError("Can't load Button \"" + _ThemeButtons[i] + "\" in screen " + _ThemeName); } } } if (_ThemeSelectSlides != null) { for (int i = 0; i < _ThemeSelectSlides.Length; i++) { CSelectSlide slide = new CSelectSlide(); if (slide.LoadTheme("//root/" + _ThemeName, _ThemeSelectSlides[i], navigator, SkinIndex)) { _htSelectSlides.Add(_ThemeSelectSlides[i], AddSelectSlide(slide)); } else { CLog.LogError("Can't load SelectSlide \"" + _ThemeSelectSlides[i] + "\" in screen " + _ThemeName); } } } if (_ThemeSongMenus != null) { for (int i = 0; i < _ThemeSongMenus.Length; i++) { CSongMenu sm = new CSongMenu(); if (sm.LoadTheme("//root/" + _ThemeName, _ThemeSongMenus[i], navigator, SkinIndex)) { _htSongMenus.Add(_ThemeSongMenus[i], AddSongMenu(sm)); } else { CLog.LogError("Can't load SongMenu \"" + _ThemeSongMenus[i] + "\" in screen " + _ThemeName); } } } if (_ThemeLyrics != null) { for (int i = 0; i < _ThemeLyrics.Length; i++) { CLyric lyric = new CLyric(); if (lyric.LoadTheme("//root/" + _ThemeName, _ThemeLyrics[i], navigator, SkinIndex)) { _htLyrics.Add(_ThemeLyrics[i], AddLyric(lyric)); } else { CLog.LogError("Can't load Lyric \"" + _ThemeLyrics[i] + "\" in screen " + _ThemeName); } } } if (_ThemeSingNotes != null) { for (int i = 0; i < _ThemeSingNotes.Length; i++) { CSingNotes notes = new CSingNotesClassic(); if (notes.LoadTheme("//root/" + _ThemeName, _ThemeSingNotes[i], navigator, SkinIndex)) { _htSingNotes.Add(_ThemeSingNotes[i], AddSingNote(notes)); } else { CLog.LogError("Can't load SingBar \"" + _ThemeSingNotes[i] + "\" in screen " + _ThemeName); } } } } else { } }
public CTile(CStatic av, CText tex, int pl) { Avatar = av; Name = tex; PlayerNr = pl; }