Commented notice() function
This commit is contained in:
		| @ -7,13 +7,21 @@ var local_version # The version installed on this computer | |||||||
| var os_name # The simplified name of the OS (linux, or windows) | var os_name # The simplified name of the OS (linux, or windows) | ||||||
| var suffix #  | var suffix #  | ||||||
|  |  | ||||||
|  | # Load in the Notice_msg scene (Will be instanced) | ||||||
| var Notice_msg = load("res://Notice_msg.tscn") | var Notice_msg = load("res://Notice_msg.tscn") | ||||||
|  |  | ||||||
|  | # Define notice() | ||||||
|  | #  Takes a message and a type, then instances a new Notice_msg instance | ||||||
| func notice(msg, type): | func notice(msg, type): | ||||||
|  | 	# Get a new Notice_msg instance, | ||||||
| 	var notice = Notice_msg.instance() | 	var notice = Notice_msg.instance() | ||||||
|  | 	# Pass arguments to notice node | ||||||
| 	notice.message = msg | 	notice.message = msg | ||||||
| 	notice.type = type | 	notice.type = type | ||||||
|  | 	 | ||||||
|  | 	# Set the position | ||||||
| 	notice.set_position(Vector2(20, $Notices.get_child_count()*30)) | 	notice.set_position(Vector2(20, $Notices.get_child_count()*30)) | ||||||
|  | 	 | ||||||
| 	$Notices.add_child(notice) | 	$Notices.add_child(notice) | ||||||
|  |  | ||||||
| # Every _process tick | # Every _process tick | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user