Panel:SetFontInternal

  Panel:SetFontInternal( string fontName )

Açıklama

Bu panelin metnini işlemek için kullanılan yazı tipini ayarlar. Bu, Label, TextEntry ve RichText için çalışır, ancak mevcut olduğunda kendi yerel SetFont (DTextEntry:SetFont, DLabel:SetFont) metotlarını kullanmak daha iyi bir fikirdir.

Bir panel tarafından kullanılan yazı tipini almak için Panel:GetFont fonksiyonunu çağırın.

Argümanlar

1 string fontName
Yazı tipinin adı.

Mevcut yazı tiplerinin bir listesi için buraya bakın. Alternatif olarak, kendi özel yazı tipinizi oluşturmak için surface.CreateFont kullanın.

Örnek

Bir RichText elemanının yazı tipini, sohbet kutusu yazı tipiyle eşleşecek şekilde ayarlar.

-- Create a window frame local TextFrame = vgui.Create( "DFrame" ) TextFrame:SetSize( 300, 200 ) TextFrame:Center() TextFrame:SetTitle( "This is a font test" ) TextFrame:MakePopup() -- RichText panel local richtext = vgui.Create( "RichText", TextFrame ) richtext:Dock( FILL ) -- Sample text richtext:SetText( "This is a sample of text using the chat box font." ) -- Ensure font and text color changes are applied -- We have to wait until after the internals of RichText set the default font function richtext:PerformLayout() if ( self:GetFont() != "ChatFont" ) then self:SetFontInternal( "ChatFont" ) end self:SetFGColor( color_white ) end
Çıktı:

Tüm sunucular · GmodTR Launcher · Rehber · GMod Wiki · GmodTR nedir? · Sunucu ekle · Discord