コード例 #1
0
ファイル: Font.cs プロジェクト: bradder555/NuklearSharp
        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;
        }
コード例 #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;
        }
コード例 #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;
        }