SCED/src/playercards/Tarotcard.ttslua
2023-04-27 15:38:58 +02:00

23 lines
546 B
Plaintext

-- context menu to manually fix rotation
function onLoad()
self.addContextMenuItem("Rotate Preview", rotatePreview)
self.addContextMenuItem("Rotate Card+Preview", rotateSelfAndPreview)
end
-- rotates the alt_view_angle
function rotatePreview()
local angle = self.alt_view_angle
if angle.y == 0 then
angle.y = 180
else
angle.y = 0
end
self.alt_view_angle = angle
end
-- rotates this card and the preview
function rotateSelfAndPreview()
self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))
rotatePreview()
end