Poups and Pre-loaders

Message Popup

WP8Message msg = new WP8Message("Message Title", "Message message");

 

Result for this API call is showed below:

original-c8e36e04-556504bda48b5.txt

If you need to find out when message is closed you should add listener:

msg.addEventListener(BaseEvent.COMPLETE, OnMessageClose);

OnMessageClose function will be called as soon as pop-up is closed.

OnMessageClose function example:

private void OnMessageClose(CEvent e) {
   //removing listener
   e.dispatcher.removeEventListener(BaseEvent.COMPLETE,  OnMessageClose);
   new WP8Message("Result", "Message Closed");
}

 

Dialog Popup

WP8Dialog dialog = new WP8Dialog("Dialog Title", "Dialog message");

Result for this API call is showed below:

original-73b20bc7-556504bdc7b19.txt

If you need to find out dialog result you  should add listener:

dialog.addEventListener(BaseEvent.COMPLETE, OnDialogClose);

OnDialogClose function will be called as soon as popup is closed.

OnDialogClose function example:

private void OnDialogClose(CEvent e) {
     //removing listner
    e.dispatcher.removeEventListener(BaseEvent.COMPLETE, OnDialogClose);
    //parsing result
    switch((WP8DialogResult)e.data) {
    case WP8DialogResult.YES:
        Debug.Log ("Yes button pressed");
        break;
    case WP8DialogResult.NO:
        Debug.Log ("No button pressed");
        break;
    }
}

 

 

Rate Popup

WP8RateUsPopUp ratePopUp =  new WP8RateUsPopUp("Like this game?", "Please rate to support future updates!");

 

Dialog popup will be created, but Yes option will redirect to the rating page as on the screenshot below

original-68207283-556504be0400d.txt

If you need to find out pop-up result you  should add listener:

ratePopUp.addEventListener(BaseEvent.COMPLETE, OnRatePopUpClose);

OnRatePopUpClose function will be called as soon as popup is closed.

OnRatePopUpClose function example:

private void OnRatePopUpClose(CEvent e) {
        //removing listner
        e.dispatcher.removeEventListener(BaseEvent.COMPLETE, OnRatePopUpClose);
        //parsing result
        switch((WP8DialogResult)e.data) {
        case WP8DialogResult.RATED:
            Debug.Log ("Rate Option pickied");
            break;
            break;
        case WP8DialogResult.DECLINED:
            Debug.Log ("Declined Option pickied");
            break;
        }
}

 

 

Show Preloader

WP8NativeUtils.ShowPreloader();

 

Hide Preloader

WP8NativeUtils.HidePreloader();

 

Note: While preloader shown all input will be blocked.