# math.EaseInOut

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

```lua
number math.EaseInOut( number progress, number easeIn = 0, number easeOut = 1 )
```

## Açıklama

Belirtilen yumuşatma kesirlerini dikkate alarak bir değer kesrinin ilerlemesini hesaplar.

## Argümanlar

1. [number](https://gmod.tr/wiki/number) **progress**: Yumuşatılacak ilerlemenin kesri, 0 ile 1 arasında.
2. [number](https://gmod.tr/wiki/number) **easeIn** = 0: Başlangıçta ne kadar yumuşatma yapılacağının kesri, 0 ile 1 arasında.
3. [number](https://gmod.tr/wiki/number) **easeOut** = 1: Bitişte ne kadar yumuşatma yapılacağının kesri, 0 ile 1 arasında.

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

1. [number](https://gmod.tr/wiki/number): "Yumuşatılmış" Değer, 0 ile 1 arasında

### Örnek

Üç farklı durumun yumuşatmasını hesaplar.

```lua
print(math.EaseInOut(0.1, 0.1, 0.1))
print(math.EaseInOut(0.2, 0.1, 0.1))
print(math.EaseInOut(0.3, 0.1, 0.1))
```

**Çıktı:** 0.055555... 0.166666... 0.277777...

### Örnek

Bu fonksiyonun oluşturabileceği eğrinin etkileşimli bir önizlemesi.

```lua
local f = vgui.Create( "DFrame" )
f:SetSize( 500, 500 )
f:Center()
f:MakePopup()

local sliderIn = vgui.Create( "DNumSlider", f )
sliderIn:Dock( TOP )
sliderIn:SetMinMax( 0, 4 )
sliderIn:SetText( "Yumuşak Başlangıç" )

local sliderOut = vgui.Create( "DNumSlider", f )
sliderOut:Dock( TOP )
sliderOut:SetMinMax( 0, 4 )
sliderOut:SetText( "Yumuşak Bitiş" )

local sliderMax = vgui.Create( "DNumSlider", f )
sliderMax:Dock( TOP )
sliderMax:SetMinMax( 1, 2 )
sliderMax:SetValue( 1 )
sliderMax:SetText( "Değer Aralığı Maks." )

local quality = 128

local oldPaint = f.Paint
f.Paint = function( pnl, w, h )
	oldPaint( pnl, w, h )

	surface.SetDrawColor( 255, 0, 0, 255 )
	local lastPos = { x = 0, y = 0 }
	for i=0, quality do
		local pos = { x = i / quality * pnl:GetWide(), y = math.EaseInOut( math.Remap( i / quality, 0, 1, 0, sliderMax:GetValue() ), sliderIn:GetValue(), sliderOut:GetValue() ) * pnl:GetTall() }
		surface.DrawLine( lastPos.x, lastPos.y, pos.x, pos.y )
		lastPos = pos
	end

	local frac = CurTime() % 1
	local easeVal = math.EaseInOut( math.Remap( frac, 0, 1, 0, sliderMax:GetValue() ), sliderIn:GetValue(), sliderOut:GetValue() )
	surface.DrawCircle( frac * pnl:GetWide(), easeVal * pnl:GetTall(), 4, 255, 255, 255 )

	surface.SetDrawColor( 255, 255, 255, easeVal * 255 )
	surface.DrawRect( 10, pnl:GetTall() - 10 - 48, 48, 48 )
end
```

**Çıktı:**

![August30-494-hl2.gif](https://gmod.tr/api/uploads/wiki/7a6b3aaa45b530025de2.gif)

- [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/math.EaseInOut
