public StorePurchaseDialog(Scene.ObjectRegistrationHandler registrationHandler, Scene.ObjectUnregistrationHandler unregistrationHandler)
            : base(registrationHandler, unregistrationHandler)
        {
            Height = Purchase_Dialog_Height;
            TopYWhenActive = Definitions.Back_Buffer_Height - (Purchase_Dialog_Height + Bopscotch.Scenes.NonGame.StoreScene.Dialog_Margin);
            CarouselCenter = new Vector2(Definitions.Back_Buffer_Center.X, Carousel_Center_Y);
            CarouselRadii = new Vector2(Carousel_Horizontal_Radius, Carousel_Vertical_Radius);
            _itemRenderDepths = new Range(Minimum_Item_Render_Depth, Maximum_Item_Render_Depth);
            _itemScales = new Range(Minimum_Item_Scale, Maximum_Item_Scale);

            AddIconButton("previous", new Vector2(Definitions.Back_Buffer_Center.X - 450, 175), Button.ButtonIcon.Previous, Color.DodgerBlue);
            AddIconButton("next", new Vector2(Definitions.Back_Buffer_Center.X + 450, 175), Button.ButtonIcon.Next, Color.DodgerBlue);

            AddButton("Back", new Vector2(Definitions.Left_Button_Column_X, 400), Button.ButtonIcon.Back, Color.DodgerBlue, 0.7f);
            AddButton("Buy", new Vector2(Definitions.Right_Button_Column_X, 400), Button.ButtonIcon.Tick, Color.Orange, 0.7f);

            _nonSpinButtonCaptions.Add("Buy");

            ActionButtonPressHandler = HandleActionButtonPress;
            TopYWhenInactive = Definitions.Back_Buffer_Height;

            SetupButtonLinkagesAndDefaultValues();

            registrationHandler(this);

            _textTransitionTimer = new Timer("");
            GlobalTimerController.GlobalTimer.RegisterUpdateCallback(_textTransitionTimer.Tick);
            _textTransitionTimer.NextActionDuration = 1;
            _textTint = Color.White;

            _font = Game1.Instance.Content.Load<SpriteFont>("Fonts\\arial");
        }
        public ComponentSetSelectionCarouselDialog(Scene.ObjectRegistrationHandler registrationHandler, Scene.ObjectUnregistrationHandler unregistrationHandler)
            : base(registrationHandler, unregistrationHandler)
        {
            _selectableComponentSets = new List<AvatarComponentSet>();

            Height = Dialog_Height;
            TopYWhenActive = Definitions.Back_Buffer_Height - Dialog_Height;
            CarouselCenter = new Vector2(Definitions.Back_Buffer_Center.X, Carousel_Center_Y);
            CarouselRadii = new Vector2(Carousel_Horizontal_Radius, Carousel_Vertical_Radius);
            _itemRenderDepths = new Range(Minimum_Item_Render_Depth, Maximum_Item_Render_Depth);
            _itemScales = new Range(Minimum_Item_Scale, Maximum_Item_Scale);

            AddIconButton("previous", new Vector2(Definitions.Back_Buffer_Center.X - 450, 175), Button.ButtonIcon.Previous, Color.DodgerBlue);
            AddIconButton("next", new Vector2(Definitions.Back_Buffer_Center.X + 450, 175), Button.ButtonIcon.Next, Color.DodgerBlue);

            AddButton("Back", new Vector2(Definitions.Left_Button_Column_X, 325), Button.ButtonIcon.Back, Color.Red, 0.7f);
            AddButton("Change", new Vector2(Definitions.Right_Button_Column_X, 325), Button.ButtonIcon.Options, Color.LawnGreen, 0.7f);

            ActionButtonPressHandler = HandleActionButtonPress;
            TopYWhenInactive = Definitions.Back_Buffer_Height;

            SetupButtonLinkagesAndDefaultValues();

            registrationHandler(this);
        }
