コード例 #1
0
        }   // end of LiveFeedDisplay LoadContent()

        public void InitDeviceResources(GraphicsDeviceManager graphics)
        {
            if (Header_bg == null)
            {
                Header_bg = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\twitter_Icon");
            }

            if (cornerTR == null)
            {
                cornerTR = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\cornerTR");
            }

            if (cornerBR == null)
            {
                cornerBR = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\cornerBR");
            }
        }   // end of LiveFeedDisplay InitDeviceResources()
コード例 #2
0
        }     // end of Render()

        #endregion

        #region Internal

        public void LoadContent(bool immediate)
        {
            brightnessSlider.LoadContent(immediate);
            durationSlider.LoadContent(immediate);
            ledGrid.LoadContent(immediate);
            bar.LoadContent(immediate);

            if (leftStickTexture == null)
            {
                leftStickTexture = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\HelpCard\LeftStick");
            }

            if (rightStickTexture == null)
            {
                rightStickTexture = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\HelpCard\RightStick");
            }
        }   // end of LoadContent()
コード例 #3
0
        public void Activate()
        {
            if (state != States.Active)
            {
                this.useBackgroundThumbnail = true;// useBackgroundThumbnail;
                //  this.useOverscanForHitTesting = useOverscanForHitTesting;

                // Do stack handling here.  If we do it in the update object we have no
                // clue which order things get pushed and popped and madness ensues.
                CommandStack.Push(commandMap);

                state = States.Active;

                Header_bg = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\twitter_Icon");
                cornerTR  = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\cornerTR");
                cornerBR  = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\cornerBR");
            }
        }   // end of Activate
コード例 #4
0
            public void LoadContent(bool immediate)
            {
                // Init the effect.
                if (effect == null)
                {
                    effect = BokuGame.Load <Effect>(BokuGame.Settings.MediaPath + @"Shaders\Standard");
                    ShaderGlobals.RegisterEffect("Standard", effect);
                    effectCache.Load(effect, "");
                }

                // Load the texture.
                if (texture == null)
                {
                    texture = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\Cursor3D");
                }

                RunSimCursor.GetInstance().LoadContent(immediate);
            }   // end of Cursor3D RenderObj LoadContent()
コード例 #5
0
            }   // end of InitDeviceResources()

            public void UnloadContent()
            {
                BokuGame.Release(ref effect);

                BokuGame.Unload(glassTile);
                glassTile = null;
                BokuGame.Unload(descTile);
                descTile = null;
                BokuGame.Unload(examplesTile);
                examplesTile = null;

                BokuGame.Release(ref rightStickTexture);
                BokuGame.Release(ref leftStickTexture);
                BokuGame.Release(ref glassTileHighlight);
                BokuGame.Release(ref whiteHighlight);
                BokuGame.Release(ref blackHighlight);
                BokuGame.Release(ref normalMap);
            }   // end of AddItemHelpCard RenderObj UnloadContent()
コード例 #6
0
            internal void RefreshGrid()
            {
                Point currSelection = grid.SelectionIndex;

                GetSortedGridElements(refreshGrid_scratch);

                for (int i = 0; i < grid.ActualDimensions.Y; ++i)
                {
                    UIGridShareHubElement elem = grid.Get(0, i) as UIGridShareHubElement;

                    elem.Selected = false;

                    if (!refreshGrid_scratch.Contains(elem))
                    {
                        BokuGame.Unload(elem);
                    }
                }

                grid.Clear();

                for (int i = 0; i < refreshGrid_scratch.Count; ++i)
                {
                    grid.Add(refreshGrid_scratch[i], 0, grid.ActualDimensions.Y);
                    BokuGame.Load(refreshGrid_scratch[i]);
                }

                grid.Dirty = true;

                // Try to preserve selection index.
                // We might want to try to relocate the selected element if it moved instead.
                if (grid.ActualDimensions.Y > currSelection.Y)
                {
                    grid.SelectionIndex = new Point(0, currSelection.Y);
                }
                else if (grid.ActualDimensions.Y > 0)
                {
                    grid.SelectionIndex = new Point(0, grid.ActualDimensions.Y - 1);
                }

                Matrix parentMatrix = Matrix.Identity;

                grid.Update(ref parentMatrix);
            }
