Exemple #1
0
        private void LoadData()
        {
            string _fntFilePath     = System.IO.Path.Combine(SceneManager.GameProject.ProjectPath, fntFilePath);
            string _textureFilePath = System.IO.Path.Combine(SceneManager.GameProject.ProjectPath, textureFilePath);

#if WINDOWS
            if (File.Exists(_fntFilePath) && File.Exists(_textureFilePath))
#elif WINRT
            if (MetroHelper.AppDataFileExists(_fntFilePath) && MetroHelper.AppDataFileExists(_textureFilePath))
#endif
            {
                this.fontFile    = FontLoader.Load(_fntFilePath);
                this.fontTexture = TextureLoader.FromFile(_textureFilePath);

                this.fontRenderer = new BitmapFontRenderer(this.fontFile, this.fontTexture);
            }
        }
        /// <summary>
        /// 
        /// </summary>
        protected override void Initialize()
        {
            if (!initialized)
            {
                base.Initialize();

                content = new ContentManager(Services, "Content");
                spriteBatch = new SpriteBatch(GraphicsDevice);

                //SceneManager.Content = content;
                SceneManager.SpriteBatch = spriteBatch;
                SceneManager.GraphicsDevice = GraphicsDevice;
                SceneManager.ActiveCamera = this.Camera;

                EditorHandler.SelectedGameObjects = new List<GameObject>();

                // Load ObjectIcons
                objectIcons["AudioObject"] = TextureLoader.FromFile(AppDomain.CurrentDomain.BaseDirectory + "\\Gibbo.Content\\audio.png");

                FontFile fontFile = FontLoader.Load(AppDomain.CurrentDomain.BaseDirectory + "\\Gibbo.Content\\editorBMFont.fnt");
                Texture2D fontTexture = TextureLoader.FromFile(AppDomain.CurrentDomain.BaseDirectory + "\\Gibbo.Content\\editorBMFont_0.png");
                bmFontRenderer = new BitmapFontRenderer(fontFile, fontTexture);

                LoadContent();

                this.CenterCamera();

                initialized = true;

                this.MouseWheel += SceneEditorControl_MouseWheel;
                this.MouseDown += SceneViewGameControl_MouseDown;
                this.MouseUp += SceneViewGameControl_MouseUp;
                this.MouseMove += SceneViewGameControl_MouseMove;
            }
        }
Exemple #3
0
        private void LoadData()
        {
            string _fntFilePath = System.IO.Path.Combine(SceneManager.GameProject.ProjectPath, fntFilePath);
            string _textureFilePath = System.IO.Path.Combine(SceneManager.GameProject.ProjectPath, textureFilePath);

#if WINDOWS
            if (File.Exists(_fntFilePath) && File.Exists(_textureFilePath))
#elif WINRT
            if (MetroHelper.AppDataFileExists(_fntFilePath) && MetroHelper.AppDataFileExists(_textureFilePath))
#endif
            {
                this.fontFile = FontLoader.Load(_fntFilePath);
                this.fontTexture = TextureLoader.FromFile(_textureFilePath);

                this.fontRenderer = new BitmapFontRenderer(this.fontFile, this.fontTexture);
            }
        }