Browse Source

Fix another code sample using unsupported C# syntax in Input examples

Hugo Locurcio 4 years ago
parent
commit
d5a93b6a0a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      tutorials/inputs/input_examples.rst

+ 2 - 2
tutorials/inputs/input_examples.rst

@@ -282,12 +282,12 @@ also counts as a button - two buttons, to be precise, with both
 
     public override void _Input(InputEvent inputEvent)
     {
-        if (inputEvent as InputEventMouseButton mouseEvent && mouseEvent.Pressed)
+        if (inputEvent is InputEventMouseButton mouseEvent && mouseEvent.Pressed)
         {
             switch ((ButtonList)mouseEvent.ButtonIndex)
             {
                 case ButtonList.Left:
-                    GD.Print($"Left button was clicked at {mouseEvent.Position}");
+                    GD.Print("Left button was clicked at ", {mouseEvent.Position});
                     break;
                 case ButtonList.WheelUp:
                     GD.Print("Wheel up");