Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Touchscreen
- func isAndroid():
- if (OS.get_name() == "Android"):
- get_node("TouchScreen").show()
- for btn in get_node("TouchScreen").get_children():
- btn.connect("pressed",self,"pressBtn",[btn])
- btn.connect("released",self,"releBtn",[btn])
- #Funcs Touchscreen buttons
- func pressBtn(btn):
- btn.set_opacity(1)
- var name = btn.get_name()
- if (name == "BtnUp"):
- Input.is_button_pressed(KEY_UP)
- #OS.alert("button BtnUp pressed","Alert!")
- pass
- elif (name == "BtnRight"):
- #OS.alert("button BtnRight pressed","Alert!")
- pass
- elif (name == "BtnDown"):
- #OS.alert("button BtnDown pressed","Alert!")
- pass
- elif (name == "BtnLeft"):
- #OS.alert("button BtnLeft pressed","Alert!")
- pass
- func releBtn(btn):
- btn.set_opacity(0.5)
Add Comment
Please, Sign In to add comment