Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extends Node2D
- # member variables here, example:
- # var a=2
- # var b="textvar"
- func _ready():
- set_process_input(true)
- pass
- func _input(event):
- if(event.is_pressed()):
- if(Input.is_key_pressed(KEY_ESCAPE)):
- get_tree().quit()
- var zoom = get_node("camera").get_zoom()
- if (event.type == InputEvent.MOUSE_BUTTON):
- if (event.button_index == BUTTON_WHEEL_UP):
- print("wheel up (event)")
- zoom[0] = zoom[0] + 1
- zoom[1] = zoom[1] + 1
- if (event.button_index == BUTTON_WHEEL_DOWN):
- print("wheel down (event)")
- zoom[0] = zoom[0] - 1
- zoom[1] = zoom[1] - 1
- get_node("camera").set_zoom(zoom)
- print (zoom)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement