private TextDisplayElement MakeTextDisplayElement(string typeName, string section) { // Find variables for the TDE Vector2 position = Skin.GetConfigStartPosition(Config, section, $"{typeName}StartPos", scorecard); int fontSize = Skin.GetConfigInt(Config, section, $"{typeName}FontSize"); Anchor textAnchor = Skin.GetConfigAnchor(Config, section, $"{typeName}Anchor"); Color textColor = Color.White; // This Try Block is for the judgement text, which find their colors // from judgements.ini in AddJudgeInfo() instead of result_screen.ini here try { textColor = Skin.GetConfigColor(Config, section, $"{typeName}Color"); } catch { } //Make TDE TextDisplayElement text = new TextDisplayElement("", position, fontSize, textAnchor, textColor); // Offset Vector2 offset = new Vector2( Skin.GetConfigInt(Config, section, $"{typeName}X"), Skin.GetConfigInt(Config, section, $"{typeName}Y")); text.Move(offset); return(text); }
public SearchBox(string search, Vector2 position, Anchor anchor = Anchor.TopLeft) : base(Skin.Assets["searchbox"], position, anchor: anchor) { string config = "song_select"; string section = "Properties"; string name = "SearchBarText"; Anchor textAnchor = Skin.GetConfigAnchor(config, section, $"{name}Anchor"); Vector2 startPos = Skin.GetConfigStartPosition(config, section, $"{name}StartPos", this); int fontSize = Skin.GetConfigInt(config, section, $"{name}FontSize"); Color textColor = Skin.GetConfigColor(config, section, $"{name}Color"); int offsetX = Skin.GetConfigInt(config, section, $"{name}X"); int offsetY = Skin.GetConfigInt(config, section, $"{name}Y"); textDisplay = new TextDisplayElement(search, startPos, fontSize, textAnchor, textColor); textDisplay.Move(offsetX, offsetY); textDisplay.processedPosition = textDisplay.TruePosition; }
/// <summary> /// Add a TextDisplayElement to the Card, using the config to /// determine their positioning and other properties. /// </summary> /// <param name="typeName">The "typeName" of the button, or the prefix in the config.</param> protected virtual void AddTextDisplayElement(string typeName) { // Find variables for TDE Anchor startAnchor; Vector2 position = Skin.GetConfigStartPosition(Config, Section, typeName + "StartPos", out startAnchor, this); int fontSize = GetSkinnableInt(typeName + "FontSize"); Anchor anchor = GetSkinnableAnchor(typeName + "Anchor"); Color color = Skin.GetConfigColor(Config, Section, typeName + "Color"); // Make TDE TextDisplayElement text = new TextDisplayElement("", position, fontSize, anchor, color); // Offset Vector2 offset = new Vector2( GetSkinnableInt(typeName + "X"), GetSkinnableInt(typeName + "Y")); text.Move(offset); //Add TDE TextElements.Add(text); TextElementOffsets.Add(text.Position - AnchorUtil.FindDrawablePosition(startAnchor, this)); TextElementStartAnchors.Add(startAnchor); }
public override void Move(Vector2 delta, bool?heightScaled = null) { base.Move(delta, heightScaled); listening.Move(delta, heightScaled); key.Move(delta, heightScaled); }
/// <summary> /// Move the Navigation Button and its parts. /// </summary> /// <param name="delta"></param> /// <param name="heightScaled"></param> public override void Move(Vector2 delta, bool?heightScaled = null) { base.Move(delta, heightScaled); text.Move(delta, heightScaled); }