Esempio n. 1
0
        public GamePage(string launchArguments)
        {
            this.InitializeComponent();

            // Create the game.
            _game = XamlGame<SampleGame>.Create(launchArguments, Window.Current.CoreWindow, this);
        }
Esempio n. 2
0
 internal static void RunGame()
 {
     g = new SampleGame();
     g.Window.AllowUserResizing = true;
     g.Initialize();
     g.Window.ClientSizeChanged += (object sender, EventArgs e) =>
     {
         g.SetClientSize(g.Window.ClientBounds.Width, g.Window.ClientBounds.Height);
     };
     g.Run();
 }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            var g = new SampleGame();

            g.Window.AllowUserResizing = true;
            g.Initialize();
            g.Window.ClientSizeChanged += (object sender, EventArgs e) =>
            {
                g.SetClientSize(g.Window.ClientBounds.Width, g.Window.ClientBounds.Height);
            };
            SetContentView((View)g.Services.GetService(typeof(View)));
            g.Run();
        }
    void OnGUI()
    {
        if (GUI.Button(btnRect, "Start Game", btnStyle))
        {
            SampleGame game = gameObject.GetComponent <SampleGame>();
            game.enabled = true;
            this.enabled = false;
        }

        if (GUI.Button(endBtnRect, "End Game", btnStyle))
        {
            Application.Quit();
        }
    }
Esempio n. 5
0
        static void Main(string[] args)
        {
            foreach (var arg in args)
            {
                if (arg == "/nf")
                {
                    Configuration.NoFixedStep = true;
                }
            }

            using (var game = new SampleGame())
            {
                game.Run();
            }
        }
Esempio n. 6
0
        public RendererXNA(SampleGame game)
        {
            Game = game;
            Batch = new SpriteBatch(game.GraphicsDevice);

            BlankTexture = new Texture2D(Game.GraphicsDevice, 1, 1);
            BlankTexture.SetData<Color>(new Color[] { new Color(255, 255, 255, 255) });

            FontTypes.Add(Squid.Font.Default, new Squid.Font { Name = "Arial10", Family = "Arial", Size = 8, Bold = true, International = true });

            KeyboardLayout = GetKeyboardLayout(0);
            KeyStates = new byte[0x100];

            Rasterizer = new RasterizerState();
            Rasterizer.ScissorTestEnable = true;

            Sampler = new SamplerState();
            Sampler.Filter = TextureFilter.Anisotropic;
        }
        /// <summary>
        /// ///////////////////////////////
        /// ///////////////////////////////
        /// ///////////////////////////////
        /// </summary>

        public void UIGame(Device device)
        {
            // DRAW IMAGE
            //_pnt = new Squid.Point(50, 50);
            //_rect = new Squid.Rectangle(_pnt, _pnt);
            ////string filename = "image.png";
            //string filename = "TestImage.png";
            //var tex = GuiHost.Renderer.GetTexture(filename);
            //GuiHost.Renderer.StartBatch();
            ////GuiHost.Renderer.DrawTexture(tex, 550, 600, 128, 128, _rect, -1);
            //GuiHost.Renderer.DrawTexture(tex, 200, 250, 300, 450, _rect, -1);
            //GuiHost.Renderer.EndBatch(true);
            //GuiHost.Renderer.Dispose();

            using (SampleGame game = new SampleGame())
            {
                game.Run();
            }

            // cleanup
            GuiHost.Renderer.Dispose();
        }
Esempio n. 8
0
 public static void Main(string[] args)
 {
     using (var game = new SampleGame()) game.Run();
 }
Esempio n. 9
0
 public SimpleClient(SampleGame game, IClientConnection connection)
     : base(connection)
 {
     this.game = game;
 }
Esempio n. 10
0
 static void Main()
 {
     using (var game = new SampleGame())
         game.Run();
 }