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.

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);
      }

    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.