mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-05 10:09:47 +03:00
updated viewport clearing
This change is needed in order to make use of the new introduced set_clear_mode() function (I think the choosen enum value is ok since its needed only once). Updated in the following demos: - 2D_in_3D - 3D_in_2D - screen_capture
This commit is contained in:
@@ -3,7 +3,7 @@ extends Spatial
|
||||
func _ready():
|
||||
# Get the viewport and clear it
|
||||
var viewport = get_node("Viewport")
|
||||
viewport.clear()
|
||||
viewport.set_clear_mode(Viewport.CLEAR_MODE_ONLY_NEXT_FRAME)
|
||||
# Let two frames pass to make sure the vieport's is captured
|
||||
yield(get_tree(), "idle_frame")
|
||||
yield(get_tree(), "idle_frame")
|
||||
|
||||
@@ -16,7 +16,7 @@ func _ready():
|
||||
viewport_sprite = get_node("Viewport_Sprite")
|
||||
|
||||
# Assign the sprite's texture to the viewport texture
|
||||
viewport.clear()
|
||||
viewport.set_clear_mode(Viewport.CLEAR_MODE_ONLY_NEXT_FRAME)
|
||||
# Let two frames pass to make sure the screen was captured
|
||||
yield(get_tree(), "idle_frame")
|
||||
yield(get_tree(), "idle_frame")
|
||||
|
||||
@@ -7,7 +7,7 @@ func _ready():
|
||||
|
||||
|
||||
func _on_button_pressed():
|
||||
get_viewport().clear()
|
||||
get_viewport().set_clear_mode(Viewport.CLEAR_MODE_ONLY_NEXT_FRAME)
|
||||
# Let two frames pass to make sure the screen was captured
|
||||
yield(get_tree(), "idle_frame")
|
||||
yield(get_tree(), "idle_frame")
|
||||
|
||||
Reference in New Issue
Block a user