Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[C# XNA] Game.Run aus Form

Empfohlene Antworten

Veröffentlicht

Hi,

Ich will ein Form als "Starbildschirm" von meinem Spiel verwenden. Dafür müsste ich aber das Spiel aus der Form starten, was ich nicht zusammenbekomme.

im Programm.cs hab ich

Application.Run(new StartScreen());

geschrieben

und beim Form

private void label2_Click(object sender, EventArgs e)
{
this.Hide();
using (Game1 game = new Game1())
{
game.Run();
}
}[/PHP]

Dann kommt die Fehlermeldung:

"Das Starten einer zweiten Meldungsschleife auf einem einzelnen Thread ist ein ungültiger Vorgang. Verwenden Sie Form.ShowDialog."

Ich hab zwar schon einige post im XNA forum gefunden die dieses problem lösen, leider versteh ich des ned ^^(englisch..)

mfg

habs so gelöst

programm.cs:

static void Main(string[] args)
{
if (StartScreen.StartIt == false)
{
Application.Run(new StartScreen());
}
if (StartScreen.StartIt == true)
{
using (Game1 game = new Game1())
{
game.Run();
}
}
}[/PHP]

form:

[PHP]public static bool StartIt = false;

&

StartIt = true;
this.Close();[/PHP]

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.