Esempio n. 1
0
        private nk_font(byte[] ttf, int textureWidth, int textureHeight)
        {
            var fontParams = new FontSystemParams
            {
                Width  = textureWidth,
                Height = textureHeight,
                Flags  = FontSystem.FONS_ZERO_TOPLEFT
            };

            _fontSystem           = new FontSystem(fontParams);
            _fontSystem.Alignment = Alignment.Top;

            _defaultFontId   = _fontSystem.AddFontMem(DefaultFontName, ttf);
            _fontSystem.Size = DefaultSize;
        }
Esempio n. 2
0
        private DynamicSpriteFont(byte[] ttf, float defaultSize, int textureWidth, int textureHeight)
        {
            var fontParams = new FontSystemParams
            {
                Width              = textureWidth,
                Height             = textureHeight,
                IsAlignmentTopLeft = true
            };

            _fontSystem           = new FontSystem(fontParams);
            _fontSystem.Alignment = Alignment.Top;

            _defaultFontId = _fontSystem.AddFontMem(DefaultFontName, ttf);
            Size           = defaultSize;
        }
Esempio n. 3
0
        private DynamicSpriteFont(byte[] ttf, float defaultSize, int textureWidth, int textureHeight)
        {
            var fontParams = new FontSystemParams
            {
                Width  = textureWidth,
                Height = textureHeight,
                Flags  = FontSystem.FONS_ZERO_TOPLEFT
            };

            _fontSystem           = new FontSystem(fontParams);
            _fontSystem.Alignment = FontSystem.FONS_ALIGN_TOP;

            _defaultFontId = _fontSystem.AddFontMem(DefaultFontName, ttf);
            Size           = defaultSize;
        }