コード例 #7
0
            }   // end of PreGameRacing Render()

            protected override void Activate()
            {
                // Pause the game clock.
                // Instead of fully pausing the clock just let it run extremely slow.  This still
                // lets updates happen as expected and results in objects appearing when they
                // should and the camera moving to where it needs to be.
                //Time.Paused = true;
                Time.ClockRatio = 0.0001f;

                startTime = Time.WallClockTotalSeconds;

                texture1 = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\Count1");
                texture2 = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\Count2");
                texture3 = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\Count3");

                phase = 4;

                base.Activate();
            }   // end of PreGameRacing Activate()
コード例 #8
0
            }   // end of AddUISelector()

            public void ActivateNewItemSelector(bool ignorePaths)
            {
                // Do we need to update things to relfect a change in whether or not we're ignoreing paths?
                if (newItemSelectorShim.IgnorePaths != ignorePaths)
                {
                    BokuGame.Unload(newItemSelectorShim);
                    newItemSelectorShim = new UIShim(AddUISelector, out newItemSelector, ignorePaths);
                    BokuGame.Load(newItemSelectorShim);
                    newItemSelectorShim.InitDeviceResources(BokuGame.bokuGame.GraphicsDevice);
                }

                Foley.PlayProgrammingMoveOut();

                // Restore the default item color to white.
                shared.curObjectColor = ColorPalette.GetIndexFromColor(Classification.Colors.White);

                newItemSelectorShim.Activate();
                newItemSelector.IndexDefaultItem = -1;
            }   // end of EditObjectUpdateObj ActivateNewItemSelector()
コード例 #9
0
        }   // end of HandleTouchInput()

        #endregion

        public void LoadContent(bool immediate)
        {
            whiteTile      = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\LoadLevel\WhiteTile");
            whiteTop       = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\GridElements\WhiteTop");
            whiteBottom    = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\GridElements\WhiteBottom");
            blackHighlight = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\GridElements\BlackHighlight");

            {
                GetTexture getTexture = delegate { return(ButtonTextures.BButton); };
                cancelButton = new Button(Strings.Localize("textDialog.cancel"), Color.White, getTexture,
                                          UI2D.Shared.GetGameFont20);
            }
            {
                GetTexture getTexture = delegate { return(ButtonTextures.AButton); };
                okButton = new Button(Strings.Localize("textDialog.ok"), Color.White, getTexture, UI2D.Shared.GetGameFont20);
            }

            BokuGame.Load(textLineEditor, immediate);
        }   // end of LoadContent()
コード例 #10
0
            }   // end of LoadContent()

            public void InitDeviceResources(GraphicsDevice device)
            {
                // Init the effect.
                if (effect == null)
                {
                    effect = BokuGame.Load <Effect>(BokuGame.Settings.MediaPath + @"Shaders\UI2D");
                    ShaderGlobals.RegisterEffect("UI2D", effect);
                }

                if (rightStickTexture == null)
                {
                    rightStickTexture = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\HelpCard\RightStick");
                }
                if (leftStickTexture == null)
                {
                    leftStickTexture = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\HelpCard\LeftStick");
                }
                if (glassTileHighlight == null)
                {
                    glassTileHighlight = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\HelpCard\GlassTileHighlight");
                }
                if (whiteHighlight == null)
                {
                    whiteHighlight = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\GridElements\WhiteHighlight");
                }
                if (blackHighlight == null)
                {
                    blackHighlight = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\HelpCard\BlackHighlight");
                }
                if (normalMap == null)
                {
                    normalMap = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\UI2D\FlatNormalMap");
                }

                glassTile    = new Base9Grid(2.2f, 2.2f, edgeSize);
                descTile     = new Base9Grid(6.7f, 2.2f, edgeSize);
                examplesTile = new Base9Grid(9.0f, 5.0f, edgeSize);

                BokuGame.Load(glassTile);
                BokuGame.Load(descTile);
                BokuGame.Load(examplesTile);
            }   // end of InitDeviceResources()
