Sfoglia il codice sorgente

Merge pull request #24 from paweljarosz/cancel_timer_example

Added example to cancel timer using built-in API.
Björn Ritzl 2 anni fa
parent
commit
f434c55103
2 ha cambiato i file con 19 aggiunte e 1 eliminazioni
  1. 18 0
      examples/_main/loader.go
  2. 1 1
      examples/_main/menu.gui_script

+ 18 - 0
examples/_main/loader.go

@@ -964,6 +964,24 @@ embedded_components {
     w: 1.0
   }
 }
+embedded_components {
+  id: "timer/cancel_timer"
+  type: "collectionproxy"
+  data: "collection: \"/examples/timer/cancel_timer/cancel_timer.collection\"\n"
+  "exclude: false\n"
+  ""
+  position {
+    x: 0.0
+    y: 0.0
+    z: 0.0
+  }
+  rotation {
+    x: 0.0
+    y: 0.0
+    z: 0.0
+    w: 1.0
+  }
+}
 embedded_components {
   id: "timer/trigger_timer"
   type: "collectionproxy"

+ 1 - 1
examples/_main/menu.gui_script

@@ -115,7 +115,7 @@ function init(self)
 	self.index["sprite"] = { "size", "tint", "flip" }
 	self.index["file"] = { "sys_save_load" }
 	self.index["tilemap"] = { "collisions", "get_set_tile" }
-	self.index["timer"] = { "repeating_timer", "trigger_timer" }
+	self.index["timer"] = { "repeating_timer", "trigger_timer", "cancel_timer" }
 	local categories = {}
 	for k,_ in pairs(self.index) do
 		categories[#categories + 1] = k