コード例 #1
0
        public void set(string name, int lord_id, TactileLibrary.Preset_Chapter_Data data)
        {
            // Chapter
            Chapter.text = name;
            // Lord_Lvl
            int level = data.Lord_Lvl;

            if (level == 0)
            {
                if (Global.data_actors.ContainsKey(lord_id))
                {
                    level = Global.data_actors[lord_id].Level;
                }
            }
            Lord_Lvl.text = level.ToString();
            // Unit_Count
            Unit_Count.text = data.Units.ToString();
            // Gold
            Gold.text = data.Gold.ToString();
            // Play Time Counter
            Counter     = new Play_Time_Counter(data.Playtime);
            Counter.loc = new Vector2(40, 24);
            // Lord
            if (Global.content_exists(string.Format(@"Graphics/Characters/{0}", Global.game_actors[lord_id].map_sprite_name)))
            {
                Lord_Sprite.texture = Global.Content.Load <Texture2D>(
                    string.Format(@"Graphics/Characters/{0}", Global.game_actors[lord_id].map_sprite_name));
            }
            else
            {
                Lord_Sprite.texture = Global.Content.Load <Texture2D>(
                    string.Format(@"Graphics/Characters/{0}", Scene_Map.DEFAULT_MAP_SPRITE));
            }
            if (Lord_Sprite.texture != null)
            {
                Lord_Sprite.offset = new Vector2(
                    (Lord_Sprite.texture.Width / Lord_Sprite.frame_count) / 2,
                    (Lord_Sprite.texture.Height / Lord_Sprite.facing_count) - 8);
            }
        }
コード例 #2
0
        protected virtual void initialize_sprites()
        {
            // Black Screen
            Black_Screen           = new Sprite();
            Black_Screen.texture   = Global.Content.Load <Texture2D>(@"Graphics/White_Square");
            Black_Screen.dest_rect = new Rectangle(0, 0, Config.WINDOW_WIDTH, Config.WINDOW_HEIGHT);
            Black_Screen.tint      = new Color(0, 0, 0, 255);
            // Map Darken
            Map_Darken           = new Sprite();
            Map_Darken.texture   = Global.Content.Load <Texture2D>(@"Graphics/White_Square");
            Map_Darken.dest_rect = new Rectangle(0, 0, Config.WINDOW_WIDTH, Config.WINDOW_HEIGHT);
            Map_Darken.tint      = new Color(0, 0, 0, 128);
            // Banner
            Banner              = new Sprite();
            Banner.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Preparations_Screen");
            Banner.loc          = new Vector2(0, 0);
            Banner.src_rect     = new Rectangle(0, 0, 320, 40);
            Banner.tint         = new Color(255, 255, 255, 128);
            Banner.stereoscopic = Config.PREPMAIN_BANNER_DEPTH;
            Goal     = new TextSprite();
            Goal.loc = new Vector2(Config.WINDOW_WIDTH - 144 / 2, 20);
            Goal.SetFont(Config.UI_FONT, Global.Content, "White");
            Goal.stereoscopic         = Config.PREPMAIN_BANNER_DEPTH;
            ChapterLabel              = new ChapterLabel();
            ChapterLabel.loc          = new Vector2(Config.WINDOW_WIDTH - 144, 4);
            ChapterLabel.stereoscopic = Config.PREPMAIN_BANNER_DEPTH;
            ChapterLabel.SetChapter(Global.data_chapters[Global.game_state.chapter_id]);
            // Background
            Background         = new Menu_Background();
            Background.texture = Global.Content.Load <Texture2D>(@"Graphics/Pictures/Preparation_Background");
            (Background as Menu_Background).vel  = new Vector2(0, -1 / 3f);
            (Background as Menu_Background).tile = new Vector2(1, 2);
            Background.stereoscopic = Config.PREP_BG_DEPTH;
            // Command Window
            CommandWindow              = new Window_Command(command_window_loc, 80, command_window_string());
            CommandWindow.text_offset  = new Vector2(8, 0);
            CommandWindow.glow         = true;
            CommandWindow.bar_offset   = new Vector2(-8, 0);
            CommandWindow.stereoscopic = Config.PREPMAIN_WINDOW_DEPTH;
            // Info Window
            InfoWindow              = new Sprite();
            InfoWindow.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Preparations_Screen");
            InfoWindow.loc          = new Vector2(8, 128);
            InfoWindow.src_rect     = new Rectangle(208, 40, 112, 64);
            InfoWindow.stereoscopic = Config.PREPMAIN_DATA_DEPTH;
            // Help Window
            CommandHelpWindow              = new Sprite();
            CommandHelpWindow.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Preparations_Screen");
            CommandHelpWindow.loc          = new Vector2(160, 40);
            CommandHelpWindow.src_rect     = new Rectangle(184, 104, 136, 112);
            CommandHelpWindow.stereoscopic = Config.PREPMAIN_INFO_DEPTH;
            // Help Text
            HelpText     = new TextSprite();
            HelpText.loc = new Vector2(176, 48);
            HelpText.SetFont(Config.UI_FONT, Global.Content, "White");
            HelpText.text         = "";
            HelpText.stereoscopic = Config.PREPMAIN_INFO_DEPTH;
            // Info Label
            InfoLabel              = new Sprite();
            InfoLabel.texture      = Global.Content.Load <Texture2D>(@"Graphics/Pictures/Preparation_Info_Text");
            InfoLabel.loc          = new Vector2(16, 136);
            InfoLabel.offset       = new Vector2(-5, -2);
            InfoLabel.src_rect     = new Rectangle(0, 0, InfoLabel.texture.Width, 28);
            InfoLabel.stereoscopic = Config.PREPMAIN_DATA_DEPTH;
            // Info
            AvgLvl     = new RightAdjustedText();
            AvgLvl.loc = new Vector2(108 - 32, 136);
            AvgLvl.SetFont(Config.UI_FONT, Global.Content, "Blue");
            AvgLvl.stereoscopic = Config.PREPMAIN_DATA_DEPTH;
            EnemyAvgLvl         = new RightAdjustedText();
            EnemyAvgLvl.loc     = new Vector2(108, 136);
            EnemyAvgLvl.SetFont(Config.UI_FONT, Global.Content, "Red");
            EnemyAvgLvl.stereoscopic = Config.PREPMAIN_DATA_DEPTH;
            Funds     = new RightAdjustedText();
            Funds.loc = new Vector2(100, 152);
            Funds.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Funds.stereoscopic   = Config.PREPMAIN_DATA_DEPTH;
            Counter              = new Play_Time_Counter();
            Counter.loc          = new Vector2(20, 168);
            Counter.stereoscopic = Config.PREPMAIN_DATA_DEPTH;

            create_start_button();
        }