コード例 #1
0
        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);
        }
コード例 #2
0
        private static Texture2D CreateEmptyTexture(TGraphics graphics, int width, int height)
        {
            Texture2D newtexture;

            newtexture = new Texture2D(graphics.GraphicsDevice, width, height, false, SurfaceFormat.Color);

            return(newtexture);
        }
コード例 #3
0
 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));
 }
コード例 #4
0
        public static Surface CreateBlankSurface(TGraphics graphics, int Width, int Height)
        {
            Surface result;

            result = new Surface(graphics, Width, Height);
            result.Initialize();
            return(result);
        }
コード例 #5
0
ファイル: Line.cs プロジェクト: alice-cash/tortoise-mog-code
        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);
        }
コード例 #6
0
ファイル: Label.cs プロジェクト: alice-cash/tortoise-mog-code
 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);
 }
コード例 #7
0
        public static Surface CreateFromFile(TGraphics graphics, string Filename)
        {
            Surface result;

            result = new Surface(graphics, Filename);
            result.Initialize();
            return(result);
        }
コード例 #8
0
 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;
 }
コード例 #9
0
        public TKeyState(TGraphics graphics)
        {
            _graphics      = graphics;
            _keyEventData  = new List <KeyStateEventData>();
            _keyStateArray = new Key[0];

            graphics.Control.KeyDown += Control_KeyDown;
            graphics.Control.KeyUp   += Control_KeyUp;
        }
コード例 #10
0
        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 };
        }
コード例 #11
0
        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);
        }
コード例 #12
0
        private Surface(TGraphics graphics, int width, int height)
        {
            _graphics = graphics;


            _target = CreateEmptyTarget(_graphics, width, height);

            this.Width  = width;
            this.Height = height;
        }
コード例 #13
0
        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;
        }
コード例 #14
0
ファイル: Box.cs プロジェクト: alice-cash/tortoise-mog-code
        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);
        }
コード例 #15
0
        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;
        }
コード例 #16
0
        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);
        }
コード例 #17
0
        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;
        }
コード例 #18
0
        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);
        }
コード例 #19
0
 public MainMenuScreen(TGraphics graphics)
     : base(graphics)
 {
 }
コード例 #20
0
ファイル: Box.cs プロジェクト: alice-cash/tortoise-mog-code
        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);
        }
コード例 #21
0
 public TextBox(TGraphics graphics, string name, Point location, Size size)
     : this(graphics, name, new Rectangle(location, size))
 {
 }
コード例 #22
0
 public TextBox(TGraphics graphics, string name, int x, int y, int width, int height)
     : this(graphics, name, new Rectangle(x, y, width, height))
 {
 }
コード例 #23
0
 public Picturebox(TGraphics graphics, string name, Surface image, Rectangle area)
     : base(graphics, name, area)
 {
     _image = image;
 }
コード例 #24
0
 public Picturebox(TGraphics graphics, string name, Surface image, Point location, Size size)
     : this(graphics, name, image, new Rectangle(location, size))
 {
 }
コード例 #25
0
 private static Surface _createPixle(TGraphics tgraphics)
 {
     return(Surface.CreateBlankSurface(tgraphics, 1, 1));
 }
コード例 #26
0
ファイル: Label.cs プロジェクト: alice-cash/tortoise-mog-code
 public Label(TGraphics graphics, string name, string text, Point location, Size size, FontManager fontInfo)
     : this(graphics, name, text, new Rectangle(location, size), fontInfo)
 {
 }
コード例 #27
0
ファイル: Label.cs プロジェクト: alice-cash/tortoise-mog-code
 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))
 {
 }
コード例 #28
0
 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))
 {
 }
コード例 #29
0
        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);
        }
コード例 #30
0
ファイル: Label.cs プロジェクト: alice-cash/tortoise-mog-code
 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))
 {
 }