0

This is the error:

Error 3: The best overloaded method match for 'drag_and_lock_grid.ScreenManager.addScreen(drag_and_lock_grid.Screen, int)' has some invalid arguments


Below underlined codes is where the error occur:

public override void touchDown(float x, float y)
    {
      if (playbutton.isWithin(x, y))
      {
        playbutton.touchDown();
        ScreenManager.screenManager.addScreen(new ScreenPuzzleSelection(), 1);
      }

      if (helpbutton.isWithin(x, y))
      {
        helpbutton.touchDown();
        ScreenManager.screenManager.addScreen(new ScreenHelp(), 1);
      }

      if (exitbutton.isWithin(x, y))
      {
        exitbutton.touchDown();
        ScreenManager.screenManager.addScreen(new ScreenSplashExit(), 0);
      }

    }

Thank you.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by farooqaaa
0

Trying casting it to Screen:

public override void touchDown(float x, float y)
    {
      if (playbutton.isWithin(x, y))
      {
        playbutton.touchDown();
        ScreenManager.screenManager.addScreen((Screen)new ScreenPuzzleSelection(), 1);
      }

      if (helpbutton.isWithin(x, y))
      {
        helpbutton.touchDown();
        ScreenManager.screenManager.addScreen((Screen)new ScreenHelp(), 1);
      }

      if (exitbutton.isWithin(x, y))
      {
        exitbutton.touchDown();
        ScreenManager.screenManager.addScreen((Screen)new ScreenSplashExit(), 0);
      }

    }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.