zoom
This commit is contained in:
@@ -24,4 +24,20 @@ public partial class Camera : Camera2D
|
|||||||
{
|
{
|
||||||
Position += _direction * CameraSpeed * (float)delta;
|
Position += _direction * CameraSpeed * (float)delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void _UnhandledInput(InputEvent @event)
|
||||||
|
{
|
||||||
|
using (@event)
|
||||||
|
{
|
||||||
|
if (@event is InputEventMouseButton { ButtonIndex: MouseButton.WheelDown })
|
||||||
|
{
|
||||||
|
Zoom /= 1.1f;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (@event is InputEventMouseButton { ButtonIndex: MouseButton.WheelUp })
|
||||||
|
{
|
||||||
|
Zoom *= 1.1f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,11 @@ public partial class Nodule : Node2D
|
|||||||
{
|
{
|
||||||
using (@event)
|
using (@event)
|
||||||
{
|
{
|
||||||
if (@event is InputEventMouseButton && @event.IsPressed() && _mouseInsideClickArea)
|
if (
|
||||||
|
@event is InputEventMouseButton { ButtonIndex: MouseButton.Left }
|
||||||
|
&& @event.IsPressed()
|
||||||
|
&& _mouseInsideClickArea
|
||||||
|
)
|
||||||
{
|
{
|
||||||
_clickedInside = true;
|
_clickedInside = true;
|
||||||
GetViewport().SetInputAsHandled();
|
GetViewport().SetInputAsHandled();
|
||||||
|
|||||||
Reference in New Issue
Block a user