コード例 #11
0
            internal void Deactivate()
            {
                LiveManager.FriendUpdatesEnabled   = false;
                LiveManager.JoinableUpdatesEnabled = false;

                if (LiveManager.IsConnected)
                {
                    LiveManager.Session.GamerJoined -= Session_GamerJoined;
                    LiveManager.Session.GamerLeft   -= Session_GamerLeft;
                }

                LiveManager.ClearQueuedOperations(null);

                grid.Active = false;

                // We rebuild the grid each time the share hub is activated, to reflect the dynamic nature of the friend list.
                BokuGame.Unload(grid);
                grid.Clear();

                elements.Clear();
            }
コード例 #12
0
        }   // end of VideoOutput Activate()

        override public void Deactivate()
        {
            if (state != States.Inactive)
            {
                // Release file list.
                shared.filenames    = null;
                shared.curFileIndex = 0;

                // Release the memeory buffer.
                shared.data = null;
                BokuGame.Release(ref shared.texture);
                shared.colors = null;

                // Do stack handling here.  If we do it in the update object we have no
                // clue which order things get pushed and popped and madness ensues.
                CommandStack.Pop(commandMap);

                pendingState             = States.Inactive;
                BokuGame.objectListDirty = true;
            }
        }   // end of VideoOutput Deactivate()
コード例 #13
0
            }   // end of PreGameRacingWithDesc Render()

            #endregion

            #region Internal

            protected override void Activate()
            {
                // Pause the game clock.
                // Instead of fully pausing the clock just let it run extremely slow.  This still
                // lets updates happen as expected and results in objects appearing when they
                // should and the camera moving to where it needs to be.
                //Time.Paused = true;
                Time.ClockRatio = 0.0001f;

                texture1 = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\Count1");
                texture2 = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\Count2");
                texture3 = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\Count3");

                base.Activate();

                showingDescription = true;
                HelpOverlay.Push(@"PreGameDescription");

                UI2D.Shared.GetFont Font = BokuGame.bokuGame.GraphicsDevice.Viewport.Height < 720 ? UI2D.Shared.GetGameFont18Bold : UI2D.Shared.GetGameFont24Bold;
                blob = new TextBlob(Font, Terrain.Current.XmlWorldData.name + "\n\n" + Terrain.Current.XmlWorldData.description, (int)(BokuGame.bokuGame.GraphicsDevice.Viewport.Width / 2));
                blob.Justification = Terrain.Current.XmlWorldData.descJustification;
            }   // end of PreGameRacingWithDesc Activate()
コード例 #14
0
            }   // end of PreGameDesc Update()

            public override void Render(Camera camera)
            {
                Texture2D logoTexture = null;

                if (!string.IsNullOrEmpty(logo))
                {
                    switch (logo)
                    {
                    case "n23":
                        logoTexture = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\NASA_JPL");
                        break;

                    default:
                        logoTexture = null;
                        break;
                    }
                }

                Vector2 pos = Vector2.Zero;

                pos.X = BokuGame.bokuGame.GraphicsDevice.Viewport.Width / 4.0f;
                pos.Y = BokuGame.bokuGame.GraphicsDevice.Viewport.Height / 2.0f - blob.NumLines / 2.0f * blob.Font().LineSpacing;

                if (logoTexture != null)
                {
                    Vector2 logoSize = new Vector2(logoTexture.Width, logoTexture.Height);

                    ScreenSpaceQuad ssquad = ScreenSpaceQuad.GetInstance();
                    // Position logo in upper right corner.
                    Vector2 logoPos = new Vector2(BokuGame.bokuGame.GraphicsDevice.Viewport.Width * 0.98f - logoSize.X, BokuGame.bokuGame.GraphicsDevice.Viewport.Width * 0.02f);
                    // Force to be pixel aligned.
                    logoPos.X = (int)logoPos.X;
                    logoPos.Y = (int)logoPos.Y;
                    ssquad.Render(logoTexture, logoPos, logoSize, "TexturedRegularAlpha");
                }

                blob.RenderWithButtons(pos, Color.White, outlineColor: Color.Black, outlineWidth: 1.5f, maxLines: 20);
            }   // end of PreGameDesc Render()
