objective c - Circular animation in Apple watch using UIGraphicsContext -
i want create circular animation in apple watch using core graphics. want create animation earth revolving around sun continuously. have tried method below crashes application on watch after time. please share suggestions , ideas on this.
attempt:
uigraphicsbeginimagecontext(contextsize); cgcontextref context = uigraphicsgetcurrentcontext(); cgcontextsetstrokecolorwithcolor(context, [uicolor whitecolor].cgcolor); [sprite.image drawatpoint:sprite.position]; // convert uiimage cgimageref imgref = cgbitmapcontextcreateimage(context); self.lastimage = [uiimage imagewithcgimage:imgref]; // end graphics context uigraphicsendimagecontext(); [self.container setimage:self.lastimage];
tgesprite
own custom class having 2 objects 1. uiimage , 2. cgpoint position.- in above code find point of circular path of specified radius , draw image on series of position after regular interval of time.
- when try smooth animation , reduce interval time 25 times in second. runs 2 iterations , crashes.
- in nutshell, want create circular animation in have complete control of object revolving.
Comments
Post a Comment