I've built my own animation engine, and I want to set the rotation of a UI view on each frame that I render (60fps)
I've made a video now showing what the problem is currently.
It's fairly close, but it's still rotating in a strange way:
https://www.youtube.com/watch?v=1ZKK4r0-6i4
I've implemented a custom CustomUIView class, that inherits from UI view. This has translation, scaling and rotation properties, so when I transform the matrix, all 3 happen in the same action.
var t = CGAffineTransform( translationX: self.translation.x, y:
self.translation.y );
// Apply scaling
t = t.scaledBy( x: self.scaling.x, y: self.scaling.y );
// Apply rotation
t = t.rotated(by:self.rotation)
self.transform = t
and the size and the width are set like this:
view.frame.size.width = parseSize(value, axis: "width")
view.layer.bounds.size.width = parseSize(value, axis: "width")
I'm trying to set both of these properties, but I'm not sure if this is correct.
I've set the anchor point a lot, and also tried the overall center point of the view as well.