SetScale

(Difference between revisions)
Jump to: navigation, search
(Created page with "Modify the size of an object. Example 1 : Simple usage object = getObject("object") function onSceneUpdate() if isKeyPressed("SPACE") then setScale(object, {...")
 
Line 16: Line 16:
 
         if isKeyPressed("DOWN") then setScale(object, {1, 1, SCL[3]-1}) end -- Decrease Z scale continuously
 
         if isKeyPressed("DOWN") then setScale(object, {1, 1, SCL[3]-1}) end -- Decrease Z scale continuously
 
     end
 
     end
 +
 +
[[Category:Lua scripting]]

Revision as of 18:01, 4 February 2014

Modify the size of an object.

Example 1 : Simple usage

   object = getObject("object")
   function onSceneUpdate()
       if isKeyPressed("SPACE") then setScale(object, {1, 1, 5}) end -- change object Z scale to 5
   end

Example 2 : Continuous scaling with getScale

   object = getObject("object")
   function onSceneUpdate()
       SCL = getScale(object)
       if isKeyPressed("UP") then setScale(object, {1, 1, SCL[3]+1}) end -- Increase Z scale continuously
       if isKeyPressed("DOWN") then setScale(object, {1, 1, SCL[3]-1}) end -- Decrease Z scale continuously
   end
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox