Jump to content

Group filter - Callback function


Marc
 Share

Recommended Posts

Dear this a newbie question.

I try to use the group filter but i cannot be able to do that successfully.

Could you giving me some advice to do that and also could you giving me some info about the "callback" function and how it works, also how to pass parameter to it ?

 

Kind Regards

 

Marc

 

See this exemple :

 

this.unitGroup.filter(function(unit,game) {
           if (unit.selected == true && unit.name == 'settler' ){
               game.buildCityButton.visible = true;
           } else {
            game.buildCityButton.visible = false;
        }
    }, this);
 
 
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...