示例#1
0
 /// <summary>
 /// Create a new TextBoxSprite.
 /// </summary>
 /// <param name="texture">The texture to show beneath the text (must be scalable).</param>
 /// <param name="color">The color to tint the texture under the text.</param>
 /// <param name="pos">The position of the TextBoxSprite.</param>
 /// <param name="font">The SpriteFont to draw the text with.</param>
 /// <param name="sb">The SpriteBatch to draw to.</param>
 /// <param name="up">The UpdateParameters to use when updating this Sprite.</param>
 public TextBoxSprite(Texture2D texture, Vector2 pos, Color color, SpriteBatch sb, UpdateParamaters up, SpriteFont font)
     : base(texture, pos, color, sb, up)
 {
     _textView = new TextSprite(SpriteBatch, font, "");
     _textView.Position = Position + Vector2.One;
     Height = font.LineSpacing + 1;
     Scale.X = 0;
     movementInternal = new EventHandler(this.TextBoxSprite_Moved);
     Moved += movementInternal;
     base.UseCenterAsOrigin = false;
 }
示例#2
0
文件: Sprite.cs 项目: CrashFil/Glib
 /// <summary>
 /// Create a new Sprite.
 /// </summary>
 public Sprite(Texture2D texture, Vector2 pos, SpriteBatch sb, UpdateParamaters up)
     : this(texture, pos, sb)
 {
     this.UpdateParams = up;
 }
示例#3
0
 /// <summary>
 /// Create a new TextBoxSprite.
 /// </summary>
 public TextBoxSprite(Texture2D texture, Vector2 pos, SpriteBatch sb, UpdateParamaters up, SpriteFont font)
     : this(texture, pos, Color.White, sb, up, font)
 {
 }
示例#4
0
 /// <summary>
 /// Set the <seealso cref="UpdateParamaters"/> for this Sprite.
 /// </summary>
 /// <param name="u">The UpdateParamaters to use for this Sprite.</param>
 /// <returns>This SpriteBuilder.</returns>
 public SpriteBuilder SetUpdateParamaters(UpdateParamaters u)
 {
     _constructing.UpdateParams = u;
     return this;
 }