What do you want to achieve? I have one 480x480 TFT screen with two gauges for an electric motorcycle I built. I want the needles to rotate from the bulb on the speedometer needle. When I use pivot x and y for the location of the spot on the needle and then attempt to rotate the needle just moves off center and up to the right.
What have you tried so far? I have tried changing the x&y pivot coordinates for the image in both the transform section (the section under flex flow) and in the Style Setting, Transform, pivot x&Y. The needle image is 28 pixels wide by 195 tall, and the pivot point is 14x14 pixels in from either edge.
Try using rotation in the Image section, not the one in Transform.
Rotation is in 1/10th of a degree, so 900 = 90 degrees clockwise
Also the pivot needs to be set relative to the image itself, not the background or the whole screen area.
I have a needle that is 270 * 27 px, pivot is at X62/Y13. Outline is where it sits with 0 rotation.
Hi, you need to set the pointer’s rotation point so that you specify the pointer’s rotation point relative to the left side of the image. So in the attached example, the pointer is 29x195, based on the image, the rotation point is 15x179.
If you use the Transform approach, you’re calling lv_obj_set_style_transform_rotation() to change the rotation angle, which is probably less efficient than using lv_image_set_rotation().
Rotating just the image should result in lower overheads than rotating an object. LVGL 9.1 Image > Transformations indicates that when using lv_image_set_rotation() “image is transformed directly without creating an intermediate layer (buffer) to snapshot the widget”
I have this figured out. I used essentially the same answer as in this thread from squareline support, which was to take half the width of the needle and use that as the x pivot value.