Canvas Nasal API: Difference between revisions

Jump to navigation Jump to search
m
→‎setRotation: http://flightgear.org/forums/viewtopic.php?f=71&t=18727#p174053
(→‎createTransform: http://flightgear.org/forums/viewtopic.php?f=71&t=18727#p174003)
m (→‎setRotation: http://flightgear.org/forums/viewtopic.php?f=71&t=18727#p174053)
Line 129: Line 129:


Rotates the element around the center. The rotation is set on the first transform.
Rotates the element around the center. The rotation is set on the first transform.
setRotation really just combines a rotation with two translations -> translate(-center[0], -center[1]) * rotate * translate(center[0], center[1])
You can also have a look in the property browser and check the bounding box (/canvas/by-index/texture[i]/[group[j]+]/path[j]/bounding-box) and use its coordinates to determine the correct center of rotation.
=== setScale ===
=== setScale ===
'''Parameters:''' (x, y)
'''Parameters:''' (x, y)

Navigation menu