Domanda

Cocos 2d xna c#.

I'm using windows tamplate. I have next classes Programm, Game1, AppDelegate, IntroLayer, MainLayer. Programm, Game1, AppDelegate - I understand that it's begin and settings, like resolution, touch and ect. From AppDelegate we run and Draw IntroLayer. 'Layer', it's like (.xaml +.xaml.cs) file in wpf? In IntroLayer i want to lisen mouse and keyboard, but public override void Update(float dt) don't listen. I only listen in Update method in Game1 class.

I search cocos2d tutorials, but found little. This's tutorial good link.

È stato utile?

Soluzione

I found the answer for my questions. I need to add this code in my layer to get Update method.

    public override bool Init()
    {
        ScheduleUpdate();
        return base.Init();
    }

    public override void Update(float dt)
    {
         base.Update(dt);
    }

I found it this: link to stackoverflow

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top