Conversation
The door sprite can now be flipped horizontally with the use of the "flip_horizontal" Boolean. This affects only the visuals, not the collision shape as requested. Resolves endlessm#2836
|
|
||
|
|
||
| func update_door_flip() -> void: | ||
| %DoorOpened.flip_h = flip_horizontal |
| if flip_horizontal: | ||
| %DoorOpened.position.x = -abs(%DoorOpened.position.x) | ||
| else: | ||
| $DoorOpened.position.x = abs(%DoorOpened.position.x) |
There was a problem hiding this comment.
Nice! In other components of the game we change the scaling to -1 for flippling all the visuals. You could do the same by adding all the visuals (door opened and closed Sprite2Ds) to a parent Node2D with position Vector2.ZERO. But I think this works fine!
func _set_look_at_side(new_look_at_side: Enums.LookAtSide) -> void:
look_at_side = new_look_at_side
scale.x = -1 if look_at_side == Enums.LookAtSide.RIGHT else 1
|
|
||
|
|
||
| func update_door_flip() -> void: | ||
| %DoorOpened.flip_h = flip_horizontal | ||
|
|
There was a problem hiding this comment.
| func update_door_flip() -> void: | |
| %DoorOpened.flip_h = flip_horizontal | |
| func update_door_flip() -> void: | |
| %DoorOpened.flip_h = flip_horizontal | |
|
Test build no longer available. |
|
@BFoster-BF thanks for your contribution! This time I applied a few format fixes regarding white space, and changed a Also I did a small change in the pull request description (moving "Resolves..." to a new line). You may want to check this section in the same page as above for your next contribution. Thanks! |
|
I created a followup ticket for actually testing this in a demo level: #2949 |
The door sprite can now be flipped horizontally with the use of the "flip_horizontal" Boolean. This affects only the visuals, not the collision shape as requested.
Resolves #2836