Prechádzať zdrojové kódy

Update slice9.gui_script

Good catch thanks! made getshape function local.
I think I fixed indentation, was it before the -- < 2 > ?
NERD 3 rokov pred
rodič
commit
2f79b0bc0a
1 zmenil súbory, kde vykonal 10 pridanie a 10 odobranie
  1. 10 10
      examples/gui/slice9/slice9.gui_script

+ 10 - 10
examples/gui/slice9/slice9.gui_script

@@ -2,7 +2,7 @@ local shape1 = vmath.vector3(660,576,0)  --  < 1 >
 local shape2 = vmath.vector3(150,500,0)
 local shape3 = vmath.vector3(350,250,0)
 
-function getshape(self)	 --  < 2 >
+local function getshape(self)  --  < 2 >
 	local node = gui.get_node("slice_box")
 	local function animate_size(node, shape)  --  < 3 >
 		gui.animate(node, "size", shape, gui.EASING_INOUTCUBIC, 1.75, 2.5, getshape, gui.PLAYBACK_ONCE_FORWARD)
@@ -19,26 +19,26 @@ function getshape(self)	 --  < 2 >
 	end
 end
 
-function init(self)  -- < 4 >
+function init(self)  --  < 4 >
 	self.shape_number = 1
 	getshape(self)
 end
 
 --[[
 
-1.-Here we create 3 local vector3's representing 3 different sizes for use when animating 
+1.-Here we create 3 local vector3's representing 3 different sizes for use when animating
 	the gui node size property.
 
-2.-getshape() function gets our slice-9 gui node then an if statement is used to check 
-	the shape_number variable and animate_size is set accordingly and shape_number is 
-	changed for the next shape. 
+2.-getshape() function gets our slice-9 gui node then an if statement is used to check
+	the shape_number variable and animate_size is set accordingly and shape_number is
+	changed for the next shape.
 
-3.-The local function animate_size() takes in the node and shape vector3 and uses them 
-	with gui.animate. Here we animate the "size" of the node and after the animation is 
-	complete getshape function is called again and a different shape "size" will be animated 
+3.-The function animate_size() takes in the node and shape vector3 and uses them
+	with gui.animate. Here we animate the "size" of the node and after the animation is
+	complete getshape function is called again and a different shape "size" will be animated
 	once again.
 
 4.-In the initialize function we set self.shape_number to 1 and call getshape function to
-	start the looping chained animation 
+	start the looping chained animation.
 
 --]]