Exemplo n.º 1
0
	def __build_lightness_slider(self):
		""" Builds a slider that allows the user to adjust light intensity
			on the scene
		"""
		can = self.canvas
		self.add_title('Light Brightness',4)
		
		def adjust(event=None):
			d = 1
			s = int(light_meter.get())
			pos = can.config('lighting').get_lighting_parameters()[2][0]
			can.config('lighting').clear()
			can.create_light([s,s,s,s],Lighting.Point,position=pos,sharpness=4)

			can.create_light([s,s,s,s],Lighting.Ambient)
			textvar.set("Brightness: "+str(s))
			can.update_idletasks()
		
		light_meter = Scale( self, to = 255, from_ = 1, length = 200 )
		light_meter.grid(row=5,column=0)
		textvar = tk.StringVar()
		textvar.set("Brightness: 178")
		tk.Label(self,textvariable=textvar).grid(row=5,column=1)
		light_meter.set(178)
		light_meter.configure(command=adjust)
Exemplo n.º 2
0
	def __build_fog_slider(self):
		""" Builds a slider that allows the user to adjust light intensity
			on the scene
		"""
		can = self.canvas
		self.add_title('Fog Scalar',6)
		
		def adjust(event=None):
			d = 1
			s = int(fog_meter.get())
			can.config('lighting').set_fog_scale(s)
			if s > 0 and s != 70:
				textvar.set("Fog Magnitude: "+str(s))
			elif s == 70:
				textvar.set("Fog Magnitude: :)")
			else:
				textvar.set("Fog Magnitude: OFF")
			can.update_idletasks()
		
		fog_meter = Scale( self, to = 120, from_ = 0, length = 200 )
		fog_meter.grid(row=7,column=0)
		textvar = tk.StringVar()
		textvar.set("Darkness: 0")
		tk.Label(self,textvariable=textvar).grid(row=7,column=1)
		fog_meter.set(0)
		fog_meter.configure(command=adjust)
Exemplo n.º 3
0
Button2 = Button(Frame3)
Button2.place(relx=0.63, rely=0.42, height=20, width=20)
Button2.configure(padding=(2, 0, 0, 0))
Button2.configure(text='''+''')

Button3 = Button(Frame3)
Button3.place(relx=0.74, rely=0.87, height=25, width=60)
Button3.configure(padding=(2, 0, 0, 0))
Button3.configure(text='''Follow''')
Button3.configure(command=follow)
Button3.configure(width=56)

Scale1 = Scale(Frame3, command=lambda s: struc1(s))
Scale1.place(relx=0.07, rely=0.59)
Scale1.configure(length="172")
Scale1.configure(orient="horizontal")
Scale1.configure(from_=1)
Scale1.configure(to_=1000)

val1 = Label(Frame3, textvariable=slider1)
val1.place(relx=0.105, rely=0.52)

Scale2 = Scale(Frame3, command=lambda s: struc2(s))
Scale2.place(relx=0.07, rely=0.735)
Scale2.configure(length="150")
Scale2.configure(orient="horizontal")
Scale2.configure(from_=1)
Scale2.configure(to_=60)

val2 = Label(Frame3, textvariable=slider2)