当前位置: 首页>>代码示例>>C#>>正文


C# Dialog.setFont方法代码示例

本文整理汇总了C#中Dialog.setFont方法的典型用法代码示例。如果您正苦于以下问题:C# Dialog.setFont方法的具体用法?C# Dialog.setFont怎么用?C# Dialog.setFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dialog的用法示例。


在下文中一共展示了Dialog.setFont方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadContent

        /// <summary>
        /// Laddar rummets och de saker i rummets innehåll
        /// </summary>
        public void LoadContent(Game game)
        {
            // Första gången man besöker ett rum, laddas det in
            // Om man redan har besökt ett rum är allting där det var när man lämnade rummet
            if (visited == false)
            {
                soundhasplayed = false;
                this.background = game.Content.Load<Texture2D>(@"Images/Backgrounds/" + backgroundID);
                animbackground = new AnimatedSprite(background, new Vector2(0,0) , 0, new Point(background.Width / (background.Width / 320), background.Height), new Point(0, 0), new Point(2, 1), 100);
                this.mask = game.Content.Load<Texture2D>(@"Images/Backgrounds/" + backgroundID + "mask");
                this.foreground = game.Content.Load<Texture2D>(@"Images/Backgrounds/" + backgroundID + "fg");
                this.maskData = TextureTo2DArray(mask);
                this.game = game;
                int tal = 0;
                int.TryParse(dialogID, out tal);
                this.roomDialog = Registry.dialogs[tal];
                isItemClicked = false;

                toChangeRoom = false;
                roomDialog.setFont(game.Content.Load<SpriteFont>(@"textfont"));
                dialogIsActive = true;
                dialogSound = game.Content.Load<SoundEffect>(@"Sound/Voice/" + dialogID);
                foreach (string id in itemID)
                {
                    Item itemToBeAdded = new Item();
                    itemToBeAdded.loadNewItem(Registry.items[int.Parse(id)]);
                    itemToBeAdded.Initialize(game.Content.Load<Texture2D>(@itemToBeAdded.TextureString));
                    items.Add(itemToBeAdded);
                }
                foreach (string id in npcID)
                {
                    npcs.Add(Registry.npcs[int.Parse(id)]);
                }
                foreach (NPC item in npcs)
                {
                    item.loadContent(game);
                }
                foreach (Door item in doors)
                {
                    item.LoadContent(game);
                }

                int i = 0;
                foreach (Item item in items)
                {
                    string[] temp = itemPosition[i].Split(new char[] { ',' }, 2);
                    item.setPosition(new Vector2(float.Parse(temp[0]), float.Parse(temp[1])));
                    i++;
                }
                visited = true;

            }
            if (song != "null")
            {
                if (Registry.musbol == true)
                {
                    if (!Registry.music.IsDisposed)
                    {
                        MediaPlayer.Stop();
                        Registry.music.Dispose();
                    }
                }
                if (Registry.currentSong != song)
                {
                    Registry.music = game.Content.Load<Song>(@"Sound/BGM/" + song);
                    Registry.currentSong = song;
                    MediaPlayer.Play(Registry.music);
                }
                MediaPlayer.IsRepeating = true;
            }
        }
开发者ID:Niklasva,项目名称:ProjektArbete,代码行数:74,代码来源:Room.cs


注:本文中的Dialog.setFont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。