# Panel:GetContentSize

- **Ortam:** İstemci, Menü
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/Panel:GetContentSize
- **Çeviri tarihi:** 2025-09-08

```lua
number, number Panel:GetContentSize()
```

## Açıklama

Bir panel nesnesinin içindeki içeriğin/çocukların boyutunu alır.

Varsayılan olarak yalnızca [DLabel](https://gmod.tr/wiki/DLabel) gibi [Label](https://gmod.tr/wiki/Label) türevi panellerle çalışır.

Ayrıca bu metodu manuel olarak uygulayan herhangi bir panelde de çalışacaktır.

## Döndürülen Değerler

1. [number](https://gmod.tr/wiki/number): Nesnenin içerik genişliği.
2. [number](https://gmod.tr/wiki/number): Nesnenin içerik yüksekliği.

### Örnek

Bu fonksiyonun kendi panelinizde nasıl uygulanacağını gösterir.

```lua
local PANEL = {}

function PANEL:GetContentSize()
	surface.SetFont( self:GetFont() )
	return surface.GetTextSize( self:GetText() )
end

vgui.Register( "DTextEntry_Edit", PANEL, "DTextEntry" )

-- Başka bir yerde, yeni oluşturulan paneli test etmek için
local frame = vgui.Create( "DFrame" )
frame:SetSize( 500, 200 )
frame:Center()
frame:MakePopup()

local txt = vgui.Create( "DTextEntry_Edit", frame )
txt:SetPos( 5, 25 )
txt:SetSize( 100, 10 )
txt:SetText( "Really long string that is bigger than 100 pixels" )
txt:SizeToContentsX( 5 ) -- Metni ayarladıktan sonra çağrılmalıdır
txt:SizeToContentsY( 5 ) -- Bu iki fonksiyonun normal bir DTextEntry üzerinde bir etkisi olmayacaktır
```

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/Panel:GetContentSize
