This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family: 'SongTi'; | |
src: url('font.ttf') format('truetype'); | |
font-weight: normal; | |
font-style: normal; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules/.bin/tsc --init | |
node_modules/.bin/tslint --init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install --save-dev browserify browserify-shim http-server phaser-ce tsify tslint typescript webfontloader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIAlertView alert = UIAlertView.alloc().init(); | |
alert.setTitle("Info"); | |
alert.setMessage("In order to see the global High Score, please login to GameCenter (Settings -> GameCenter)"); | |
alert.addButtonWithTitle("Ok"); | |
alert.show(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GKLocalPlayer.localPlayer().isAuthenticated(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GKScore gkScore = GKScore.alloc(); | |
gkScore = gkScore.initWithLeaderboardIdentifier("my.identifier"); | |
gkScore.setValue(42); | |
NSArray<GKScore> nsArray = (NSArray<GKScore>) NSArray.arrayWithObject(gkScore); | |
GKScore.reportScoresWithCompletionHandler(nsArray, new GKScore.Block_reportScoresWithCompletionHandler() { | |
@Override | |
public void call_reportScoresWithCompletionHandler(NSError nsError) { | |
if (nsError != null) { | |
//submitted score not successfully | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static { | |
try { | |
Class.forName(GKScore.class.getName()); | |
} catch (ClassNotFoundException e) { | |
e.printStackTrace(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!loading) { | |
GKLeaderboard.loadLeaderboardsWithCompletionHandler(new CompletionHandler()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean loading = false; | |
private class CompletionHandler implements GKLeaderboard.Block_loadLeaderboardsWithCompletionHandler { | |
@Override | |
public void call_loadLeaderboardsWithCompletionHandler( | |
NSArray<? extends GKLeaderboard> leaderboards, NSError nsError) { | |
//content below... | |
} | |
} | |
loading = true; | |
if (nsError != null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GKLocalPlayer localPlayer = GKLocalPlayer.localPlayer(); | |
localPlayer.setAuthenticateHandler(new GKLocalPlayer.Block_setAuthenticateHandler() { | |
@Override | |
public void call_setAuthenticateHandler(UIViewController viewController, NSError nsError) { | |
if (viewController != null) { | |
iosApplication.getUIWindow().rootViewController().showDetailViewControllerSender(viewController, null); | |
} else if (localPlayer.isAuthenticated()) { | |
localPlayer.generateIdentityVerificationSignatureWithCompletionHandler( | |
new GKLocalPlayer.Block_generateIdentityVerificationSignatureWithCompletionHandler() { | |
@Override |