Skip to content

Instantly share code, notes, and snippets.

View blurymind's full-sized avatar

Todor Imreorov blurymind

View GitHub Profile
var curSelectedItem = 0
func _on_ItemList_item_selected( index ):
if curSelectedItem == index: print('Double Clicked!')
curSelectedItem = index
@blurymind
blurymind / pan.gd
Last active July 29, 2016 18:58 — forked from neikeq/pan.gd
extends Camera2D
var dragging = false
func _ready():
set_process_input(true)
func _input(event):
if event.type == InputEvent.MOUSE_BUTTON and event.button_index == BUTTON_MIDDLE:
dragging = event.is_pressed()
extends LineEdit
var updating = false
const allowed = ["0","1","2","3","4","5","6","7","8","9"]
func _ready():
connect("text_changed",self,"otc")
@blurymind
blurymind / restrictToNumbers.gd
Created July 17, 2016 01:47
godot function that restricts a string to only use numbers - for numeric value input
func _on_H_text_changed():
hInput.set_text(returnNumbersOnly(hInput.get_text()))
hInput.cursor_set_column(hInput.get_text().length(),true)
## This function restricts the input to be only numeric###
func returnNumbersOnly(enteredText):
var word = ''
for letter in enteredText:
var resultingText = RegEx.new()
extends Node2D
var arguments = []
var output = []
#This script should open your file manager in disk C: on start
#Its the equivalent of doing 'start C:\' in the CMD
# The start command (when working) can be used to open any file type with the default software that
#is assigned to it. In this case it opens a directory (default - file explorer) for sake of example.
func _ready():
@blurymind
blurymind / gist:92566dd333bf869d4eeb
Created March 23, 2016 12:00
stip-animated.json
{
"name": "stip",
"changelog": [
"23/03/2016 - 11:55:51"
],
"nodes": [
{
"name": "Root",
"type": "BONE",
"node_path": "Root",