|
55 | 55 | <return type="void" /> |
56 | 56 | <param index="0" name="viewport_control" type="Control" /> |
57 | 57 | <description> |
58 | | - Called by the engine when the 3D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. |
| 58 | + Called by the engine when the 3D editor's viewport is updated. [param viewport_control] is an overlay on top of the viewport and it can be used for drawing. You can update the viewport manually by calling [method update_overlays]. |
59 | 59 | [codeblocks] |
60 | 60 | [gdscript] |
61 | 61 | func _forward_3d_draw_over_viewport(overlay): |
62 | | - # Draw a circle at cursor position. |
| 62 | + # Draw a circle at the cursor's position. |
63 | 63 | overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.WHITE) |
64 | 64 |
|
65 | 65 | func _forward_3d_gui_input(camera, event): |
66 | 66 | if event is InputEventMouseMotion: |
67 | | - # Redraw viewport when cursor is moved. |
| 67 | + # Redraw the viewport when the cursor is moved. |
68 | 68 | update_overlays() |
69 | 69 | return EditorPlugin.AFTER_GUI_INPUT_STOP |
70 | 70 | return EditorPlugin.AFTER_GUI_INPUT_PASS |
71 | 71 | [/gdscript] |
72 | 72 | [csharp] |
73 | 73 | public override void _Forward3DDrawOverViewport(Control viewportControl) |
74 | 74 | { |
75 | | - // Draw a circle at cursor position. |
| 75 | + // Draw a circle at the cursor's position. |
76 | 76 | viewportControl.DrawCircle(viewportControl.GetLocalMousePosition(), 64, Colors.White); |
77 | 77 | } |
78 | 78 |
|
79 | 79 | public override EditorPlugin.AfterGuiInput _Forward3DGuiInput(Camera3D viewportCamera, InputEvent @event) |
80 | 80 | { |
81 | 81 | if (@event is InputEventMouseMotion) |
82 | 82 | { |
83 | | - // Redraw viewport when cursor is moved. |
| 83 | + // Redraw the viewport when the cursor is moved. |
84 | 84 | UpdateOverlays(); |
85 | 85 | return EditorPlugin.AfterGuiInput.Stop; |
86 | 86 | } |
|
139 | 139 | <return type="void" /> |
140 | 140 | <param index="0" name="viewport_control" type="Control" /> |
141 | 141 | <description> |
142 | | - Called by the engine when the 2D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. |
| 142 | + Called by the engine when the 2D editor's viewport is updated. [param viewport_control] is an overlay on top of the viewport and it can be used for drawing. You can update the viewport manually by calling [method update_overlays]. |
143 | 143 | [codeblocks] |
144 | 144 | [gdscript] |
145 | 145 | func _forward_canvas_draw_over_viewport(overlay): |
146 | | - # Draw a circle at cursor position. |
| 146 | + # Draw a circle at the cursor's position. |
147 | 147 | overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.WHITE) |
148 | 148 |
|
149 | 149 | func _forward_canvas_gui_input(event): |
150 | 150 | if event is InputEventMouseMotion: |
151 | | - # Redraw viewport when cursor is moved. |
| 151 | + # Redraw the viewport when the cursor is moved. |
152 | 152 | update_overlays() |
153 | 153 | return true |
154 | 154 | return false |
155 | 155 | [/gdscript] |
156 | 156 | [csharp] |
157 | 157 | public override void _ForwardCanvasDrawOverViewport(Control viewportControl) |
158 | 158 | { |
159 | | - // Draw a circle at cursor position. |
| 159 | + // Draw a circle at the cursor's position. |
160 | 160 | viewportControl.DrawCircle(viewportControl.GetLocalMousePosition(), 64, Colors.White); |
161 | 161 | } |
162 | 162 |
|
163 | 163 | public override bool _ForwardCanvasGuiInput(InputEvent @event) |
164 | 164 | { |
165 | 165 | if (@event is InputEventMouseMotion) |
166 | 166 | { |
167 | | - // Redraw viewport when cursor is moved. |
| 167 | + // Redraw the viewport when the cursor is moved. |
168 | 168 | UpdateOverlays(); |
169 | 169 | return true; |
170 | 170 | } |
|
0 commit comments