mlpcardgame/Scenes/Scripts/Game.gd

15 lines
332 B
GDScript3
Raw Normal View History

2019-05-03 16:10:06 +00:00
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