Exemplo n.º 1
0
 // NOTE Add方法自动判断是否马上加载,而Load只能在运行时使用,要立即加载
 public void Add(ContentData data)
 {
     Content c = new Content(data);
     if (Loaded)
         c.Load(ContentMgr);
     ContentList.Add(c);
 }
Exemplo n.º 2
0
 public Object Load(ContentData data)
 {
     Content c = new Content(data);
     c.Load(ContentMgr);
     ContentList.Add(c);
     return c.Combra;
 }
Exemplo n.º 3
0
        private void TestForm1_Load(object sender, EventArgs e)
        {
            GameService.Instance.Initialize(ExecuteMode.RunTime, xnaControl1.GraphicsDevice);
            Graphics = GameService.Instance.QueryModule<GraphicsModule>();

            ContentSetData csInfo = new ContentSetData();
            csInfo.Id = GameService.Instance.QueryModule<UIDStackModule>().Take(typeof(ContentSetData));
            csInfo.Name = "Default";
            GameService.Instance.QueryModule<ContentManager>().AddContentSet(csInfo);

            ContentData fontInfo = new ContentData();
            fontInfo.Id = -1;
            fontInfo.Key = "Content/Font/Default";
            fontInfo.Type = ContentType.Font;
            GameService.Instance.QueryModule<ContentManager>().AddContent(csInfo.Id, fontInfo);

            ContentData texInfo = new ContentData();
            texInfo.Id = -1;
            texInfo.Key = "Content/Texture/Char";
            texInfo.Type = ContentType.Texture;
            GameService.Instance.QueryModule<ContentManager>().AddContent(csInfo.Id, texInfo);

            GameService.Instance.QueryModule<ContentManager>().LoadCombra(csInfo.Id);

            pos = Vector2.Zero;
            speed = new Vector2(80f, 60f);
            textSize = new Vector2(30, 150);// GameManager.Instance.GraphicsMgr.MeasureString("Default", "Hello World");
        }
Exemplo n.º 4
0
 public ContentData CreateData()
 {
     ContentData data = new ContentData();
     data.Id = this.Id;
     data.Key = this.Key;
     data.Type = this.Type;
     return data;
 }
Exemplo n.º 5
0
        public Content(ContentData data)
        {
            Id = data.Id;
            Key = data.Key;
            Type = data.Type;

            Combra = null;
        }
Exemplo n.º 6
0
 public ContentData CreateContentData()
 {
     ContentData cData = new ContentData();
     cData.Id = ContentId;
     cData.Key = ContentKey;
     cData.Type = ContentType;
     return cData;
 }
Exemplo n.º 7
0
        public ContentSetData CreateContentSetData()
        {
            ContentSetData csInfo = new ContentSetData();
            csInfo.Name = this.Name;
            foreach (ResourceData ri in ResourceDataList)
            {
                ContentData ci = new ContentData();
                ci.Id = ri.ContentId;
                ci.Key = ri.ContentKey;
                ci.Type = ri.ContentType;
                csInfo.ContentDataList.Add(ci);
            }

            return csInfo;
        }
Exemplo n.º 8
0
 public void AddContent(int id, ContentData data)
 {
     ContentSet cs = ContentSetList.Find(s => s.Id == id);
     cs.Add(data);
 }
Exemplo n.º 9
0
 public new void Load(ContentData data)
 {
 }
Exemplo n.º 10
0
 public new void Add(ContentData data)
 {
 }