Scaling

A set of universal blocks that work with resizing Varwin objects. You can adjust the size of the object both in the 3D scene editing mode and in the Blockly logic editor

Inspector

../../../_images/image-617.png

In the scene settings, in the inspector, you can set the size of the object in three axes: X, Y and Z

Note

Read more about the 3D editor interface in the article “Getting to know the interface”

Blockly

Actions

../../../_images/image-154.png
  1. Set scale X: Y: Z: - instantly sets the scale of the specified object
  2. Scale to X: Y: Z: for N sec. - scales the object to the specified values within the specified time. The change is relative to the current (at the moment of block actuation) scale of the object

Note

Specifying three axes for scaling in the Blockly editor is equivalent to specifying them in the scene editor in the inspector in the object parameter “Scale”

  1. Scale to N times for M sec. - scales the object by the specified number of times during the specified time. The change is relative to the current (at the moment of block actuation) scale of the object
  2. Close/stop/continue any scaling - blocks controlling object scaling:
    • Finish - block parameter that finishes any scaling of the object
    • Suspend - block parameter, which suspends object scaling
    • Continue - block parameter that resumes object scaling, which was paused by the Pause block

Variables

../../../_images/image-232.png
  1. Object is scaled at the moment - returns “true” if the object is scaled at the moment. Otherwise it returns “false”
  2. Get scale by Object on axis X/Y/Z - returns the scale of the specified object along the chosen axis in world coordinates
  3. Get from Object scale - returns the scale of the specified object in world coordinates as a vector

Events

../../../_images/image-329.png
  1. Completed any scaling for Object - the event is triggered when the specified object completes any scaling. Scaling is considered completed if the object reached the target scale or if the scaling was stopped by the corresponding block. The object, for which the event was triggered, is passed to the parameter

Examples of use

Obtaining object data

Let’s see an example of how some of the blocks in section “Variables” work

../../../_images/image-420.png

To implement the example, we will use a chain whose update is performed all the time. Let’s put a logical condition inside it, which will be fulfilled if the cube is not scaled. If the condition is true, the values of two parameters will be passed to the “Text” object:

../../../_images/image-514.png
  • Returns the scale of the object along the X axis
  • Returns the object scale on all three axes X, Y, Z