Esempio n. 1
0
        public void ResetAtlas(int width, int height)
        {
            _atlas.Reset(width, height);
            _dirtyRect[0] = width;
            _dirtyRect[1] = height;
            _dirtyRect[2] = 0;
            _dirtyRect[3] = 0;

            for (var i = 0; i < _fonts.Count; i++)
            {
                var font = _fonts[i];
                font.Glyphs.Clear();
            }

            if (width == _params_.Width && height == _params_.Height)
            {
                return;
            }

            _texData = new byte[width * height];
            Array.Clear(_texData, 0, _texData.Length);
            _colorData = new Color[width * height];

            Texture         = null;
            _params_.Width  = width;
            _params_.Height = height;
            _itw            = 1.0f / _params_.Width;
            _ith            = 1.0f / _params_.Height;
            AddWhiteRect(2, 2);
        }
Esempio n. 2
0
        public int ResetAtlas(int width, int height)
        {
            var i = 0;
            var j = 0;

            _atlas.Reset(width, height);
            _texData = new byte[width * height];
            Array.Clear(_texData, 0, _texData.Length);
            _dirtyRect[0] = width;
            _dirtyRect[1] = height;
            _dirtyRect[2] = 0;
            _dirtyRect[3] = 0;
            for (i = 0; i < _fontsNumber; i++)
            {
                var font = _fonts[i];
                font.GlyphsNumber = 0;
                for (j = 0; j < 256; j++)
                {
                    font.Lut[j] = -1;
                }
            }

            _params_.Width  = width;
            _params_.Height = height;
            _itw            = 1.0f / _params_.Width;
            _ith            = 1.0f / _params_.Height;
            AddWhiteRect(2, 2);
            return(1);
        }