Exemplo n.º 1
0
        public TextureGame(IntPtr drawingSurface, Form parentForm, PictureBox pictureBox, Vector2 size, Label stateLabel)
        {
            DrawingSurface = drawingSurface;
            ParentForm = parentForm;
            PictureBox = pictureBox;

            gameGraphics = new GameGraphics(this);
            int width = 0;
            int height = 0;
            width += pictureBox.Width;
            height += pictureBox.Height;
            gameGraphics.GraphicsManager.PreparingDeviceSettings += graphics_PreparingDeviceSettings;
            gameGraphics.GraphicsManager.PreferredBackBufferWidth = width;
            gameGraphics.GraphicsManager.PreferredBackBufferHeight = height;

            gameForm = Control.FromHandle(Window.Handle);
            Mouse.WindowHandle = drawingSurface;
            gameForm.VisibleChanged += delegate(object sender, EventArgs args)
            {
                SetVisibleChanged(false);

            };
            BackgroundColor = Color.CornflowerBlue;
            StateLabel = stateLabel;
        }
 public GraphicsManager(GameGraphics gameGraphics)
 {
     _conditions = new Dictionary<string, IGraphicCondition>();
     _actions = new Dictionary<string, IGraphicAction>();
     GameGraphics = gameGraphics;
 }
Exemplo n.º 3
0
 public Game1()
 {
     GameGrapahics = new GameGraphics(this);
     Content.RootDirectory = "Content";
 }