public static TextActor CreateText(this GameLoop gameLoop, Text txt, Vector2f position, Color color) { TextActor t = CreateText_Internal(txt, position, color); if (t == null) { return(null); } RegisterText(gameLoop, t); return(t); }
private static TextActor CreateText_Internal(Text txt, Vector2f position, Color color) { TextActorArgs args; args.TextPosition = position; args.TextColor = color; args.text = txt; TextActor t = new TextActor(); t.PostCreate(args); return(t); }
private void InitScoretext() { _textScore = this.CreateText(new Text($"SCORE: {_scoreAmount}", new Font(TextFontDir.DefaultFont), 20), new Vector2f(4f, 8f), Color.Red); }
private static void RegisterText(GameLoop game, TextActor t) { game.RegisterDrawableActor(t); }
private bool IsCheckInput() { if (string.IsNullOrEmpty(this.TextCrowName.Text)) { MessageBox.Show("众筹名称不能为空!", "提示"); TextCrowName.Focus(); return(false); } if (string.IsNullOrEmpty(this.TextBeginDate.Text)) { MessageBox.Show("开始时间不能为空!", "提示"); TextBeginDate.Focus(); return(false); } if (string.IsNullOrEmpty(this.TextEndDate.Text)) { MessageBox.Show("结束时间不能为空!", "提示"); TextEndDate.Focus(); return(false); } if (TextBeginDate.Value <= DateTime.Now) { MessageBox.Show("开始时间必须晚于今天!", "提示"); TextBeginDate.Focus(); return(false); } if (TextBeginDate.Value >= TextEndDate.Value) { MessageBox.Show("开始时间必须早于结束时间!", "提示"); TextEndDate.Focus(); return(false); } if (this.CityControl.GetCity() == null) { MessageBox.Show("城市不能为空!", "提示"); CityControl.Focus(); return(false); } if (string.IsNullOrEmpty(this.TextAddress.Text.Trim())) { MessageBox.Show("服务地点详细地址不能为空!", "提示"); TextAddress.Focus(); return(false); } if (string.IsNullOrEmpty(this.TextServiceDuration.Text)) { MessageBox.Show("服务时长不能为空!", "提示"); TextServiceDuration.Focus(); return(false); } if (this.TextActor.SelectActor == null) { MessageBox.Show("服务艺人不能为空!", "提示"); TextActor.Focus(); return(false); } if (string.IsNullOrEmpty(this.TextServiceCost.Text.Trim())) { MessageBox.Show("服务费用不能为空!", "提示"); TextServiceCost.Focus(); return(false); } if (string.IsNullOrEmpty(this.TextNote.HtmlContent.Trim())) { MessageBox.Show("注意事项不能为空!", "提示"); TextNote.Focus(); return(false); } if (string.IsNullOrEmpty(this.TextFrontImg.GetUrl().Trim())) { MessageBox.Show("封面图不能为空!", "提示"); TextFrontImg.Focus(); return(false); } if (string.IsNullOrEmpty(this.TextServiceIntro.HtmlContent.Trim())) { MessageBox.Show("封面图不能为空!", "提示"); TextServiceIntro.Focus(); return(false); } if (this.TextCrowDetail.CtTypes.Count == 0) { MessageBox.Show("众筹详情不能为空!", "提示"); TextCrowDetail.Focus(); return(false); } return(true); }