public LeaderboardSetsScreen(CGSize size) : base(size) { leaderboardSetButtons = new List <SKLabelNode> (); SKLabelNode title = new SKLabelNode("GillSans-Bold") { Text = "Leaderboards Sets", FontSize = 30, Position = new CGPoint(FrameMidX, FrameMidY + 190) }; backButton = new SKLabelNode("GillSans-Bold") { Text = "Back", FontSize = 18, FontColor = ButtonColor, Position = new CGPoint(FrameMidX, FrameMidY - 200) }; if (GKLocalPlayer.LocalPlayer.Authenticated) { GKLeaderboardSet.LoadLeaderboardSets(LoadLeaderboardSets); } AddChild(title); AddChild(backButton); }
void LoadLeaderboardSets (GKLeaderboardSet[] leaderboardSets, NSError error) { this.leaderboardSets = leaderboardSets; if (leaderboardSets == null) return; int offset = 0; foreach (var leaderboardSet in leaderboardSets) { var leaderboardSetButton = new SKLabelNode ("GillSans-Bold") { Text = leaderboardSet.Title, FontSize = 18, Position = new PointF (FrameMidX, FrameMidY + 125 - offset) }; offset += 50; AddChild (leaderboardSetButton); leaderboardSetButtons.Add (leaderboardSetButton); } }