コード例 #15
0
        //
        //  HoverCar
        //

        public HoverCar()
            : base()
        {
            this.classification = new Classification("fish",
                                                     Classification.Colors.White,
                                                     Classification.Shapes.Tube,
                                                     Classification.Tastes.Salty,
                                                     Classification.Smells.Pleasant,
                                                     Classification.Physicalities.Collectable);
            this.classification.audioImpression = Classification.AudioImpression.Noisy;
            this.classification.audioVolume     = Classification.AudioVolume.Loud;
            this.classification.emitter         = ExpressModifier.Emitters.None;
            this.classification.expression      = Face.FaceState.None;

            InitGameActorParams();

            renderObj = new RenderObj(this, HoverCarSRO.GetInstance);

            BokuGame.Load(this);

            // Set holding position after loading model so that BoundingSphere is initialized.
            this.holdingPosition = new Vector3(1.5f, 0.0f, -0.1f);
        }
コード例 #16
0
        }   // end of GameListManager Refresh()

        public void Update()
        {
            // Lazy allocation
            if (blob == null)
            {
                blob = new TextBlob(UI2D.Shared.GetGameFont20, Strings.Localize("mainMenu.paused"), 300);
                blob.Justification = UI2D.UIGridElement.Justification.Center;
                deadKoduTexture    = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\SleepyKodu");
            }

#if !NETFX_CORE
            // Check if microbit:driver needs installing.
            if (MicrobitManager.DriverInstalled == false)
            {
                MicrobitManager.ShowDriverDialog();
            }
#endif

#if NETFX_CORE
            if (BokuGame.ScreenSize.X > BokuGame.ScreenSize.Y)
            {
#endif
            for (int i = 0; i < updateList.Count; ++i)
            {
                UpdateObject obj = updateList[i] as UpdateObject;
                obj.Update();
            }
#if NETFX_CORE
        }

        else
        {
            // Game paused since in strange snapped mode
        }
#endif
        }   // end of GameListManager Update()
コード例 #17
0
        override public void Activate()
        {
            if (state != States.Active)
            {
                // Do stack handling here.  If we do it in the update object we have no
                // clue which order things get pushed and popped and madness ensues.
                CommandStack.Push(commandMap);

                // Recreate the MyWorlds and Downloads menus since we may have added new files to them.
                UIGridWorldTile.SharedRenderTarget.ResetAll();
                BokuGame.Unload(shared.myWorldsGrid);
                BokuGame.Unload(shared.downloadsGrid);

                shared.myWorldsGrid = shared.CreateGrid(BokuGame.Settings.MediaPath + @"Xml\Levels" + @"\" + myWorldsPath, @"*.Xml");
                if (shared.myWorldsGrid != null)
                {
                    // Sort and set top item as initial selection.
                    LevelSort.SortGrid(shared.myWorldsGrid, LevelSort.SortBy.Date);
                    shared.myWorldsGrid.SelectionIndex = new Point(0, 0);
                }

                shared.downloadsGrid = shared.CreateGrid(BokuGame.Settings.MediaPath + @"Xml\Levels" + @"\" + downloadsPath, @"*.Xml");
                if (shared.downloadsGrid != null)
                {
                    // Sort and set top item as initial selection.
                    LevelSort.SortGrid(shared.downloadsGrid, LevelSort.SortBy.Date);
                    shared.downloadsGrid.SelectionIndex = new Point(0, 0);
                }

                BokuGame.Load(shared.myWorldsGrid);
                BokuGame.Load(shared.downloadsGrid);

                pendingState             = States.Active;
                BokuGame.objectListDirty = true;
            }
        }
コード例 #18
0
            }   // end of MiniHub Shared UnloadContent()

            /// <summary>
            /// Recreate render targets
            /// </summary>
            /// <param name="graphics"></param>
            public void DeviceReset(GraphicsDevice device)
            {
                BokuGame.DeviceReset(menu, device);
            }
コード例 #19
0
 public void UnloadContent()
 {
     BokuGame.Unload(menu);
 }   // end of MiniHub Shared UnloadContent()
コード例 #20
0
            }   // end of BuildMenu()

            public void LoadContent(bool immediate)
            {
                BokuGame.Load(menu, immediate);
            }   // end of MiniHub Shared LoadContent()
