[SOLVED] How do I set a static background from an already existing image in a 2D game ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Jacottin

Hello, I’m fairly new to Godot Engine. Or creating games. Or programming actually

I’m trying to make an RPG Undertale-like game and starting with only two simple “levels” but I don’t know how to set a background. I’ve created one with photoshop but how to import it in my project so it just fills the screen without moving while my character evolves in it ?

This question may have been asked but I browsed a lot of QA and didn’t find it/or I didn’t know the terms for it (again, totally newbie AND not native english speaker)

Thank for your time

:bust_in_silhouette: Reply From: p7f

Try with ParallaxBackground ad a child of the root node on your scene. You can set an image to it and it will always be fixed relative to screen. If you want diferent backgrounds move at different speed to create a depth feeling, use a ParallaxLayer for each image all as child of ParallaxBackground, and set different motion_scale om each one. The scale motion_scale sets how fast that background moves relative to camera movement. If you set 0.1 in x scale, when camera moves 10px, background will move 1. This video from heartbeast should help.

Thanks a lot, it works perfectly !

Jacottin | 2019-01-14 10:58

Glad to help! Would you then select my answer so others find quickly the answer?

p7f | 2019-01-14 11:00

1 Like