diff options
Diffstat (limited to 'demos/viewport')
27 files changed, 0 insertions, 167 deletions
diff --git a/demos/viewport/2d_in_3d/ball.png b/demos/viewport/2d_in_3d/ball.png Binary files differdeleted file mode 100644 index c0f6da4f6f..0000000000 --- a/demos/viewport/2d_in_3d/ball.png +++ /dev/null diff --git a/demos/viewport/2d_in_3d/engine.cfg b/demos/viewport/2d_in_3d/engine.cfg deleted file mode 100644 index fc586dcaf3..0000000000 --- a/demos/viewport/2d_in_3d/engine.cfg +++ /dev/null @@ -1,22 +0,0 @@ -[application] - -name="Pong 2D in 3D" -main_scene="res://pong3d.scn" -icon="res://icon.png" - -[display] - -width=640 -height=400 -stretch_2d=true - -[input] - -left_move_up=[key(A)] -left_move_down=[key(Z)] -right_move_up=[key(Up)] -right_move_down=[key(Down)] - -[render] - -default_clear_color=#ff000000 diff --git a/demos/viewport/2d_in_3d/icon.png b/demos/viewport/2d_in_3d/icon.png Binary files differdeleted file mode 100644 index eab34de53d..0000000000 --- a/demos/viewport/2d_in_3d/icon.png +++ /dev/null diff --git a/demos/viewport/2d_in_3d/left_pallete.png b/demos/viewport/2d_in_3d/left_pallete.png Binary files differdeleted file mode 100644 index f0d4b549d0..0000000000 --- a/demos/viewport/2d_in_3d/left_pallete.png +++ /dev/null diff --git a/demos/viewport/2d_in_3d/pong.gd b/demos/viewport/2d_in_3d/pong.gd deleted file mode 100644 index ac3457453b..0000000000 --- a/demos/viewport/2d_in_3d/pong.gd +++ /dev/null @@ -1,66 +0,0 @@ - -extends Node2D - -# Member variables -const INITIAL_BALL_SPEED = 80 -var ball_speed = INITIAL_BALL_SPEED -var screen_size = Vector2(640, 400) -# Default ball direction -var direction = Vector2(-1, 0) -var pad_size = Vector2(8, 32) -const PAD_SPEED = 150 - - -func _process(delta): - # Get ball position and pad rectangles - var ball_pos = get_node("ball").get_pos() - var left_rect = Rect2(get_node("left").get_pos() - pad_size*0.5, pad_size) - var right_rect = Rect2(get_node("right").get_pos() - pad_size*0.5, pad_size) - - # Integrate new ball postion - ball_pos += direction*ball_speed*delta - - # Flip when touching roof or floor - if ((ball_pos.y < 0 and direction.y < 0) or (ball_pos.y > screen_size.y and direction.y > 0)): - direction.y = -direction.y - - # Flip, change direction and increase speed when touching pads - if ((left_rect.has_point(ball_pos) and direction.x < 0) or (right_rect.has_point(ball_pos) and direction.x > 0)): - direction.x = -direction.x - ball_speed *= 1.1 - direction.y = randf()*2.0 - 1 - direction = direction.normalized() - - # Check gameover - if (ball_pos.x < 0 or ball_pos.x > screen_size.x): - ball_pos = screen_size*0.5 - ball_speed = INITIAL_BALL_SPEED - direction = Vector2(-1, 0) - - get_node("ball").set_pos(ball_pos) - - # Move left pad - var left_pos = get_node("left").get_pos() - - if (left_pos.y > 0 and Input.is_action_pressed("left_move_up")): - left_pos.y += -PAD_SPEED*delta - if (left_pos.y < screen_size.y and Input.is_action_pressed("left_move_down")): - left_pos.y += PAD_SPEED*delta - - get_node("left").set_pos(left_pos) - - # Move right pad - var right_pos = get_node("right").get_pos() - - if (right_pos.y > 0 and Input.is_action_pressed("right_move_up")): - right_pos.y += -PAD_SPEED*delta - if (right_pos.y < screen_size.y and Input.is_action_pressed("right_move_down")): - right_pos.y += PAD_SPEED*delta - - get_node("right").set_pos(right_pos) - - -func _ready(): - screen_size = get_viewport_rect().size # Get actual size - pad_size = get_node("left").get_texture().get_size() - set_process(true) diff --git a/demos/viewport/2d_in_3d/pong.scn b/demos/viewport/2d_in_3d/pong.scn Binary files differdeleted file mode 100644 index 559e2f96bc..0000000000 --- a/demos/viewport/2d_in_3d/pong.scn +++ /dev/null diff --git a/demos/viewport/2d_in_3d/pong3d.gd b/demos/viewport/2d_in_3d/pong3d.gd deleted file mode 100644 index 79a7a36801..0000000000 --- a/demos/viewport/2d_in_3d/pong3d.gd +++ /dev/null @@ -1,7 +0,0 @@ - -extends Spatial - - -func _ready(): - var tex = get_node("Viewport").get_render_target_texture() - get_node("Quad").get_material_override().set_texture(FixedMaterial.PARAM_DIFFUSE, tex) diff --git a/demos/viewport/2d_in_3d/pong3d.scn b/demos/viewport/2d_in_3d/pong3d.scn Binary files differdeleted file mode 100644 index 2e60764a88..0000000000 --- a/demos/viewport/2d_in_3d/pong3d.scn +++ /dev/null diff --git a/demos/viewport/2d_in_3d/right_pallete.png b/demos/viewport/2d_in_3d/right_pallete.png Binary files differdeleted file mode 100644 index 3cdb673a5b..0000000000 --- a/demos/viewport/2d_in_3d/right_pallete.png +++ /dev/null diff --git a/demos/viewport/2d_in_3d/separator.png b/demos/viewport/2d_in_3d/separator.png Binary files differdeleted file mode 100644 index 56874a59cb..0000000000 --- a/demos/viewport/2d_in_3d/separator.png +++ /dev/null diff --git a/demos/viewport/3d_in_2d/engine.cfg b/demos/viewport/3d_in_2d/engine.cfg deleted file mode 100644 index 6d456d7bd4..0000000000 --- a/demos/viewport/3d_in_2d/engine.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[application] - -name="3D in 2D" -main_scene="res://main.scn" -icon="res://icon.png" diff --git a/demos/viewport/3d_in_2d/icon.png b/demos/viewport/3d_in_2d/icon.png Binary files differdeleted file mode 100644 index d8a332c18f..0000000000 --- a/demos/viewport/3d_in_2d/icon.png +++ /dev/null diff --git a/demos/viewport/3d_in_2d/main.scn b/demos/viewport/3d_in_2d/main.scn Binary files differdeleted file mode 100644 index d6c4deea42..0000000000 --- a/demos/viewport/3d_in_2d/main.scn +++ /dev/null diff --git a/demos/viewport/3d_in_2d/player.scn b/demos/viewport/3d_in_2d/player.scn Binary files differdeleted file mode 100644 index 7f490237fb..0000000000 --- a/demos/viewport/3d_in_2d/player.scn +++ /dev/null diff --git a/demos/viewport/3d_in_2d/player_2d.scn b/demos/viewport/3d_in_2d/player_2d.scn Binary files differdeleted file mode 100644 index edb6c080c1..0000000000 --- a/demos/viewport/3d_in_2d/player_2d.scn +++ /dev/null diff --git a/demos/viewport/3d_in_2d/player_3d.scn b/demos/viewport/3d_in_2d/player_3d.scn Binary files differdeleted file mode 100644 index c8bba5e460..0000000000 --- a/demos/viewport/3d_in_2d/player_3d.scn +++ /dev/null diff --git a/demos/viewport/3d_in_2d/robot_demo.png b/demos/viewport/3d_in_2d/robot_demo.png Binary files differdeleted file mode 100644 index bba8c63874..0000000000 --- a/demos/viewport/3d_in_2d/robot_demo.png +++ /dev/null diff --git a/demos/viewport/gui_in_3d/engine.cfg b/demos/viewport/gui_in_3d/engine.cfg deleted file mode 100644 index 252e53ca33..0000000000 --- a/demos/viewport/gui_in_3d/engine.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[application] - -name="GUI in 3D" -main_scene="res://gui_3d.scn" -icon="res://icon.png" diff --git a/demos/viewport/gui_in_3d/gui.scn b/demos/viewport/gui_in_3d/gui.scn Binary files differdeleted file mode 100644 index d7daa30340..0000000000 --- a/demos/viewport/gui_in_3d/gui.scn +++ /dev/null diff --git a/demos/viewport/gui_in_3d/gui_3d.gd b/demos/viewport/gui_in_3d/gui_3d.gd deleted file mode 100644 index b93c17521d..0000000000 --- a/demos/viewport/gui_in_3d/gui_3d.gd +++ /dev/null @@ -1,37 +0,0 @@ - -extends Spatial - -# Member variables -var prev_pos = null - - -func _input(event): - # All other (non-mouse) events - if (not event.type in [InputEvent.MOUSE_BUTTON, InputEvent.MOUSE_MOTION, InputEvent.SCREEN_DRAG, InputEvent.SCREEN_TOUCH]): - get_node("viewport").input(event) - - -# Mouse events for Area -func _on_area_input_event(camera, event, click_pos, click_normal, shape_idx): - # Use click pos (click in 3d space, convert to area space) - var pos = get_node("area").get_global_transform().affine_inverse()*click_pos - # Convert to 2D - pos = Vector2(pos.x, pos.y) - # Convert to viewport coordinate system - pos.x = (pos.x + 1.5)*100 - pos.y = (-pos.y + 0.75)*100 - # Set to event - event.pos = pos - event.global_pos = pos - if (prev_pos == null): - prev_pos = pos - if (event.type == InputEvent.MOUSE_MOTION): - event.relative_pos = pos - prev_pos - prev_pos = pos - # Send the event to the viewport - get_node("viewport").input(event) - - -func _ready(): - get_node("area/quad").get_material_override().set_texture(FixedMaterial.PARAM_DIFFUSE, get_node("viewport").get_render_target_texture()) - set_process_input(true) diff --git a/demos/viewport/gui_in_3d/gui_3d.scn b/demos/viewport/gui_in_3d/gui_3d.scn Binary files differdeleted file mode 100644 index 0541e7b142..0000000000 --- a/demos/viewport/gui_in_3d/gui_3d.scn +++ /dev/null diff --git a/demos/viewport/gui_in_3d/icon.png b/demos/viewport/gui_in_3d/icon.png Binary files differdeleted file mode 100644 index 22bdd791bb..0000000000 --- a/demos/viewport/gui_in_3d/icon.png +++ /dev/null diff --git a/demos/viewport/screen_capture/engine.cfg b/demos/viewport/screen_capture/engine.cfg deleted file mode 100644 index a843242720..0000000000 --- a/demos/viewport/screen_capture/engine.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[application] - -name="Screen Capturing" -main_scene="res://screen_capture.scn" -icon="res://icon.png" - -[display] - -stretch_mode="2d" diff --git a/demos/viewport/screen_capture/icon.png b/demos/viewport/screen_capture/icon.png Binary files differdeleted file mode 100644 index a696824775..0000000000 --- a/demos/viewport/screen_capture/icon.png +++ /dev/null diff --git a/demos/viewport/screen_capture/mountains.png b/demos/viewport/screen_capture/mountains.png Binary files differdeleted file mode 100644 index b8435bb1a8..0000000000 --- a/demos/viewport/screen_capture/mountains.png +++ /dev/null diff --git a/demos/viewport/screen_capture/screen_capture.gd b/demos/viewport/screen_capture/screen_capture.gd deleted file mode 100644 index 9867d95452..0000000000 --- a/demos/viewport/screen_capture/screen_capture.gd +++ /dev/null @@ -1,16 +0,0 @@ - -extends Control - - -func _on_button_pressed(): - get_viewport().queue_screen_capture() - # Let two frames pass to make sure the screen was captured - yield(get_tree(), "idle_frame") - yield(get_tree(), "idle_frame") - # Retrieve the captured image - var img = get_viewport().get_screen_capture() - # Create a texture for it - var tex = ImageTexture.new() - tex.create_from_image(img) - # Set it to the capture node - get_node("capture").set_texture(tex) diff --git a/demos/viewport/screen_capture/screen_capture.scn b/demos/viewport/screen_capture/screen_capture.scn Binary files differdeleted file mode 100644 index ee847fbe62..0000000000 --- a/demos/viewport/screen_capture/screen_capture.scn +++ /dev/null |