private static RenderTarget2D CreateEmptyTarget(TGraphics graphics, int width, int height) { RenderTarget2D newtarget; newtarget = new RenderTarget2D(graphics.GraphicsDevice, width, height, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8); return(newtarget); }
private static Texture2D CreateEmptyTexture(TGraphics graphics, int width, int height) { Texture2D newtexture; newtexture = new Texture2D(graphics.GraphicsDevice, width, height, false, SurfaceFormat.Color); return(newtexture); }
private FontManager(TGraphics graphics, FontTypes type, float size) { _graphics = graphics; FontSize = size; FontName = type; Font = new System.Drawing.Font(GetName(type), size); Bitmap = graphics.Content.Load <SpriteFont>(string.Format("{0}-{1}", GetName(type), FontFileSize)); }
public static Surface CreateBlankSurface(TGraphics graphics, int Width, int Height) { Surface result; result = new Surface(graphics, Width, Height); result.Initialize(); return(result); }
public static void DrawLine(TGraphics tgraphics, Point point1, Point point2, Color color, int width = 1) { int length = Point.Distance(point1, point2); float angle = (float)Math.Atan2(point2.Y - point1.Y, point2.X - point1.X); DrawLine(tgraphics, point1, length, angle, color, width); }
public Label(TGraphics graphics, string name, string text, Rectangle area, FontManager fontInfo) : base(graphics, name, area) { Text = text; _fontInfo = fontInfo; _textColor = Color.Black; //_gorgonText = _graphics.Renderer2D.Renderables.CreateText(name + "_label", fontInfo.GFont, text); }
public static Surface CreateFromFile(TGraphics graphics, string Filename) { Surface result; result = new Surface(graphics, Filename); result.Initialize(); return(result); }
public Control(TGraphics graphics, string name, Rectangle area) { _graphics = graphics; _threadSafety = new ThreadSafetyEnforcer(name); _invoker = new Invoker(_threadSafety); _area = area; _anchor = ControlAnchor.Default; Name = name; }
public TKeyState(TGraphics graphics) { _graphics = graphics; _keyEventData = new List <KeyStateEventData>(); _keyStateArray = new Key[0]; graphics.Control.KeyDown += Control_KeyDown; graphics.Control.KeyUp += Control_KeyUp; }
public TInputManager(TGraphics graphics) { Keyboard.KeyboardManager.LoadKeyboards(); Keyboard.KeyboardManager.LoadKeyboard(Keyboard.US_English_103.Type); MouseStateManager = new TMouseState(graphics); KeyStateManager = new TKeyState(graphics); _stateManagerArray = new InputState[] { MouseStateManager, KeyStateManager }; }
public LoginStatusScreen(TGraphics graphics) : base(graphics) { BackgroundColor = System.Drawing.Color.Wheat; Label cointents = new Label(Program.GameLogic.Graphics, "_contents", "", new Point(0, 0), new Size(Program.GameLogic.Graphics.ScreenSize.Width, Program.GameLogic.Graphics.ScreenSize.Height)) { TextAlignement = TextAlignement.Center }; Controls.Add(10, cointents); }
private Surface(TGraphics graphics, int width, int height) { _graphics = graphics; _target = CreateEmptyTarget(_graphics, width, height); this.Width = width; this.Height = height; }
public TMouseState(TGraphics graphics) { _mouseStateArray = new MouseButtons[0]; _mouseEventData = new List <MouseStateEventData>(); _graphics = graphics; graphics.Control.MouseDown += _control_MouseDown; graphics.Control.MouseUp += _control_MouseUp; graphics.Control.MouseMove += _control_MouseMove; graphics.Control.MouseWheel += _control_MouseWheel; }
public static void DrawBox(TGraphics tgraphics, Rectangle rec, Color color, int width = 1) { Point p1, p2, p3, p4; p1 = new Point(rec.X, rec.Y); p2 = new Point(rec.X + rec.Width, rec.Y); p3 = new Point(rec.X + rec.Width, rec.Y + rec.Height); p4 = new Point(rec.X, rec.Y + rec.Height); Line.DrawLine(tgraphics, p1, p2, color, width); Line.DrawLine(tgraphics, p2, p3, color, width); Line.DrawLine(tgraphics, p3, p4, color, width); Line.DrawLine(tgraphics, p4, p1, color, width); }
public TextBox(TGraphics graphics, string name, Rectangle area) : base(graphics, name, area) { //_gorgonText = _graphics.Renderer2D.Renderables.CreateText(name + "_TextRenderer"); _fontInfo = FontManager.GetInstance(graphics, 22, FontTypes.Sans); _flasherTimer = new Timer(); FocusChanged += delegate { _redrawPreRenderd = true; }; _textColor = Color.Black; }
public static FontManager GetInstance(TGraphics graphics, float size, FontTypes name) { foreach (FontManager obj in _data) { if (obj.FontName == name && obj.FontSize == size && obj._graphics == graphics) { return(obj); } } FontManager font = new FontManager(graphics, name, size); _data.Add(font); return(font); }
private Surface(TGraphics graphics, string Filename) { _graphics = graphics; if (!System.IO.File.Exists(Filename)) { throw new System.IO.FileNotFoundException("The file could not be found!", Filename); } _target = (RenderTarget2D)RenderTarget2D.FromStream(graphics.GraphicsDevice, new FileStream(Filename, FileMode.Open)); Width = _target.Width; Height = _target.Height; }
protected static Surface getPixel(TGraphics tgraphics) { if (pixleSet == null) { pixleSet = new List <Surface>(); } foreach (Surface pb in pixleSet) { if (pb.Graphics == tgraphics) { return(pb); } } Surface newPixle = _createPixle(tgraphics); pixleSet.Add(newPixle); return(newPixle); }
public MainMenuScreen(TGraphics graphics) : base(graphics) { }
public static void DrawBox(TGraphics tgraphics, Point point1, Point point2, Color color, int width = 1) { Rectangle rec = new Rectangle(point1, point2); DrawBox(tgraphics, rec, color, width); }
public TextBox(TGraphics graphics, string name, Point location, Size size) : this(graphics, name, new Rectangle(location, size)) { }
public TextBox(TGraphics graphics, string name, int x, int y, int width, int height) : this(graphics, name, new Rectangle(x, y, width, height)) { }
public Picturebox(TGraphics graphics, string name, Surface image, Rectangle area) : base(graphics, name, area) { _image = image; }
public Picturebox(TGraphics graphics, string name, Surface image, Point location, Size size) : this(graphics, name, image, new Rectangle(location, size)) { }
private static Surface _createPixle(TGraphics tgraphics) { return(Surface.CreateBlankSurface(tgraphics, 1, 1)); }
public Label(TGraphics graphics, string name, string text, Point location, Size size, FontManager fontInfo) : this(graphics, name, text, new Rectangle(location, size), fontInfo) { }
public Label(TGraphics graphics, string name, string text, int x, int y, int width, int height) : this(graphics, name, text, new Rectangle(x, y, width, height), FontManager.GetInstance(graphics, 18, FontTypes.Sans)) { }
public Picturebox(TGraphics graphics, string name, Surface image, int x, int y, int width, int height) : this(graphics, name, image, new Rectangle(x, y, width, height)) { }
public static void DrawString(TGraphics graphics, string text, float size, FontTypes name, Point position, Color color) { FontManager font = GetInstance(graphics, size, name); DrawString(font, text, position, color); }
public Label(TGraphics graphics, string name, string text, Point location, Size size) : this(graphics, name, text, new Rectangle(location, size), FontManager.GetInstance(graphics, 18, FontTypes.Sans)) { }