User Tools

Site Tools


crpl:docs:setimagerotation

<- CRPL reference <- Image Commands

SetImageRotation

Arguments Result Notation
A unit UID, image slot, rotation in radians i1 s1 f1 --

Description

Sets the rotation of the image (in radians). Rotation occurs around the center of the image. The slot named “main” refers to the primary unit image (the one that can be set in the editor).

Examples

  • Rotate an Image

    This updates the image's rotation every frame, giving the appearance that it's spinning continuously.

    # Rotate the image 
    Self "FlyingThing" 0.1 SetImageRotation
    
    # Make a part spin around
    Self "RotatingPart" GetImageRotation ->currentRotation
    <-currentRotation 0.1 add ->currentRotation
    Self "RotatingPart" <-currentRotation SetImageRotation
    


  • Next example
crpl/docs/setimagerotation.txt · Last modified: 2021/02/05 11:43 by Karsten75