Example #1
0
        public static void InitSystem(GraphicsDevice graphics)
        {
            defaultTex = new Texture2D(graphics, 32, 32);
            for (int ii = 0; ii < 16; ii++)
            {
                BaseSheet.BlitColor((ii % 2 == (ii / 4 % 2)) ? Color.Black : new Color(255, 0, 255, 255), defaultTex, 8, 8, ii % 4 * 8, ii / 4 * 8);
            }
            //Set graphics device
            Content.BaseSheet.InitBase(graphics, defaultTex);

            Splash = BaseSheet.Import(UI_PATH + "Splash.png");

            SysFont = LoadFont("system");
        }
Example #2
0
        public static void InitStatic()
        {
            DiagManager.Instance.LoadMsg = "Loading Graphics";

            //load onepixel
            Pixel = new BaseSheet(1, 1);
            Pixel.BlitColor(Color.White, 1, 1, 0, 0);

            //Load divider texture
            DivTex = BaseSheet.Import(UI_PATH + "Divider.png");

            //load menu data
            MenuBG = TileSheet.Import(UI_PATH + "MenuBG.png", 8, 8);

            //load menu data
            MenuBorder = TileSheet.Import(UI_PATH + "MenuBorder.png", 8, 8);

            //load menu data
            PicBorder = TileSheet.Import(UI_PATH + "PortraitBorder.png", 4, 4);

            Arrows = TileSheet.Import(UI_PATH + "Arrows.png", 8, 8);

            Cursor = TileSheet.Import(UI_PATH + "Cursor.png", 11, 11);

            BattleFactors = TileSheet.Import(UI_PATH + "BattleFactors.png", 16, 16);

            Shadows = TileSheet.Import(UI_PATH + "Shadows.png", 32, 16);

            Tiling = TileSheet.Import(UI_PATH + "Tiling.png", TileSize, TileSize);

            Darkness = TileSheet.Import(UI_PATH + "Dark.png", 8, 8);

            Strip = TileSheet.Import(UI_PATH + "Strip.png", 8, 8);

            Buttons = TileSheet.Import(UI_PATH + "Buttons.png", 16, 16);

            HPMenu = TileSheet.Import(UI_PATH + "HP.png", 8, 8);

            MiniHP = BaseSheet.Import(UI_PATH + "MiniHP.png");

            MapSheet = TileSheet.Import(UI_PATH + "Map.png", 4, 4);

            Title = BaseSheet.Import(UI_PATH + "Title.png");

            Subtitle = BaseSheet.Import(UI_PATH + "Enter.png");


            //load font
            TextFont    = LoadFont("text");
            DungeonFont = LoadFont("banner");
            DamageFont  = LoadFont("yellow");
            HealFont    = LoadFont("green");
            EXPFont     = LoadFont("blue");

            Menu.MenuBase.BorderStyle = DiagManager.Instance.CurSettings.Border;

            DiagManager.Instance.LoadMsg = "Loading Headers";

            //initialize caches
            spriteCache = new LRUCache <MonsterID, CharSheet>(CHARA_CACHE_SIZE);
            spriteCache.OnItemRemoved   = DisposeCachedObject;
            portraitCache               = new LRUCache <MonsterID, PortraitSheet>(PORTRAIT_CACHE_SIZE);
            portraitCache.OnItemRemoved = DisposeCachedObject;
            vfxCache = new LRUCache <string, IEffectAnim>(VFX_CACHE_SIZE);
            vfxCache.OnItemRemoved = DisposeCachedObject;
            iconCache = new LRUCache <string, DirSheet>(ICON_CACHE_SIZE);
            iconCache.OnItemRemoved = DisposeCachedObject;
            itemCache = new LRUCache <string, DirSheet>(ITEM_CACHE_SIZE);
            itemCache.OnItemRemoved = DisposeCachedObject;
            tileCache               = new LRUCache <TileFrame, BaseSheet>(TILE_CACHE_SIZE_PIXELS);
            tileCache.ItemCount     = CountPixels;
            tileCache.OnItemRemoved = DisposeCachedObject;
            bgCache = new LRUCache <string, DirSheet>(BG_CACHE_SIZE);
            bgCache.OnItemRemoved     = DisposeCachedObject;
            objectCache               = new LRUCache <string, DirSheet>(OBJECT_CACHE_SIZE);
            objectCache.OnItemRemoved = DisposeCachedObject;

            //load guides
            CharaIndex    = LoadCharaIndices(DiagManager.CONTENT_PATH + "Chara/");
            PortraitIndex = LoadCharaIndices(DiagManager.CONTENT_PATH + "Portrait/");
            TileIndex     = LoadTileIndices(DiagManager.CONTENT_PATH + "Tile/");

            Loaded = true;
            //Notify script engine
            LuaEngine.Instance.OnGraphicsLoad();
        }