public win2d_Textbox(CanvasDevice device, Vector2 position, int width) : base(position, width, -1) { CanvasTextLayout layout = new CanvasTextLayout(device, "TEST!", Statics.DefaultFontNoWrap, 0, 0); Position = position; Width = width; Height = (int)layout.LayoutBounds.Height + PaddingY * 2; Color = Colors.White; TextPosition = new Vector2(position.X + PaddingX, position.Y + PaddingY); Border = new Rect(position.X, position.Y, width, Height); Cursor = new win2d_TextboxCursor(device, Colors.White); CursorStringIndex = 0; bRecalculateLayout = true; }
public win2d_Textbox(CanvasDevice device, Vector2 position, int width) : base(position, width, -1) { CanvasTextLayout layout = new CanvasTextLayout(device, "TEST!", Statics.DefaultFontNoWrap, 0, 0); Position = position; Width = width; Height = (int)layout.LayoutBounds.Height + PaddingY * 2; Color = Colors.White; TextPosition = new Vector2(position.X + PaddingX, position.Y + PaddingY); Border = new Rect(position.X, position.Y, width, Height); Cursor = new win2d_TextboxCursor(device, Colors.White); CursorStringIndex = 0; bRecalculateLayout = true; }