Posts

Showing posts with the label screen

[GODOT] Animate camera depending on touch screen events (C#)

Image
If you develop a 2D game for mobile, like a RPG game seen from top (Zelda like for instance), and you want to navigate on your map just by dragging the screen, here is the simple way to implement it in GODOT. In your level scene you have to add a "Camera" Node and make it the current one: public override void _Ready() { // Ensure the camera is set as current Current = true; } Then create the associated Camera script (in this example in C#). You have to handle Godot input events to animate the camera. The events to manage are: - InputEventScreenTouch - InputEventScreenDrag The goal is to determinate the delta amount of  horizontal & vertical spaces that have been dragged by the user. You can see an example of handling these events in the following code snippet (camera script):  using Godot; using System; public partial class camera : Camera2D { private Vector2 _touchStartPosition = new Vector2(); private bool _isDragging = false; // Call

[Flutter] Splashscreen (native way)

Image
The splash screen is the first screen you see when you start your app. - you can display your logo for instance - and while the splash screen is shown,  your application is loaded (like user data, business data...) In this example we will use flutter_native_splash package. I- Package: flutter_native_splash (for native splash screen) In your " pubspec.yaml " file you have to add the correct dependency, here at less version 2.0.5 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions # consider running `flutter pub upgrade --major-versions`. Alternatively, # dependencies can be manually updated by changing the version numbers below to # the latest version available on pub.dev. To see which dependencies have newer # versions available, run `flutter pub outdated`. dependencies : flutter : sdk : flutter flutter_native_splash : ^2.0.5 hint : Pubspec Assist extension To auto