How to bind image rotation in a widget

Is there any way to bind the rotation of an image in my widget?

I know how to rotate an image using the Angle option and I know that I can animate that, but those aren’t helpful to me. It seems that none of the Transform options are bindable, am I missing something?

Feed it desired value on Tick. It can be the widget’s tick, it can be somebody else’s tick. And that’s assuming you want to update the angle every frame.

none of the Transform options are bindable, am I missing something?

Binding is optional, in a lot of cases you may want to avoid binding as these functions execute every frame. Event driven approach is the way to go; update the widget when there’s a need for that.

I don’t understand.

My widget is sound based, and I already have it set up to update only when a new sound is heard. The whole widget is a single image that will rotate based on the direction of the sound. I have the math to calculate the direction,

My only problem is I can’t figure out how to change the image rotation through a binding.

There is no binding. You take the image an update its angle:

image

Above, you could apply the rotation to any element inside the widget; or to the whole widget - below:

And finally, the widget can rotate itself from within, too

image

In this case, your job would be to provide a value to the variable - this would be the closest to the binding behaviour.

Ah okay, I get it now. Thanks, I would prefer a simple bind but This seems like the best (or only) option.
Thanks friend.

1 Like