예제 #1
0
        /// <summary>
        /// initialize all resource groups in the resource configuration file
        /// </summary>
        private void InitializeResourceGroups()
        {
            TextureManager.Singleton.DefaultNumMipmaps             = 4;
            MeshManager.Singleton.PrepareAllMeshesForShadowVolumes = true;

            // for now, we just load all of the resource groups
            ResourceGroupManager.Singleton.InitialiseAllResourceGroups();

            // usually, though, we'll need to fine comb it a little more
            // InitializeResourceGroup allows us to load a single resource group,
            // rather than loading the entire set at once

            //load verdana font
            try {
                FontManager fontMgr = FontManager.Singleton;
                ResourcePtr font    = fontMgr.Create("Verdana", "General");
                font.SetParameter("type", "truetype");
                font.SetParameter("source", "verdana.ttf");
                font.SetParameter("size", "16");
                font.SetParameter("resolution", "96");
                font.Load();
                Console.Out.WriteLine("loaded, yo!");
            }
            catch (Exception e) {
                Util.Log("Unable to load verdana.ttf");
            }
        }
예제 #2
0
        private void Load(string fontFileName, string fontRef, int size)
        {
            ResourcePtr font = FontManager.Singleton.Create(fontRef, ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME);

            font.SetParameter("type", "truetype");
            font.SetParameter("source", fontFileName);
            font.SetParameter("size", size.ToString());
            font.SetParameter("resolution", "96");
            font.Load();
        }