Example #3
0
        public GameBase(Orientation orientation)
            : base()
        {
            _instance = this;

            GraphicsDeviceManager graphics = new GraphicsDeviceManager(this);

            if (orientation == Orientation.Portrait)
            {
                graphics.SupportedOrientations = DisplayOrientation.Portrait | DisplayOrientation.PortraitDown;
            }
            else
            {
                graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
            }

            graphics.IsFullScreen = true;

            Content.RootDirectory = "Content";

            GlobalTimerController.ClearInstance();
            TouchProcessor.ClearInstance();

            _scenes = new Dictionary<Type, Scene>();
            _currentScene = null;
            _tombstoneFileName = DefaultTombstoneFileName;
            _sceneTransitionCrossFadeTextureName = "";

            PurchaseManager = new External_APIS.iOS.InAppPurchaseManager();
        }
        public LevelFactory(Scene.ObjectRegistrationHandler registerGameObject, 
            TimerController.TickCallbackRegistrationHandler registerTimerTick)
        {
            _registerGameObject = registerGameObject;
            _registerTimerTick = registerTimerTick;

            BackgroundDimensions = new Point(Definitions.Back_Buffer_Width, Definitions.Back_Buffer_Height);
        }
        public SurvivalRankingCoordinator(RankSequenceCallback completionCallback, Scene.ObjectRegistrationHandler registrationHandler)
        {
            _registerObject = registrationHandler;

            _rankingStars = new RankingStar[Ranking_Star_Count];
            for (int i = 0; i < Ranking_Star_Count; i++)
            {
                _rankingStars[i] = new RankingStar() { SoundPitch = (i - Ranking_Star_Count) * 0.2f };
            }

            _rankingLetter = new RankingLetter();
            _rankingLetter.NextAction = completionCallback;
        }
        public SurvivalStartCarouselDialog(Scene.ObjectRegistrationHandler registrationHandler, Scene.ObjectUnregistrationHandler unregistrationHandler)
            : base(registrationHandler, unregistrationHandler)
        {
            _boxCaption = Translator.Translation("Select Area and Level");

            Height = Dialog_Height;
            TopYWhenActive = 300;
            TopYWhenInactive = Definitions.Back_Buffer_Height;
            CarouselCenter = new Vector2(Definitions.Back_Buffer_Center.X, Carousel_Center_Y);
            CarouselRadii = new Vector2(Carousel_Horizontal_Radius, Carousel_Vertical_Radius);

            _captionsForButtonsNotActivatedByGamepadStartButton.Add("Back");
        }
        public CourseSelectionCarouselDialog(Scene.ObjectRegistrationHandler registrationHandler, Scene.ObjectUnregistrationHandler unregistrationHandler)
            : base(registrationHandler, unregistrationHandler)
        {
            _boxCaption = Translator.Translation("Select Course");

            Height = Dialog_Height;
            TopYWhenInactive = Definitions.Back_Buffer_Height;
            CarouselCenter = new Vector2(Definitions.Back_Buffer_Center.X, Carousel_Center_Y);
            CarouselRadii = new Vector2(Carousel_Horizontal_Radius, Carousel_Vertical_Radius);

            SetupButtonLinkagesAndDefaultValues();

            registrationHandler(this);
        }
        public AreaSelectionCarouselDialog(Scene.ObjectRegistrationHandler registrationHandler, Scene.ObjectUnregistrationHandler unregistrationHandler)
            : base(registrationHandler, unregistrationHandler)
        {
            RotationSpeedInDegrees = Rotation_Speed_In_Degrees;
            _itemRenderDepths = new Range(Minimum_Item_Render_Depth, Maximum_Item_Render_Depth);
            _itemScales = new Range(Minimum_Item_Scale, Maximum_Item_Scale);

            CreateButtons();

            ActionButtonPressHandler = HandleNonSpinButtonAction;

            _textTransitionTimer = new Timer("");
            GlobalTimerController.GlobalTimer.RegisterUpdateCallback(_textTransitionTimer.Tick);
            _textTransitionTimer.NextActionDuration = 1;

            _textTint = Color.White;
        }
        public ResultsDialog(Scene.ObjectRegistrationHandler objectRegistrationHandler)
            : base()
        {
            _registerObject = objectRegistrationHandler;

            _boxCaption = Translator.Translation("Race Results");

            Height = Dialog_Height;
            TopYWhenActive = Top_Y_When_Active;

            AddButton("Exit", new Vector2(Definitions.Left_Button_Column_X, 625), Button.ButtonIcon.Play, Color.Red, 0.7f);

            _defaultButtonCaption = "Exit";
            _cancelButtonCaption = "Exit";

            _resultsAnnouncementTimer = new Timer("", AnnounceResults);
            GlobalTimerController.GlobalTimer.RegisterUpdateCallback(_resultsAnnouncementTimer.Tick);
        }
        public AvatarSelectionCarouselDialog(Scene.ObjectRegistrationHandler registrationHandler, Scene.ObjectUnregistrationHandler unregistrationHandler)
            : base(registrationHandler, unregistrationHandler)
        {
            ActionButtonPressHandler = SelectionHandler;

            Height = Dialog_Height;
            CarouselCenter = new Vector2(Definitions.Back_Buffer_Center.X, Carousel_Center_Y);
            CarouselRadii = new Vector2(Carousel_Horizontal_Radius, Carousel_Vertical_Radius);
            _itemRenderDepths = new Range(Minimum_Item_Render_Depth, Maximum_Item_Render_Depth);
            _itemScales = new Range(Minimum_Item_Scale, Maximum_Item_Scale);

            _captionsForButtonsNotActivatedByGamepadStartButton.Add("Back");

            AddIconButton("previous", new Vector2(Definitions.Back_Buffer_Center.X - 450, 175), Button.ButtonIcon.Previous, Color.DodgerBlue);
            AddIconButton("next", new Vector2(Definitions.Back_Buffer_Center.X + 450, 175), Button.ButtonIcon.Next, Color.DodgerBlue);

            registrationHandler(this);
        }
