forked from typeoneerror/GKAchievementNotification
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGKAchievementNotification.h
More file actions
executable file
·112 lines (87 loc) · 3.52 KB
/
GKAchievementNotification.h
File metadata and controls
executable file
·112 lines (87 loc) · 3.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//
// GKAchievementNotification.h
//
// Created by Benjamin Borowski on 9/30/10.
// Copyright 2010 Typeoneerror Studios. All rights reserved.
// $Id$
//
#import <UIKit/UIKit.h>
@class GKAchievementNotification;
#define kGKAchievementAnimeTime 0.4f
#define kGKAchievementDisplayTime 1.75f
#define kGKAchievementDefaultSize CGRectMake(0.0f, 0.0f, 284.0f, 52.0f);
#define kGKAchievementText1 CGRectMake(10.0, 6.0f, 264.0f, 22.0f);
#define kGKAchievementText2 CGRectMake(10.0, 20.0f, 264.0f, 22.0f);
#define kGKAchievementText1WLogo CGRectMake(46.0, 6.0f, 209.0f, 22.0f);
#define kGKAchievementText2WLogo CGRectMake(46.0, 20.0f, 209.0f, 22.0f);
#pragma mark -
/**
* The handler delegate responds to hiding and showing
* of the game center notifications.
*/
@protocol GKAchievementHandlerDelegate <NSObject>
@optional
/**
* Called on delegate when notification is hidden.
* @param nofification The notification view that was hidden.
*/
- (void)didHideAchievementNotification:(GKAchievementNotification *)notification;
/**
* Called on delegate when notification is shown.
* @param nofification The notification view that was shown.
*/
- (void)didShowAchievementNotification:(GKAchievementNotification *)notification;
/**
* Called on delegate when notification is about to be hidden.
* @param nofification The notification view that will be hidden.
*/
- (void)willHideAchievementNotification:(GKAchievementNotification *)notification;
/**
* Called on delegate when notification is about to be shown.
* @param nofification The notification view that will be shown.
*/
- (void)willShowAchievementNotification:(GKAchievementNotification *)notification;
@end
#pragma mark -
/**
* The GKAchievementNotification is a view for showing the achievement earned.
*/
@interface GKAchievementNotification : UIView
{
NSString *_message; /**< Optional custom achievement message. */
NSString *_title; /**< Optional custom achievement title. */
UIImageView *_background; /**< Stretchable background view. */
UIImageView *_logo; /**< Logo that is displayed on the left. */
UILabel *_textLabel; /**< Text label used to display achievement title. */
UILabel *_detailLabel; /**< Text label used to display achievement description. */
id<GKAchievementHandlerDelegate> _handlerDelegate; /**< Reference to nofification handler. */
}
/** Optional custom achievement message. */
@property (nonatomic, retain) NSString *message;
/** Optional custom achievement title. */
@property (nonatomic, retain) NSString *title;
/** Stretchable background view. */
@property (nonatomic, retain) UIImageView *background;
/** Logo that is displayed on the left. */
@property (nonatomic, retain) UIImageView *logo;
/** Text label used to display achievement title. */
@property (nonatomic, retain) UILabel *textLabel;
/** Text label used to display achievement description. */
@property (nonatomic, retain) UILabel *detailLabel;
/** Reference to nofification handler. */
@property (nonatomic, retain) id<GKAchievementHandlerDelegate> handlerDelegate;
#pragma mark -
/**
* Create a notification with a custom title and description.
* @param title Title to display in notification.
* @param message Descriotion to display in notification.
* @return a GKAchievementNoficiation view.
*/
- (id)initWithTitle:(NSString *)title andMessage:(NSString *)message;
-(void) animate;
/**
* Change the logo that appears on the left.
* @param image The image to display.
*/
- (void)setImage:(UIImage *)image;
@end