🖼️ Godot Image Sharing Network
A real-time image sharing application built with Godot Engine using networking capabilities. Users can host or join sessions to share images instantly across the network.
🎯 Features
- Host/Client Architecture: Create or join image sharing sessions
- Real-time Image Transmission: Share PNG and JPG images instantly
- Automatic Image Scaling: Smart resizing to fit display area
- Network Multiplayer: Built on Godot’s ENet multiplayer system
- User-friendly Interface: Simple UI for seamless experience
🛠️ Technical Details
Core Components
- Node Structure: Extends Node2D for scene management
- Networking: ENetMultiplayerPeer for reliable connections
- File Handling: FileAccess for image loading
- RPC System: Remote procedure calls for image transmission
Supported Formats
- PNG Images
- JPG/JPEG Images
📋 Requirements
- Godot Engine 4.0 or higher
- Network connection (local or internet)
file_dialog.tscnscene file
🚀 Installation
-
Clone this repository:
git clone https://github.com/your-username/godot-image-sharing.git -
Open the project in Godot Engine
-
Ensure
file_dialog.tscnis present in your project root -
Run the project
🎮 Usage
Host a Session
- Click the “Host” button
- Server will start on port 1500
- Wait for clients to connect
- Start sharing images!
Join a Session
- Click the “Client” button
- Connects to localhost:1500
- Begin receiving and sending images
Share Images
- Click the “Send” button
- Select an image file (PNG/JPG)
- Image will be shared with all connected users
📁 Project Structure
project/
├── main.gd # Main script (this file)
├── file_dialog.tscn # File dialog scene
└── README.md # This documentation
🔧 Code Overview
Key Functions
_ready(): Initializes file dialog and connectionson_host_button_pressed(): Sets up serveron_client_button_pressed(): Connects to serversend_image(): RPC function for image transmissiontexture_size_change(): Handles image scalingon_file_chosen(): Processes selected image files
Network Configuration
- Port: 1500
- Host: localhost (can be modified)
- Protocol: ENet (reliable UDP)
🎨 UI Components
The interface includes:
- VBoxContainerImage: Main container
- Label: Status display
- TextureRect: Image display area
- Buttons: Host, Client, Send actions
⚙️ Configuration
Changing Network Settings
# Modify port
peer.create_server(YOUR_PORT) # Host
peer.create_client("YOUR_IP", YOUR_PORT) # Client
Adjusting Image Size Limits
# In texture_size_change function
var max_width := 800 # Modify as needed
var max_height := 600 # Modify as needed
🐛 Troubleshooting
Common Issues
- Connection Failed: Check firewall settings and network connectivity
- Images Not Loading: Verify file format (PNG/JPG only)
- Performance Issues: Consider reducing max image dimensions
Debug Tips
- Check Godot’s remote debugger for network status
- Monitor console output for connection logs
- Verify file permissions for image access
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🖼️ Godot Resim Paylaşım Ağı
Godot Engine ile geliştirilmiş gerçek zamanlı resim paylaşım uygulaması. Kullanıcılar oturum başlatabilir veya katılabilir ve ağ üzerinden anında resim paylaşabilir.
🎯 Özellikler
- Host/Client Mimarisi: Resim paylaşım oturumları oluşturun veya katılın
- Gerçek Zamanlı Resim Aktarımı: PNG ve JPG resimlerini anında paylaşın
- Otomatik Resim Ölçeklendirme: Görüntüleme alanına uyacak şekilde akıllı boyutlandırma
- Ağ Çok Oyunculu: Godot’un ENet multiplayer sistemi üzerine kurulu
- Kullanıcı Dostu Arayüz: Sorunsuz deneyim için basit UI
🛠️ Teknik Detaylar
Ana Bileşenler
- Node Yapısı: Sahne yönetimi için Node2D’yi genişletir
- Ağ İletişimi: Güvenilir bağlantılar için ENetMultiplayerPeer
- Dosya İşleme: Resim yükleme için FileAccess
- RPC Sistemi: Resim aktarımı için uzaktan prosedür çağrıları
Desteklenen Formatlar
- PNG Resimleri
- JPG/JPEG Resimleri
📋 Gereksinimler
- Godot Engine 4.0 veya üzeri
- Ağ bağlantısı (yerel veya internet)
file_dialog.tscnsahne dosyası
🚀 Kurulum
-
Bu repository’yi klonlayın:
git clone https://github.com/kullanici-adi/godot-resim-paylasim.git -
Projeyi Godot Engine’de açın
-
file_dialog.tscndosyasının proje kök dizininde bulunduğundan emin olun -
Projeyi çalıştırın
🎮 Kullanım
Oturum Başlatma
- “Host” butonuna tıklayın
- Sunucu 1500 portunda başlayacak
- Clientların bağlanmasını bekleyin
- Resim paylaşmaya başlayın!
Oturuma Katılma
- “Client” butonuna tıklayın
- localhost:1500’e bağlanır
- Resim almaya ve göndermeye başlayın
Resim Paylaşma
- “Send” butonuna tıklayın
- Bir resim dosyası seçin (PNG/JPG)
- Resim tüm bağlı kullanıcılarla paylaşılacak
📁 Proje Yapısı
proje/
├── main.gd # Ana script (bu dosya)
├── file_dialog.tscn # Dosya dialog sahnesi
└── README.md # Bu dokümantasyon
🔧 Kod Genel Bakış
Anahtar Fonksiyonlar
_ready(): Dosya dialogu ve bağlantıları başlatıron_host_button_pressed(): Sunucuyu kuraron_client_button_pressed(): Sunucuya bağlanırsend_image(): Resim aktarımı için RPC fonksiyonutexture_size_change(): Resim ölçeklendirmeyi yönetiron_file_chosen(): Seçilen resim dosyalarını işler
Ağ Yapılandırması
- Port: 1500
- Host: localhost (değiştirilebilir)
- Protokol: ENet (güvenilir UDP)
🎨 UI Bileşenleri
Arayüz şunları içerir:
- VBoxContainerImage: Ana konteyner
- Label: Durum göstergesi
- TextureRect: Resim görüntüleme alanı
- Butonlar: Host, Client, Send işlemleri
⚙️ Yapılandırma
Ağ Ayarlarını Değiştirme
# Portu değiştirme
peer.create_server(SIZIN_PORTUNUZ) # Host
peer.create_client("SIZIN_IP_ADRESINIZ", SIZIN_PORTUNUZ) # Client
Resim Boyutu Sınırlarını Ayarlama
# texture_size_change fonksiyonunda
var max_width := 800 # İhtiyaca göre değiştirin
var max_height := 600 # İhtiyaca göre değiştirin
🐛 Sorun Giderme
Yaygın Sorunlar
- Bağlantı Başarısız: Güvenlik duvarı ayarları ve ağ bağlantısını kontrol edin
- Resimler Yüklenmiyor: Dosya formatını doğrulayın (sadece PNG/JPG)
- Performans Sorunları: Maksimum resim boyutlarını azaltmayı düşünün
Hata Ayıklama İpuçları
- Ağ durumu için Godot’un uzaktan hata ayıklayıcısını kontrol edin
- Bağlantı logları için konsol çıktısını izleyin
- Resim erişimi için dosya izinlerini doğrulayın
🤝 Katkıda Bulunma
- Repository’yi fork edin
- Özellik branch’i oluşturun
- Değişikliklerinizi yapın
- Pull request gönderin