2018/06

이 글은 PC 버전 TISTORY에 최적화 되어있습니다. 데이터 저장/가져오기 코드 cc.Class({ extends: cc.Component, properties: { score: 1000, bestScore: 0 }, loadBestScore: function () { var self = this; FBInstant.player.getDataAsync(["score"]).then(function (data) { if (typeof data["score"] !== "undefined") { self.bestScore = data["score"]; } console.log('최고 점수', self.bestScore); }).catch(function(reason) { console.log('loadBes..
이 글은 PC 버전 TISTORY에 최적화 되어있습니다. 앱 페이지에서 Leaderboard 만들기 일단 리더보드를 적용하려는 앱의 페이지로 가서 인스턴트 게임 - 리더보드로 들어가주면 다음과 같은 화면이 나옵니다. 리더보드를 특정 컨텍스트에 대해서만으로 제한하려면 컨텍스트 리더보드 옵션을 예로 설정한 후 이름을 지정하고 변경 사항을 저장합니다. (이름은 내부에서만 사용할 것이므로 이름에 대한 고민은 살짝 접어두고 global_leaderboad나 context_leaderboard 식의 이름으로 지정해줍니다.) Cocos cretor에서 코드 작성cc.Class({ extends: cc.Component, properties: { score: 100 }, saveScoreToLeaderBoard: fu..
이 글은 PC 버전 TISTORY에 최적화 되어있습니다. Leaderboard 인스턴트 게임 리더보드 관련 SDKgetLeaderboardAsync( )이 인스턴트 게임에 속한 특정 리더 보드를 가져옵니다.Parametersname string 리더보드의 이름. 인스턴트 게임의 각 리더보드에는 고유한 이름이 있어야함.ExamplesFBInstant.getLeaderboardAsync('my_awesome_leaderboard') .then(leaderboard => { console.log(leaderboard.getName()); // 'my_awesome_leaderboard' });Throws LEADERBOARD_NOT_FOUNDThrows NETWORK_FAILUREThrows CLIENT_UN..
이 글은 PC 버전 TISTORY에 최적화 되어있습니다. context 관련 SDK 현재 게임 컨텍스트에 관련된 함수와 프로퍼티들을 포함함. getID( ) A unique identifier for the current game context. This represents a specific context that the game is being played in (for example, a particular messenger conversation or facebook post). The identifier will be null if game is being played in a solo context. This function should not be called until FBInstant.s..
이 글은 PC 버전 TISTORY에 최적화 되어있습니다. player 관련 SDK 현재 플레이어와 관련된 함수와 프로퍼티들을 포함하고 있습니다. (FBInstant.player로 접근) getID( ) 플레이어를 위한 유니크한 식별자로서 아이디를 줌. 페이스북 유저들의 플레이어 아이디는 지속적으로 페북에 의해 관리되며, 게임에 적용된다고 합니다. 이 함수는 FBInstant.initializeAsync()로부터 resolve를 받기 전에 실행시키지말라고 합니다. (이 부분에 대해서는 수차례 언급하고 있으니 앞으로는 생략하도록 하겠습니다.)Examples// This function should be called after FBInstant.initializeAsync() // resolves. var p..
에반황
'2018/06 글 목록