mirror of
https://github.com/godotengine/godot.git
synced 2025-01-30 21:33:18 +08:00
parent
b3ff7ca62e
commit
99617ae8dc
@ -34,6 +34,9 @@
|
|||||||
|
|
||||||
void ParallaxLayer::set_motion_scale(const Size2 &p_scale) {
|
void ParallaxLayer::set_motion_scale(const Size2 &p_scale) {
|
||||||
|
|
||||||
|
if (!get_parent())
|
||||||
|
return;
|
||||||
|
|
||||||
motion_scale = p_scale;
|
motion_scale = p_scale;
|
||||||
|
|
||||||
ParallaxBackground *pb = get_parent()->cast_to<ParallaxBackground>();
|
ParallaxBackground *pb = get_parent()->cast_to<ParallaxBackground>();
|
||||||
@ -51,6 +54,9 @@ Size2 ParallaxLayer::get_motion_scale() const {
|
|||||||
|
|
||||||
void ParallaxLayer::set_motion_offset(const Size2 &p_offset) {
|
void ParallaxLayer::set_motion_offset(const Size2 &p_offset) {
|
||||||
|
|
||||||
|
if (!get_parent())
|
||||||
|
return;
|
||||||
|
|
||||||
motion_offset = p_offset;
|
motion_offset = p_offset;
|
||||||
|
|
||||||
ParallaxBackground *pb = get_parent()->cast_to<ParallaxBackground>();
|
ParallaxBackground *pb = get_parent()->cast_to<ParallaxBackground>();
|
||||||
|
Loading…
Reference in New Issue
Block a user