Selamun Aleyküm Arkadaşlar Bu Konumda Sizlere Serverdeki Esc Menüsünü Ortalamayı Anlatacağım Forumda Böyle Bir Konu Bulamadığım İçin Mesaj Atan 2-3 Arkadaş Vardı. Onlar İçin De Bu Konuyu Açmak İstedim. Öncelikle Hikayesi Şu Benım Geliştirdiğim Filesde Esc Menüsü Ekranın Ortasında Değil Sağ Taraftaydı Resimdeki Gibi
Resim Bknz;
Resim Bknz;
Ben Bu İşlemin Yapıldığı Dosyayı Biliyordum Fakat Tam Olarak x y Kordinatlarını Bilmiyordum Ve Onun İçin Forumda Soru Cevap Kısmında Konu Açmıştım. Ama Şimdik Deneme Yanılma İle Onları Da Buldum Ve Paylaşıyorum.
Yapacağımız İşlemler Sırası İle ;
1- locale/tr/ui (Ve/Veya Filese Göre Değişkenlik Gösterebilir) locale/tr Dizinine Gidelim
2- systemdialog.py Dosyamızı Bulup NotePad ++ İle Açalım
3- Aşağıdaki İşlemleri Sırası İle Yapalım
Kod:
import uiScriptLocale ROOT = "d:/ymir work/ui/public/" window = { "name" : "SystemDialog", "style" : ("float",), "x" : SCREEN_WIDTH/2 - 140, (Sayılar Sizde Değişkenlik Gösterebilir.) "y" : SCREEN_HEIGHT/2 - 90, (Sayılar Sizde Değişkenlik Gösterebilir.) ,
Kod:
import uiScriptLocale ROOT = "d:/ymir work/ui/public/" window = { "name" : "SystemDialog", "style" : ("float",), "x" : SCREEN_WIDTH/2 - 100, "y" : SCREEN_HEIGHT/2 - 114,,
Artık Esc Menünüz Ekranın Tam Ortasında
Yorumlarınızı Esirgemeyin. İyi Forumlar.
Metin2 Esc Menüsü Ekrana Ortalanmamış Fileslerde Nasıl Ortalanır?
Metin2 özel sunucularında geliştirme yaparken bazı görsel hatalarla karşılaşabilirsiniz. Bunlardan birisi de escmenu.py dosyasının ekrana ortalanmamasıdır. Bu durum kullanıcı deneyimini olumsuz yönde etkileyebilir. Bu yazıda, esc menüsünün neden ortalanmadığını ve nasıl düzelteceğinizi detaylı olarak ele alacağız.
Esc Menüsü Nedir?
Metin2 oyununda oyuncu sağ alt köşedeki ESC tuşuna bastığında ekrana gelen menüdür. Bu menü; karakter bilgileri, envanter, eşya saklama, ayarlar gibi önemli fonksiyonları içerir. Bu nedenle doğru konumlandırılması oyun içi kullanıcı dostluğunu artırır.
Sorunun Kaynağı Nedir?
Bazı custom UI dosyalarında veya farklı çözünürlüklerde ESC menüsü ekranın sol üst köşesinde ya da rastgele bir konumda görünebilir. Bunun sebebi genellikle uiscript/escmenu.py dosyasındaki konumlandırma parametrelerinin varsayılan çözünürlüğe göre ayarlanmış olmasıdır. Eğer oyun penceresi genişletilmişse ya da UI dosyaları yeniden tasarlanmışsa menü doğru konumda gözükmeyebilir.
Çözüm Adımları
Öncelikle uiscript/escmenu.py dosyasını açın. Bu dosya genellikle Py file (Python GUI) formatındadır ve UI elementlerinin konumlarını belirler. Aşağıdaki adımları takip ederek menüyü ortalamayı sağlayabilirsiniz:
1. Pencere boyutlarını kontrol edin: SCREEN_WIDTH ve SCREEN_HEIGHT değerlerinin doğru olduğundan emin olun. Bu değerler genellikle oyun penceresinin çözünürlüğüne göre ayarlanır.
2. Window position ayarını değiştirin: Aşağıdaki gibi bir yapı kullanılır:
window.SetPosition((SCREEN_WIDTH - window.GetWidth()) / 2, (SCREEN_HEIGHT - window.GetHeight()) / 2)
Bu satır, pencerenin ekranın tam ortasında konumlandırılmasını sağlar.
PyRoot Dosyasında Gerekli Değişiklikler
Ayrıca, root/uitooltip.py veya root/game.py gibi PyRoot dosyalarında da ESC menüsü ile ilgili konumlandırma yapılır. Burada da benzer şekilde pencere ortalaması yapılması gerekir. Özellikle OnUpdate fonksiyonunda pencere pozisyonu tekrar tanımlanıyorsa, bu da soruna yol açabilir.
Ortalanmış ESC Menü Kod Örneği:
def OpenEscMenu(self):
self.__LoadWindow()
self.SetSize(200, 300)
screen_width = wndMgr.GetScreenWidth()
screen_height = wndMgr.GetScreenHeight()
window_width = self.GetWidth()
window_height = self.GetHeight()
x_pos = (screen_width - window_width) / 2
y_pos = (screen_height - window_height) / 2
self.SetPosition(x_pos, y_pos)
self.Show()
Bu örnek kod parçası, ESC menüsünü ekranın tam ortasına yerleştirecektir.
Test Etme ve Uygulama
Değişiklikleri yaptıktan sonra sunucuyu başlatıp ESC menüsünü test edin. Menü artık ekranın ortasında görünmeli. Farklı çözünürlüklerde de test yapmanız önerilir. Bu sayede tüm oyuncular için uyumlu bir arayüz elde edersiniz.
Sonuç
Metin2 özel sunucularında kullanıcı dostu bir arayüz oluşturmak, oyuncuların uzun süre kalmasını sağlar. ESC menüsünün doğru konumda gözükmesi küçük bir detay gibi görünse de, genel kullanıcı deneyimi üzerinde büyük etkiye sahiptir. Bu küçük değişikliklerle hem profesyonel bir imaj oluşturabilir hem de oyuncularınızın oyun içi performansını artırabilirsiniz.
How to Center the Esc Menu in Files Where It Is Not Centered on Screen
While developing Metin2 private servers, you may encounter visual glitches. One of these issues is the escmenu.py file not being centered on the screen. This can negatively impact user experience. In this article, we will explain why the esc menu is not centered and how to fix it in detail.
What Is the Esc Menu?
In Metin2, the esc menu appears when players press the ESC key located at the bottom right corner. The menu contains important functions such as character information, inventory, item storage, and settings. Therefore, proper positioning enhances in-game usability.
What Causes the Problem?
In some custom UI files or different resolutions, the ESC menu might appear in the top-left corner or at random positions. This usually happens because the positioning parameters in the uiscript/escmenu.py file are set according to default resolution. If the game window is expanded or UI files are redesigned, the menu might not appear in the correct place.
Solution Steps
Firstly, open the uiscript/escmenu.py file. This file is typically in Py file (Python GUI) format and determines the positioning of UI elements. Follow the steps below to center the menu:
1. Check window dimensions: Ensure that SCREEN_WIDTH and SCREEN_HEIGHT values are correct. These values are generally set based on the game window's resolution.
2. Adjust window position: Use a structure like the following:
window.SetPosition((SCREEN_WIDTH - window.GetWidth()) / 2, (SCREEN_HEIGHT - window.GetHeight()) / 2)
This line ensures that the window is centered on the screen.
Necessary Changes in PyRoot Files
Additionally, ESC menu positioning might also occur in PyRoot files such as root/uitooltip.py or root/game.py. Similarly, centering adjustments must be made here as well. Especially if the window position is redefined in the OnUpdate function, this could cause the issue.
Example Code for Centered ESC Menu:
def OpenEscMenu(self):
self.__LoadWindow()
self.SetSize(200, 300)
screen_width = wndMgr.GetScreenWidth()
screen_height = wndMgr.GetScreenHeight()
window_width = self.GetWidth()
window_height = self.GetHeight()
x_pos = (screen_width - window_width) / 2
y_pos = (screen_height - window_height) / 2
self.SetPosition(x_pos, y_pos)
self.Show()
This code snippet will center the ESC menu on the screen.
Testing and Application
After making changes, start the server and test the ESC menu. The menu should now appear in the center of the screen. Testing across various resolutions is recommended to ensure compatibility for all players.
Conclusion
Creating a user-friendly interface in Metin2 private servers helps keep players engaged longer. Although placing the ESC menu correctly might seem like a minor detail, it significantly impacts overall user experience. With these small adjustments, you can create a professional appearance and improve your players' in-game performance.
Metin2 Esc Menüsü Ekrana Ortalanmamış Fileslerde Nasıl Ortalanır?
Metin2 özel sunucularında geliştirme yaparken bazı görsel hatalarla karşılaşabilirsiniz. Bunlardan birisi de escmenu.py dosyasının ekrana ortalanmamasıdır. Bu durum kullanıcı deneyimini olumsuz yönde etkileyebilir. Bu yazıda, esc menüsünün neden ortalanmadığını ve nasıl düzelteceğinizi detaylı olarak ele alacağız.
Esc Menüsü Nedir?
Metin2 oyununda oyuncu sağ alt köşedeki ESC tuşuna bastığında ekrana gelen menüdür. Bu menü; karakter bilgileri, envanter, eşya saklama, ayarlar gibi önemli fonksiyonları içerir. Bu nedenle doğru konumlandırılması oyun içi kullanıcı dostluğunu artırır.
Sorunun Kaynağı Nedir?
Bazı custom UI dosyalarında veya farklı çözünürlüklerde ESC menüsü ekranın sol üst köşesinde ya da rastgele bir konumda görünebilir. Bunun sebebi genellikle uiscript/escmenu.py dosyasındaki konumlandırma parametrelerinin varsayılan çözünürlüğe göre ayarlanmış olmasıdır. Eğer oyun penceresi genişletilmişse ya da UI dosyaları yeniden tasarlanmışsa menü doğru konumda gözükmeyebilir.
Çözüm Adımları
Öncelikle uiscript/escmenu.py dosyasını açın. Bu dosya genellikle Py file (Python GUI) formatındadır ve UI elementlerinin konumlarını belirler. Aşağıdaki adımları takip ederek menüyü ortalamayı sağlayabilirsiniz:
1. Pencere boyutlarını kontrol edin: SCREEN_WIDTH ve SCREEN_HEIGHT değerlerinin doğru olduğundan emin olun. Bu değerler genellikle oyun penceresinin çözünürlüğüne göre ayarlanır.
2. Window position ayarını değiştirin: Aşağıdaki gibi bir yapı kullanılır:
window.SetPosition((SCREEN_WIDTH - window.GetWidth()) / 2, (SCREEN_HEIGHT - window.GetHeight()) / 2)
Bu satır, pencerenin ekranın tam ortasında konumlandırılmasını sağlar.
PyRoot Dosyasında Gerekli Değişiklikler
Ayrıca, root/uitooltip.py veya root/game.py gibi PyRoot dosyalarında da ESC menüsü ile ilgili konumlandırma yapılır. Burada da benzer şekilde pencere ortalaması yapılması gerekir. Özellikle OnUpdate fonksiyonunda pencere pozisyonu tekrar tanımlanıyorsa, bu da soruna yol açabilir.
Ortalanmış ESC Menü Kod Örneği:
def OpenEscMenu(self):
self.__LoadWindow()
self.SetSize(200, 300)
screen_width = wndMgr.GetScreenWidth()
screen_height = wndMgr.GetScreenHeight()
window_width = self.GetWidth()
window_height = self.GetHeight()
x_pos = (screen_width - window_width) / 2
y_pos = (screen_height - window_height) / 2
self.SetPosition(x_pos, y_pos)
self.Show()
Bu örnek kod parçası, ESC menüsünü ekranın tam ortasına yerleştirecektir.
Test Etme ve Uygulama
Değişiklikleri yaptıktan sonra sunucuyu başlatıp ESC menüsünü test edin. Menü artık ekranın ortasında görünmeli. Farklı çözünürlüklerde de test yapmanız önerilir. Bu sayede tüm oyuncular için uyumlu bir arayüz elde edersiniz.
Sonuç
Metin2 özel sunucularında kullanıcı dostu bir arayüz oluşturmak, oyuncuların uzun süre kalmasını sağlar. ESC menüsünün doğru konumda gözükmesi küçük bir detay gibi görünse de, genel kullanıcı deneyimi üzerinde büyük etkiye sahiptir. Bu küçük değişikliklerle hem profesyonel bir imaj oluşturabilir hem de oyuncularınızın oyun içi performansını artırabilirsiniz.
How to Center the Esc Menu in Files Where It Is Not Centered on Screen
While developing Metin2 private servers, you may encounter visual glitches. One of these issues is the escmenu.py file not being centered on the screen. This can negatively impact user experience. In this article, we will explain why the esc menu is not centered and how to fix it in detail.
What Is the Esc Menu?
In Metin2, the esc menu appears when players press the ESC key located at the bottom right corner. The menu contains important functions such as character information, inventory, item storage, and settings. Therefore, proper positioning enhances in-game usability.
What Causes the Problem?
In some custom UI files or different resolutions, the ESC menu might appear in the top-left corner or at random positions. This usually happens because the positioning parameters in the uiscript/escmenu.py file are set according to default resolution. If the game window is expanded or UI files are redesigned, the menu might not appear in the correct place.
Solution Steps
Firstly, open the uiscript/escmenu.py file. This file is typically in Py file (Python GUI) format and determines the positioning of UI elements. Follow the steps below to center the menu:
1. Check window dimensions: Ensure that SCREEN_WIDTH and SCREEN_HEIGHT values are correct. These values are generally set based on the game window's resolution.
2. Adjust window position: Use a structure like the following:
window.SetPosition((SCREEN_WIDTH - window.GetWidth()) / 2, (SCREEN_HEIGHT - window.GetHeight()) / 2)
This line ensures that the window is centered on the screen.
Necessary Changes in PyRoot Files
Additionally, ESC menu positioning might also occur in PyRoot files such as root/uitooltip.py or root/game.py. Similarly, centering adjustments must be made here as well. Especially if the window position is redefined in the OnUpdate function, this could cause the issue.
Example Code for Centered ESC Menu:
def OpenEscMenu(self):
self.__LoadWindow()
self.SetSize(200, 300)
screen_width = wndMgr.GetScreenWidth()
screen_height = wndMgr.GetScreenHeight()
window_width = self.GetWidth()
window_height = self.GetHeight()
x_pos = (screen_width - window_width) / 2
y_pos = (screen_height - window_height) / 2
self.SetPosition(x_pos, y_pos)
self.Show()
This code snippet will center the ESC menu on the screen.
Testing and Application
After making changes, start the server and test the ESC menu. The menu should now appear in the center of the screen. Testing across various resolutions is recommended to ensure compatibility for all players.
Conclusion
Creating a user-friendly interface in Metin2 private servers helps keep players engaged longer. Although placing the ESC menu correctly might seem like a minor detail, it significantly impacts overall user experience. With these small adjustments, you can create a professional appearance and improve your players' in-game performance.
