public uiProgressBar() : base(uiControlType.Progress) { // Create the progress bar first so it renders behind everything else. prog_bar = Create <uiEmpty>(this); prog_bar.Set_Background(Util.Get_Gradient_Texture(64, GRADIENT_DIR.TOP_BOTTOM, new Color(0.1f, 0.5f, 1.0f), new Color(1f, 1f, 1f, 1f), true, 0.3f)); prog_bar.FloodY(); text = Create <uiText>(this); text.Autosize_Method = AutosizeMethod.FILL; text.TextAlign = TextAnchor.MiddleCenter; text.disableBG = true; //Util.Set_BG_Color(local_style.normal, new Color(0f, 0f, 0f, 0f)); Value = 0f; update_progress_area(); }
public uiListItem_Progress() : base(uiControlType.Progress) { title.inherits_text_style = true; // Create the progress bar first so it renders behind everything else. prog_bar = Create <uiEmpty>("progress_bar", this); prog_bar.Set_Background(new Color(0.1f, 0.5f, 1.0f)); //prog_bar.Set_Background(Util.Get_Gradient_Texture(64, GRADIENT_DIR.TOP_BOTTOM, new Color(0.1f, 0.5f, 1.0f), new Color(0.2f, 0.6f, 1f, 1f), true, 0.3f)); prog_bar.FloodY(); this.Set_Child_Index(prog_bar, 0);// Move the progress bar to the back so it draws underneath all of the other controls here. prog_text = Create <uiText>(this); prog_text.Autosize_Method = AutosizeMethod.FILL; prog_text.TextAlign = TextAnchor.MiddleRight; prog_text.disableBG = true; prog_text.inherits_text_style = true; progress = 0f; update_progress_area(); }