public GamePage(string launchArguments) { this.InitializeComponent(); // Create the game. _game = XamlGame<SampleGame>.Create(launchArguments, Window.Current.CoreWindow, this); }
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(); } }
static void Main(string[] args) { foreach (var arg in args) { if (arg == "/nf") { Configuration.NoFixedStep = true; } } using (var game = new SampleGame()) { game.Run(); } }
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(); }
public static void Main(string[] args) { using (var game = new SampleGame()) game.Run(); }
public SimpleClient(SampleGame game, IClientConnection connection) : base(connection) { this.game = game; }
static void Main() { using (var game = new SampleGame()) game.Run(); }