Example #11
0
        public GameBase(int screenWidth, int screenHeight, bool fullScreen)
            : base()
        {
            _instance = this;

            GraphicsDeviceManager graphics = new GraphicsDeviceManager(this);
            graphics.PreferMultiSampling = true;
            graphics.IsFullScreen = fullScreen;
            graphics.PreferredBackBufferWidth = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;

            Content.RootDirectory = "Content";

            GlobalTimerController.ClearInstance();

            _scenes = new Dictionary<Type, Scene>();
            _currentScene = null;
            _tombstoneFileName = "";
        }
        public CharacterSelectionCarouselDialog(
            Scene.ObjectRegistrationHandler registrationHandler, Scene.ObjectUnregistrationHandler unregistrationHandler)
            : base(registrationHandler, unregistrationHandler)
        {
            _boxCaption = Translator.Translation("Select Character");

            TopYWhenActive = Top_Y_When_Active;
            TopYWhenInactive = Definitions.Back_Buffer_Height;

            AddButton("Back", new Vector2(350.0f, 325), Button.ButtonIcon.Back, Color.Red, 0.6f);
            AddButton("Edit", new Vector2(Definitions.Back_Buffer_Center.X, 325), Button.ButtonIcon.Options, Color.Gold, 0.6f);
            AddButton("Select", new Vector2(1250.0f, 325), Button.ButtonIcon.Tick, Color.LawnGreen, 0.6f);

            _nonSpinButtonCaptions.Add("Edit");

            _defaultButtonCaption = "Select";
            _activeButtonCaption = "Select";
            _cancelButtonCaption = "Back";
        }
        public CarouselDialog(Scene.ObjectRegistrationHandler registrationHandler, Scene.ObjectUnregistrationHandler unregistrationHandler)
            : base()
        {
            SelectedItem = 0;
            Rotating = false;

            _selectorRotation = 0.0f;
            _targetRotation = _selectorRotation;

            _items = new List<ICarouselDialogItem>();
            _registerObject = registrationHandler;
            _unregisterObject = unregistrationHandler;

            _nonSpinButtonCaptions = new List<string>();
            _nonSpinButtonCaptions.Add("Back");
            _nonSpinButtonCaptions.Add("Select");
            _buttonSoundEffectOverrides = new Dictionary<string, string>();

            _captionsForButtonsNotActivatedByGamepadStartButton = new List<string>();

            RotationSpeedInDegrees = Default_Rotation_Speed_In_Degrees;
        }
 public SurvivalAreaCompleteContentFactory(Scene.ObjectRegistrationHandler registrationHandler)
 {
     _registerObject = registrationHandler;
     _newItemPopups = new List<PopupRequiringDismissal>();
 }
Example #15
0
 private void SceneTransitionHandler(Type nextSceneType)
 {
     if (_scenes.ContainsKey(nextSceneType))
     {
         _currentScene = _scenes[nextSceneType];
         _scenes[nextSceneType].Activate();
     }
 }
Example #16
0
        protected void AddScene(Scene toAdd)
        {
            if (toAdd.DeactivationHandler == null) { toAdd.DeactivationHandler = SceneTransitionHandler; }
            if (toAdd is AssetLoaderScene) { ((AssetLoaderScene)toAdd).LoadCompletionHandler = HandleAssetLoadCompletion; }

            if (!string.IsNullOrEmpty(_sceneTransitionCrossFadeTextureName)) { toAdd.CrossFadeTextureName = _sceneTransitionCrossFadeTextureName; }

            _scenes.Add(toAdd.GetType(), toAdd);
        }
Example #17
0
 public void WireUpBombBlockBlastColliders(Scene.ObjectRegistrationHandler registerObject)
 {
     for (int x = 0; x < MapDimensions.X; x++)
     {
         for (int y =0; y <MapDimensions.Y; y++)
         {
             BombBlock block = GetTile(x, y) as BombBlock;
             if (block != null)
             {
                 _bombBlocks.Add(block);
                 registerObject(block.BlastCollider);
             }
         }
     }
 }
 public SmashBlockItemFactory(Scene.ObjectRegistrationHandler objectRegistrationHandler,
     TimerController.TickCallbackRegistrationHandler timerTickRegistrationHandler)
 {
     _registerObject = objectRegistrationHandler;
     _registerTimerTick = timerTickRegistrationHandler;
 }