# Path: kelpy/DragDrop.py
# class DragSprite(CommandableImageSprite, Dragable):
# 	"""
# 		The DragSprite is used to create a dragable sprite. It is written so that you feed it similar parameters that you would feed a regualar CommandableImageSprite.
# 		The only difference is that this sprite is able to be dragged around, once the drag and drop function is run in the main event loop (object.process_dragndrop(event))
# 	"""
# 	def __init__(self, canvas, initial_position, imgpath, rotation=0, scale=.20):
# 		CommandableImageSprite.__init__(self, canvas, initial_position, imgpath, rotation, scale)
# 		Dragable.__init__(self)
# 		self.set_x(initial_position[0])
# 		self.set_y(initial_position[1])
# 		self.set_height(self.display_image.get_height())
# 		self.set_width(self.display_image.get_width())
# 
# class DropSprite(CommandableImageSprite, Arrangeable):
# 	"""
# 		The DropSprite class is used to create a sprite with a drop zone on top of it. You then register the drop zone via the DragSprite.register_drop_zone(DropSprite) line.
# 		
# 	"""
# 	def __init__(self, canvas, initial_position, imgpath, rotation=0, scale=.20):
# 		CommandableImageSprite.__init__(self, canvas, initial_position, imgpath, rotation, scale)
# 		Arrangeable.__init__(self)
# 		self.set_x(initial_position[0])
# 		self.set_y(initial_position[1])
# 		self.set_height(self.display_image.get_height())
# 		self.set_width(self.display_image.get_width())


import os, sys
import pygame
import glob
import numpy
from random import randint, choice, sample, shuffle
from time import time,sleep
from kelpy.GIFImage import *
from kelpy.CommandableImageSprite import *
from kelpy.Miscellaneous import *
from kelpy.DisplayQueue import *
from kelpy.OrderedUpdates import *
from kelpy.EventHandler import *
from kelpy.DragDrop import DragSprite, DropSprite
from kelpy.DragDrop import *
from kelpy.tobii.TobiiSimController import *
from kelpy.tobii.TobiiSprite import *
	######################

	IMAGE_SCALE = 0.4
	screen, spots = initialize_kelpy(dimensions=(1920,1200), bg=(255, 255, 255))
	#game.init()
	#screen = game.display.set_mode([500, 500])
	gameon = True
	background_color = pygame.color.Color("black")

	#while gameon:

	BLICKET_DETECTOR_POSITION = (spots.c1[0], spots.c1[1] + 100)
	blicketd_image_path = (kstimulus("shapes/triangle_yellow.png"))

	BLICKET_DETECTOR_POSITION_2 = (spots.c2[0], spots.c2[1] + 100)
	blicketd_image_path_2 = (kstimulus("shapes/star_pink.png"))

	BLICKET_DETECTOR_POSITION_3 = (spots.c3[0], spots.c3[0], 100)
	blicketd_image_path_3 = (kstimulus("shapes/circle_red.png"))

	pygame.display.flip()  # tells game to refresh the display,
	# all code involving the display of things must go ABOVE this line
	event = pygame.event.poll()  # ask game to examine all things happening in the game now

	# code that responds to keyboard of mouse events goes after pool line
	# need to pool all current events before dealing wtih them
	def present_trial(imagepath):
		thing = DragSprite(screen, spots.cu, imagepath, scale=IMAGE_SCALE)
		blicket_detector = DropSprite(screen, BLICKET_DETECTOR_POSITION, blicketd_image_path, scale=.3)
		blicket_detector_2 = DropSprite(screen, BLICKET_DETECTOR_POSITION_2, blicketd_image_path_2, scale=.3)

# Path: kelpy/DragDrop.py
# class DragSprite(CommandableImageSprite, Dragable):
# 	"""
# 		The DragSprite is used to create a dragable sprite. It is written so that you feed it similar parameters that you would feed a regualar CommandableImageSprite.
# 		The only difference is that this sprite is able to be dragged around, once the drag and drop function is run in the main event loop (object.process_dragndrop(event))
# 	"""
# 	def __init__(self, canvas, initial_position, imgpath, rotation=0, scale=.20):
# 		CommandableImageSprite.__init__(self, canvas, initial_position, imgpath, rotation, scale)
# 		Dragable.__init__(self)
# 		self.set_x(initial_position[0])
# 		self.set_y(initial_position[1])
# 		self.set_height(self.display_image.get_height())
# 		self.set_width(self.display_image.get_width())
# 
# class DropSprite(CommandableImageSprite, Arrangeable):
# 	"""
# 		The DropSprite class is used to create a sprite with a drop zone on top of it. You then register the drop zone via the DragSprite.register_drop_zone(DropSprite) line.
# 		
# 	"""
# 	def __init__(self, canvas, initial_position, imgpath, rotation=0, scale=.20):
# 		CommandableImageSprite.__init__(self, canvas, initial_position, imgpath, rotation, scale)
# 		Arrangeable.__init__(self)
# 		self.set_x(initial_position[0])
# 		self.set_y(initial_position[1])
# 		self.set_height(self.display_image.get_height())
# 		self.set_width(self.display_image.get_width())


# Path: examples/LauraSequences/Main.py
import os, sys
import pygame
import glob
import numpy
from random import randint, choice, sample, shuffle
from time import time,sleep
from kelpy.GIFImage import *
from kelpy.CommandableImageSprite import *
from kelpy.Miscellaneous import *
from kelpy.DisplayQueue import *
from kelpy.OrderedUpdates import *
from kelpy.EventHandler import *
from kelpy.DragDrop import DragSprite, DropSprite
from kelpy.DragDrop import *
from kelpy.tobii.TobiiSimController import *
from kelpy.tobii.TobiiSprite import *

	######################

	IMAGE_SCALE = 0.4
	screen, spots = initialize_kelpy(dimensions=(1920,1200), bg=(255, 255, 255))
	#game.init()
	#screen = game.display.set_mode([500, 500])
	gameon = True
	background_color = pygame.color.Color("black")

	#while gameon:

	BLICKET_DETECTOR_POSITION = (spots.c1[0], spots.c1[1] + 100)
	blicketd_image_path = (kstimulus("shapes/triangle_yellow.png"))

	BLICKET_DETECTOR_POSITION_2 = (spots.c2[0], spots.c2[1] + 100)
	blicketd_image_path_2 = (kstimulus("shapes/star_pink.png"))

	BLICKET_DETECTOR_POSITION_3 = (spots.c3[0], spots.c3[0], 100)
	blicketd_image_path_3 = (kstimulus("shapes/circle_red.png"))

	pygame.display.flip()  # tells game to refresh the display,
	# all code involving the display of things must go ABOVE this line
	event = pygame.event.poll()  # ask game to examine all things happening in the game now

	# code that responds to keyboard of mouse events goes after pool line
	# need to pool all current events before dealing wtih them
	def present_trial(imagepath):
		thing = DragSprite(screen, spots.cu, imagepath, scale=IMAGE_SCALE)
		blicket_detector = DropSprite(screen, BLICKET_DETECTOR_POSITION, blicketd_image_path, scale=.3)
		blicket_detector_2 = DropSprite(screen, BLICKET_DETECTOR_POSITION_2, blicketd_image_path_2, scale=.3)

		blicket_detector_3 = DropSprite(screen, BLICKET_DETECTOR_POSITION_3, blicketd_image_path_3, scale = .3)