Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. - (id)initWithFrame:(CGRect)frame
  2. {
  3. self = [super initWithFrame:frame];
  4. if (self) {
  5. CGSize size = frame.size;
  6.  
  7. [self setBackgroundColor:[UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:1]];
  8. int radius = size.height * 0.3;
  9.  
  10. if (radius < 200)
  11. radius = 200;
  12.  
  13. CGRect rect = CGRectMake(size.width * 0.5 - radius * 0.5, size.height * 0.5 - radius * 0.5, radius, radius);
  14.  
  15. projectImage = [[UIMaskedImage alloc] initWithImage:[ProjectController getImageForProject:nil] inFrame:rect withTintColor:[UIColor clearColor] anInsetRadius:6];
  16.  
  17.  
  18. int icon_size = 50;
  19. int icon_margin = 10;
  20.  
  21. menuButton = [[UISVGButton alloc] initWithFrame:CGRectMake(icon_margin, icon_margin, icon_size, icon_size) svgAtPath:@"list.svg" andColor:[UIColor whiteColor]];
  22. [menuButton addTarget:self action:@selector(closeScene:) forControlEvents:UIControlEventTouchUpInside];
  23. [self addSubview:menuButton];
  24.  
  25. backButton = [[UISVGButton alloc] initWithFrame:CGRectMake(size.width - icon_size - icon_margin, icon_margin, icon_size, icon_size) svgAtPath:@"arrow_down.svg" andColor:[UIColor whiteColor]];
  26.  
  27. [backButton addTarget:self action:@selector(closeOptionsMenu:) forControlEvents:UIControlEventTouchUpInside];
  28.  
  29.  
  30. int icon2_size = 100;
  31.  
  32.  
  33. shareButton = [[UISVGButton alloc] initWithFrame:CGRectMake(size.width*0.5 + radius * 0.5 + icon_margin*2, size.height*0.5 - icon2_size*0.5, icon2_size, icon2_size) svgAtPath:@"share.svg" andColor:[UIColor whiteColor]];
  34.  
  35. [shareButton addTarget:self action:@selector(shareOnSocialNetworks:) forControlEvents:UIControlEventTouchUpInside];
  36.  
  37.  
  38. deleteSaveButton = [[UISVGButton alloc] initWithFrame:CGRectMake(size.width*0.5 - radius * 0.5 - icon_margin*2 -icon2_size, size.height*0.5 - icon2_size*0.5, icon2_size, icon2_size)svgAtPath:@"delete.svg" andColor:[UIColor whiteColor]];
  39.  
  40. [deleteSaveButton addTarget:self action:@selector(downloadCurrentProject:) forControlEvents:UIControlEventTouchUpInside];
  41.  
  42.  
  43. [self setClipsToBounds:YES];
  44.  
  45. [self addSubview:backButton];
  46. [self addSubview:deleteSaveButton];
  47. [self addSubview:projectImage];
  48. [self addSubview:shareButton];
  49. }
  50. return self;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement