浏览代码

add clear console command

deepnight 9 年之前
父节点
当前提交
24630ce91b
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      h2d/Console.hx

+ 4 - 0
h2d/Console.hx

@@ -49,6 +49,10 @@ class Console extends h2d.Sprite {
 		commands = new Map();
 		aliases = new Map();
 		addCommand("help", "Show help", [ { name : "command", t : AString, opt : true } ], showHelp);
+		addCommand("cls", "Clear console", [], function() {
+			logs = [];
+			logTxt.text = "";
+		});
 		addAlias("?", "help");
 	}