mlpcardgame/Scenes/Scripts/Game.gd
2019-05-03 18:10:06 +02:00

15 lines
No EOL
332 B
GDScript

extends Control
func _input(event: InputEvent):
if event.is_action_pressed("zoom_in"):
zoom(true)
elif event.is_action_pressed("zoom_out"):
zoom(false)
const SCALE_FACTOR := 0.1
func zoom(direction: bool):
var scaleFactor := 1 + SCALE_FACTOR
if not direction:
scaleFactor = 1 - SCALE_FACTOR
$Board.scale *= scaleFactor