コード例 #1
0
        public CreepRenderer(CreepTextureEntry Entry)
        {
            Sprites = new Dictionary<CreepUnit, DirectionnalSprite>();
            Textures = new DirectionnalSurfaces();

            string SpritePath = "../../../../assets/Sprite/";

            foreach(string str in Entry.FrameUp)
            {
                Textures.Up.Add(new Surface(SpritePath + str));
            }

            foreach (string str in Entry.FrameDown)
            {
                Textures.Down.Add(new Surface(SpritePath + str));
            }

            foreach (string str in Entry.FrameLeft)
            {
                Textures.Left.Add(new Surface(SpritePath + str));
            }

            foreach (string str in Entry.FrameRight)
            {
                Textures.Right.Add(new Surface(SpritePath + str));
            }
        }
コード例 #2
0
ファイル: Graphics.cs プロジェクト: jordsti/towerdefenserpg
        public CreepTextureEntry GetEntry(String GfxName)
        {
            CreepTextureEntry Entry = new CreepTextureEntry();

            foreach (CreepTextureEntry e in Index)
            {
                if (e.Name == GfxName)
                {
                    return e;
                }
            }

            return Entry;
        }