コード例 #21
0
        }   // end of InitDeviceResources()

        public void UnloadContent()
        {
            BokuGame.Release(ref backgroundTexture);
            BokuGame.Release(ref leftStick);
        }   // end of UnloadContent()
コード例 #22
0
        }   // end of InitDeviceResources()

        public void UnloadContent()
        {
            BokuGame.Release(ref background);
        }
コード例 #23
0
        public void UnloadContent()
        {
            BokuGame.Unload(grid);

            BokuGame.Release(ref dropShadowTexture);
        }   // end of ToolMenu UnloadContent()
コード例 #24
0
            }   // end of UpdateObj c'tor

            public override void Update()
            {
                foreach (UpdateObject obj in updateList)
                {
                    obj.Update();
                }

                if (done && !parent.logonDialog.Active)
                {
                    // Done loading, should we show the intro video?
                    if (XmlOptionsData.ShowIntroVideo)
                    {
                        try
                        {
#if NETFX_CORE
                            // Switch to MainMenu.
                            parent.DismissAndShowMain(null, null);
#else
                            if (shared.video == null)
                            {
                                // Start video.
                                shared.video           = BokuGame.Load <Video>(BokuGame.Settings.MediaPath + @"Video\Intro");
                                shared.player          = new VideoPlayer();
                                shared.player.IsLooped = false;
                                shared.player.Play(shared.video);
                            }

                            // Check if we're done with the video or the user hit escape to skip.
                            if (shared.player.State != MediaState.Playing ||
                                Actions.Cancel.WasPressed ||
                                TouchInput.WasLastReleased)
                            {
                                Actions.Cancel.ClearAllWasPressedState();
                                shared.player.Stop();

                                shared.player.Dispose();
                                shared.video = null;

                                XmlOptionsData.ShowIntroVideo = false;

                                // Switch to MainMenu.
                                parent.DismissAndShowMain(null, null);
                            }
#endif
                        }
                        catch (Exception e)
                        {
                            if (e != null)
                            {
                            }

                            // Something failed with the video so just pretend
                            // we never intended to go there anyway.
                            XmlOptionsData.ShowIntroVideo = false;

                            // Switch to MainMenu.
                            parent.DismissAndShowMain(null, null);
                        }
                    }
                    else
                    {
                        // Switch to MainMenu.
                        parent.DismissAndShowMain(null, null);
                    }
                }

                if (parent.progress != null && parent.progressMessage != null)
                {
                    lock (parent.progressMessage)
                    {
                        parent.progress.Message = parent.progressMessage;
                    }
                }
            }   // end of UpdateObj Update()
コード例 #25
0
        }   // end of TitleScreenMode UnloadContent()

        /// <summary>
        /// Recreate render targets
        /// </summary>
        /// <param name="graphics"></param>
        public void DeviceReset(GraphicsDevice device)
        {
            BokuGame.DeviceReset(titleScreen, device);
            BokuGame.DeviceReset(logonDialog, device);
        }
コード例 #26
0
 public void UnloadContent()
 {
     BokuGame.Unload(titleScreen);
     BokuGame.Unload(logonDialog);
 }   // end of TitleScreenMode UnloadContent()
コード例 #27
0
        }   // end of TitleScreenMode DismissAndShowMain()

        public void LoadContent(bool immediate)
        {
            BokuGame.Load(titleScreen, immediate);
            BokuGame.Load(logonDialog, immediate);
        }   // end of TitleScreenMode LoadContent()
コード例 #28
0
        }   // end of TitleScreen UnloadContent()

        /// <summary>
        /// Recreate render targets
        /// </summary>
        /// <param name="graphics"></param>
        public void DeviceReset(GraphicsDevice device)
        {
            BokuGame.DeviceReset(renderObj, device);
        }
コード例 #29
0
 public void UnloadContent()
 {
     BokuGame.Unload(renderObj);
 }   // end of TitleScreen UnloadContent()
コード例 #30
0
 public void LoadContent(bool immediate)
 {
     BokuGame.Load(renderObj, immediate);
 }   // end of TitleScreen LoadContent()