ProCam2D for Godot 4.x's icon

ProCam2D for Godot 4.x 0.2 2D Tools 4.2 Community

Submitted by user kalulu_games; MIT; 2024-06-24

ProCam2D Plugin

Overview

ProCam2D is the ultimate camera plugin for your 2D game needs. It offers precise control over camera behavior, featuring smooth movement, dynamic zoom, and exciting screen shake effects. ProCam2D adds two types of nodes to the scene tree: ProCam2D (the camera) and PCTrackPoint (point that will be tracked if ProCam.track_multiple_objects = true), as well as an Autoload script to control the camera efficiently.

Features

- Target-based tracking: Dynamic switching with smooth transitions.
- Screen shake effects: Multiple types, including horizontal, vertical, Perlin noise, random, zoom, rotate, and circular.
- Drag and rotation controls: Flexible drag types and smooth rotation.
- Zoom and boundary limits: Adjustable zoom with smooth transitions and boundary constraints.
- Multi-object tracking: Track multiple objects with adjustable radius.
- Efficient control: Managed by a singleton named ProCam.

Example Usage

# Change camera target
ProCam.target = $Player

# Soothly change camera target
ProCam.drag_smoothly = true
ProCam.target = $Player

#Start a screen shake effect
ProCam.start_shake([ProCam.SCREEN_SHAKE_HORIZONTAL], 0.5, 3.0, 20.0)

#Smoothly zoom in
ProCam.zoom_smoothly = true
ProCam.zoom_speed = 1.0
ProCam.zoom_level = 0.75

#Apply a random screen shake and zoom shake effect
var types = [ProCam.SCREEN_SHAKE_RANDOM, ProCam.SCREEN_SHAKE_ZOOM]
var duration = 0.5
var magnitude = 4.0
var speed = 25.0
ProCam.start_shake(types, duration, magnitude, speed)

#Enable rotation and set rotation speed
ProCam.rotate = true
ProCam.rotation_speed = 2.0

#Smoothly change the offset
ProCam.offset_smoothly = true
ProCam.offset = Vector2(50, 50)
ProCam.offset_speed = 0.5

#Zoom out when the player dies
func on_player_died():
ProCam.zoom_smoothly = true
ProCam.zoom_speed = 0.5
ProCam.zoom_level = 2.0

#Apply a horizontal screen shake effect during an earthquake
func on_earthquake():
var types = [ProCam.SCREEN_SHAKE_HORIZONTAL]
var duration = 1.0
var magnitude = 2.5
var speed = 15.0
ProCam.start_shake(types, duration, magnitude, speed)

More Information

For installation instructions and full documentation, a more recent release or to support the development of this plug-in, check out the repository on GitHub: https://github.com/daz-b-like/ProCam2D_Godot4.x


View files Download Submit an issue Recent Edits