コード例 #1
0
        public static GfxTileSheet CreateStatic(int w, int h, params byte[] pixels)
        {
            var tile = new GfxTileSheet(w, h, 1);

            tile.SetPixels(pixels);
            return(tile);
        }
コード例 #2
0
        private void ParseDrawingCore(TextReader reader, string drawId)
        {
            var    lst = new List <bool>();
            string line;
            int    frameCount = 1;

loop:
            for (int i = 0; i < BitsyGame.TILESIZE; i++)
            {
                line = reader.ReadLineSafe();
                for (int j = 0; j < 8; j++)
                {
                    lst.Add(line[j] != '0');
                }
            }
            if (reader.Peek() >= 0 && ((char)reader.Peek() == '>'))
            {
                reader.ReadLine();
                frameCount++;
                goto loop;
            }

            var gfx = new GfxTileSheet(BitsyGame.TILESIZE, BitsyGame.TILESIZE, frameCount);

            gfx.SetPixels(lst);
            _environment.ImageStore[drawId] = gfx;
        }