def render_hover_ui(self, screen, rc):
		buttons = self.board.get_hover_buttons() # { 'id': ..., 'label': ..., 'key':... 'x', 'y'}
		if buttons != None:
			hb = []
			for button in buttons:
				if button['id'] == self.active_button:
					color = (0, 100, 255)
				else:
					color = (0, 0, 140)
				x = button['x']
				y = button['y']
				label = button['label']
				w = 16 * (1 + len(label))
				h = 32
				pygame.draw.rect(screen, color, pygame.Rect(x, y, w, h))
				# TODO: texturing
				TEXT.render(screen, label, 'white', x + 8, y + 8)
				
				hb.append((x, y, x + w, y + h, button['id']))
			self.hover_buttons = hb
		else:
			self.hover_buttons = None
		
		color = 'white'
		if self.mouse_xy[0] < MENU_LINK_SIZE[0] and self.mouse_xy[1] < MENU_LINK_SIZE[1]:
			color = 'yellow'
		TEXT.render(screen, 'Menu', color, 8, 4)
		
	def render(self, screen, offset_x, offset_y, mouse_xy, rc):
		if self.type == 'TEXT':
			TEXT.render(screen, self.text, self.color, offset_x + self.x, offset_y + self.y)
		elif self.type == 'BUTTON':
			mx, my = mouse_xy
			mx -= offset_x
			hover = False
			is_enabled = self.is_enabled()
			if is_enabled:
				hover = mx >= self.left and mx < self.right
				if hover:
					my -= offset_y
					hover = my >= self.top and my < self.bottom
			
			bg_color = (200, 200, 200, 200) if hover else (40, 40, 40, 200)
			pygame.draw.rect(screen, bg_color, pygame.Rect(offset_x + self.x, offset_y + self.y, self.width, self.height))
			
			color = 'white' if is_enabled else 'gray'
			TEXT.render(screen, self.text, color, offset_x + self.text_x, offset_y + self.text_y)
		elif self.type == 'IMAGE':
			if self.frames == 1:
				img = self.image[0]
			else:
				frame = (rc // 4) % self.frames
				img = self.image[frame]
			screen.blit(img, (self.x + offset_x, self.y + offset_y))
		
		elif self.type == 'HOVER':
			mx, my = mouse_xy
			mx -= offset_x
			my -= offset_y
			if mx >= self.left  and mx < self.right and my >= self.top and my < self.bottom:
				self.element.text = self.text
		else:
			raise Exception("Not implemented.")
	def render(self, screen, rc):
		self.bg.render(screen, rc)
		
		alpha = int(self.counter * 5)
		if alpha > 180:
			alpha = 180
		
		draw_alpha_rectangle(screen, 0, 0, screen.get_width(), screen.get_height(), 100, 0, 0, alpha)
		
		if alpha == 180:
			self.allow_click = True
			message = [
				'Due to the lack of responsiveness',
				'to the incoming repair requests,',
				'the IT department has singlehandedly',
				'bankrupted ZP&B Inc, creating',
				'a snowball effect that has sent the',
				'global economy into a crash only',
				'describable as a second dark age.',
				'',
				'tap anywhere to submit resume to',
				'your local feudal lord.'
			]
			
			y = 20
			x = 20
			for line in message:
				TEXT.render(screen, line, 'white', x, y)
				y += 32
	def render(self, screen, rc):
		screen.fill((0, 0, 0))
		
		self.board.render(screen, rc, 0, 0, self.model.staff)
		
		budget = self.model.budget
		display_budget = self.last_shown_budget
		if abs(budget - display_budget) < 2:
			display_budget = budget
		else:
			display_budget = (display_budget + budget) // 2
		self.last_shown_budget = display_budget
		
		x = 8
		y = 32 * 10 - 8
		things = [
			("Budget", display_budget, 'white'),
			("IV's", self.model.inventory_ivs, 'blue'),
			("Cucumbers", self.model.inventory_cucumbers, 'green'),
			('Tapes', self.model.inventory_tapes, 'gray'),
			('Jackets', self.model.inventory_jackets, 'purple'),
			('Laptops', self.model.inventory_laptops, 'white'),
			('Phones', self.model.inventory_phones, 'white'),
			('Tablets', self.model.inventory_tablets, 'white')
		]
		
		
		y_offset = int(abs(math.sin(rc * 2 * 3.14159 / 30)) * 3)
		first = True
		for thing in things:
			prefix = ''
			if first:
				prefix = '$'
			
			count = thing[1]
			label = thing[0] + ': ' + prefix + str(count)
			color = thing[2]
			yo = 0
			if count < 2:
				color = 'red'
				if count < 1:
					yo = -y_offset
			TEXT.render(screen, label, color, x, y + yo)
			y += 18
			if first:
				first = False
				y += 15
		
		self.render_hover_ui(screen, rc)
		
		level = self.model.session.level
		if level == 0:
			header = 'New Employee Training'
		else:
			header = 'Day ' + str(level)
		TEXT.render(screen, header, 'white', 300, 4)
	def render(self, screen, rc):
		self.bg.render(screen, rc)
		if len(self.pages) > 0:
			draw_alpha_rectangle(screen, 50, 50, 540, 380, 40, 40, 40, 180)

			self.button.render(screen, 0, 0, self.mouse_xy, rc)
			
			lines = self.pages[0].split('\n')
			x = 60
			y = 60
			for line in lines:
				TEXT.render(screen, line, 'white', x, y)
				y += 24
	def render(self, screen, rc):
		interesting_coords = self.base_interesting_coords
		if self.current_valid_coord != None:
			interesting_coords = interesting_coords + [[self.item_type] + list(self.current_valid_coord)]
		
		ROOM_RENDERER.render(screen, rc, None, None, interesting_coords, None, None, True, None)
		
		text = 'Cancel'
		yoffset = 0
		if self.item_type == None:
			text = 'Done'
			yoffset = -int(abs(math.sin(rc * 2 * 3.14159 / 30) * 5))
		
		TEXT.render(screen, text, 'yellow' if self.is_over_done else 'white', 8, 8 + yoffset)
		
	def render(self, screen, rc):
		bg = IMAGES.get('menus/title.png')
		screen.blit(bg, (0, 0))
		
		mx, my = self.cursor
		
		y = GAME_HEIGHT // 2
		x = GAME_WIDTH // 5
		
		current = None
		for option in [
			('New Game', 'new_game'),
			('Tutorial', 'tutorial'),
			('Options', 'options'),
			('Exit', 'exit')
			]:
			
			label, id = option
			button = self.buttons[id]
			hover = mx > button[0] and mx < button[2] and my > button[1] and my < button[3]
			
			if hover:
				current = id
			
			coords = TEXT.render(screen, label, 'yellow' if hover else 'white', x, y)
			self.buttons[id] = (x, y, coords[0], coords[1])
			y += 30
		self.currently_over = current
	def render(self, screen, render_counter):
		if self.bg != None:
			self.bg.render(screen, render_counter)
		
		if self.bg == None:
			screen.fill((0,0,0))
		
		draw_alpha_rectangle(screen, 0, 0, GAME_WIDTH, GAME_HEIGHT, 40, 40, 40, 200)
		
		mx, my = self.cursor
		
		y = GAME_HEIGHT // 3
		x = GAME_WIDTH // 5
		width_over_two = GAME_WIDTH // 2
		
		current = None
		
		options = [('Full Screen', 'full_screen'),('SFX Volume', 'sfx_volume'),('Music Volume', 'music_volume'),('Back', 'back')]
		if len(self.buttons) == 5: options.append(('Return to Main Menu','main_menu'))
		
		for option in options:
			
			label, id = option
			button = self.buttons[id]
			hover = mx > button[0] and mx < button[2] and my > button[1] and my < button[3]
			
			if self.over == id:
				current = id
				button_color = (255, 255, 255, 255)
				text_color = 'white'
				sfx_color = (255, 0, 0, 255)
				music_color = (0, 255, 0, 255)
			elif hover and (self.over == None):
				current = id
				button_color = (255, 255, 255, 255)
				text_color = 'white'
				sfx_color = (255, 0, 0, 255)
				music_color = (0, 255, 0, 255)
			else:
				button_color = (150, 150, 150, 150)
				text_color = 'gray'
				sfx_color = (180, 0, 0, 180)
				music_color = (0, 180, 0, 180)
			
			coords = TEXT.render(screen, label, text_color, x, y)
			if id == 'full_screen':
				self.buttons[id] = (x, y, width_over_two + 20, coords[1])
				pygame.draw.rect(screen, button_color, pygame.Rect(width_over_two, y, 15, 15), 0 if MAGIC_POTATO.is_full_screen() else 1)
			elif id == 'sfx_volume':
				pygame.draw.line(screen, button_color, (width_over_two, y + 7), (width_over_two + 200, y + 7), 2)
				for i in [18, 36, 55, 73, 91, 109, 127, 145, 164, 182]: # ours go to 11!
					pygame.draw.line(screen, button_color, (width_over_two + i, y + 1), (width_over_two + i, y + 14), 1)
				for i in [0, 200]: # end lines
					pygame.draw.line(screen, button_color, (width_over_two + i, y - 1), (width_over_two + i, y + 16), 1)
				pygame.draw.rect(screen, sfx_color, pygame.Rect(width_over_two + (self.sfx_vol * 2) - 1, y + 3, 3, 10), 0)
				self.buttons[id] = (x, y, width_over_two + 220, coords[1])
			elif id == 'music_volume':
				pygame.draw.line(screen, button_color, (width_over_two, y + 7), (width_over_two + 200, y + 7), 2)
				for i in [18, 36, 55, 73, 91, 109, 127, 145, 164, 182]: # ours go to 11!
					pygame.draw.line(screen, button_color, (width_over_two + i, y + 1), (width_over_two + i, y + 14), 1)
				for i in [0, 200]: # end lines
					pygame.draw.line(screen, button_color, (width_over_two + i, y - 1), (width_over_two + i, y + 16), 1)
				pygame.draw.rect(screen, music_color, pygame.Rect(width_over_two + (self.music_vol * 2) - 1, y + 3, 3, 10), 0)
				self.buttons[id] = (x, y, width_over_two + 220, coords[1])
			else:
				self.buttons[id] = (x, y, coords[0], coords[1])
			y += 30
		self.currently_over = current