ScaleBehaviour

class Varwin.ScaleBehaviour

Bases: object

SetScale(targetScale: Vector3) None

Instantly sets the scale of the specified object.

Example:

instance.ScaleBehaviour.SetScale(Varwin.Vector3(1,0,0))
async ScaleOverTime(target: Vector3, time: float) None

Scales the object to the specified values within the specified time. The change is relative to the current (at the time the block is triggered) scale of the object.

Example:

await instance.ScaleBehaviour.ScaleOverTime(Varwin.Vector3(1,0,0), 0)
async ScaleByFactorOverTime(target: float, time: float) None

Scales the object by the specified number of times within the specified time. The change is relative to the current (at the time the block is triggered) scale of the object.

Example:

await instance.ScaleBehaviour.ScaleByFactorOverTime(0, 0)
Stop() None

Controls any scaling. A paused scaling can be continued with the “Continue” block.

Example:

instance.ScaleBehaviour.Stop()
Pause() None

Controls any scaling. A paused scaling can be continued with the “Continue” block.

Example:

instance.ScaleBehaviour.Pause()
Continue() None

Controls any scaling. A paused scaling can be continued with the “Continue” block.

Example:

instance.ScaleBehaviour.Continue()
IsScalingNow() bool

Returns “true” if the object is currently scaled. Otherwise it returns “false”.

Example:

result = instance.ScaleBehaviour.IsScalingNow()
property Scale: Vector3

Returns the scale of the specified object in world coordinates as a vector.

Example:

result = instance.ScaleBehaviour.Scale
property ScaleX: float

Returns the scale of the specified object along the selected axis in world coordinates.

Example:

result = instance.ScaleBehaviour.ScaleX
property ScaleY: float

Returns the scale of the specified object along the selected axis in world coordinates.

Example:

result = instance.ScaleBehaviour.ScaleY
property ScaleZ: float

Returns the scale of the specified object along the selected axis in world coordinates.

Example:

result = instance.ScaleBehaviour.ScaleZ
AddScalingFinishedHandler(handler: Callable[[Object], CoroutineType]) None

The event is triggered when the specified object completes any scaling. The scaling is considered complete if the object has 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.

Parameters:

handler

Asynchronous handler function with signature:

  • sender (Object): the object that triggered the event

Example:

async def OnScalingFinished(sender):
  ...
instance.ScaleBehaviour.AddScalingFinishedHandler(OnScalingFinished)