Difference between revisions of "Gaming"
From GiderosMobile
m |
|||
(19 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | '''Supported platforms:''' android | + | <!-- GIDEROSOBJ:Gaming --> |
+ | '''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]]<br/> | ||
'''Available since:''' Gideros 2012.09<br/> | '''Available since:''' Gideros 2012.09<br/> | ||
+ | |||
=== Description === | === Description === | ||
− | + | The '''Gaming''' class currently supports: | |
− | The | + | *Gaming.new("googleplay") -- Android |
− | + | *Gaming.new("gamekit") -- iOS | |
− | also creates a global class | + | <syntaxhighlight lang="lua"> |
+ | require("gaming") | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Loading the '''gaming''' module also creates a global class '''Gaming'''. | ||
− | + | {|- | |
− | + | | style="width: 50%; vertical-align:top;"| | |
− | |||
− | |||
− | |||
− | | style="width: 50%;"| | ||
=== Methods === | === Methods === | ||
− | [[Gaming.new]] | + | [[Gaming.new]] ''instantiate the Gaming plugin''<br/><!--GIDEROSMTD:Gaming.new(backend) instantiate the Gaming plugin--> |
− | [[Gaming:autoMatch]] | + | [[Gaming:autoMatch]] <br/><!--GIDEROSMTD:Gaming:autoMatch()--> |
− | [[Gaming:deleteState]] | + | [[Gaming:deleteState]] ''remove the specified save/state''<br/><!--GIDEROSMTD:Gaming:deleteState(key) remove the specified save/state--> |
− | [[Gaming:getAllPlayers]] | + | [[Gaming:getAllPlayers]] <br/><!--GIDEROSMTD:Gaming:getAllPlayers()--> |
− | [[Gaming:getPlayerId]] | + | [[Gaming:getPlayerId]] ''get the id of current player''<br/><!--GIDEROSMTD:Gaming:getPlayerId() get the id of current player--> |
− | [[Gaming:getPlayerInfo]] | + | [[Gaming:getPlayerInfo]] <br/><!--GIDEROSMTD:Gaming:getPlayerInfo()--> |
− | [[Gaming:getPlayerName]] | + | [[Gaming:getPlayerName]] ''get the name of current player''<br/><!--GIDEROSMTD:Gaming:getPlayerName() get the name of current player--> |
− | [[Gaming:getPlayerPicture]] | + | [[Gaming:getPlayerPicture]] ''get the profile picture of current player''<br/><!--GIDEROSMTD:Gaming:getPlayerPicture() get the profile picture of current player--> |
− | [[Gaming:getPlayerScore]] | + | [[Gaming:getPlayerScore]] ''get the score of current player''<br/><!--GIDEROSMTD:Gaming:getPlayerScore() get the score of current player--> |
− | [[Gaming:incrementAchievement]] | + | [[Gaming:incrementAchievement]] ''increment the progress toward an achievement''<br/><!--GIDEROSMTD:Gaming:incrementAchievement(achievementId,numSteps,immediate) increment the progress toward an achievement--> |
− | [[Gaming:invitePlayers]] | + | [[Gaming:invitePlayers]] <br/><!--GIDEROSMTD:Gaming:invitePlayers()--> |
− | [[Gaming:isLoggedIn]] | + | [[Gaming:isLoggedIn]] ''return the login state in Gaming service''<br/><!--GIDEROSMTD:Gaming:isLoggedIn() return the login state in Gaming service--> |
− | [[Gaming:joinRoom]] | + | [[Gaming:joinRoom]] <br/><!--GIDEROSMTD:Gaming:joinRoom()--> |
− | [[Gaming:loadAchievements]] | + | [[Gaming:loadAchievements]] ''load all achievements''<br/><!--GIDEROSMTD:Gaming:loadAchievements() load all achievements--> |
− | [[Gaming:loadPlayerCenteredScores]] | + | [[Gaming:loadPlayerCenteredScores]] ''load a leaderboard centered on the player''<br/><!--GIDEROSMTD:Gaming:loadPlayerCenteredScores(leaderboardId,timeSpan,collection,maxEntries) load a leaderboard centered on the player--> |
− | [[Gaming:loadScores]] | + | [[Gaming:loadScores]] ''load a leaderboard''<br/><!--GIDEROSMTD:Gaming:loadScores(leaderboardId,timeSpan,collection,maxEntries) load a leaderboard--> |
− | [[Gaming:loadState]] | + | [[Gaming:loadState]] ''load a save/state''<br/><!--GIDEROSMTD:Gaming:loadState(key) load a save/state--> |
− | [[Gaming:login]] | + | [[Gaming:login]] ''log in the Gaming service''<br/><!--GIDEROSMTD:Gaming:login() log in the Gaming service--> |
− | [[Gaming:logout]] | + | [[Gaming:logout]] ''log out of the gaming service''<br/><!--GIDEROSMTD:Gaming:logout() log out of the gaming service--> |
− | [[Gaming:reportAchievement]] | + | [[Gaming:reportAchievement]] ''report an achievement progress''<br/><!--GIDEROSMTD:Gaming:reportAchievement(achievementId,numSteps,immediate) report an achievement progress--> |
− | [[Gaming:reportScore]] | + | [[Gaming:reportScore]] ''report a new score''<br/><!--GIDEROSMTD:Gaming:reportScore(leaderboardId,score,immediate) report a new score--> |
− | [[Gaming:resolveState]] | + | [[Gaming:resolveState]] ''resolve a save/state conflict''<br/><!--GIDEROSMTD:Gaming:resolveState(key,version,data) resolve a save/state conflict--> |
− | [[Gaming:revealAchievement]] | + | [[Gaming:revealAchievement]] ''reveal an achievement''<br/><!--GIDEROSMTD:Gaming:revealAchievement(achievementId,immediate) reveal an achievement--> |
− | [[Gaming:sendTo]] | + | [[Gaming:sendTo]] <br/><!--GIDEROSMTD:Gaming:sendTo()--> |
− | [[Gaming:sendToAll]] | + | [[Gaming:sendToAll]] <br/><!--GIDEROSMTD:Gaming:sendToAll()--> |
− | [[Gaming:showAchievements]] | + | [[Gaming:showAchievements]] ''show the achievements''<br/><!--GIDEROSMTD:Gaming:showAchievements() show the achievements--> |
− | [[Gaming:showInvitations]] | + | [[Gaming:showInvitations]] <br/><!--GIDEROSMTD:Gaming:showInvitations()--> |
− | [[Gaming:showLeaderboard]] | + | [[Gaming:showLeaderboard]] ''show a leaderboard''<br/><!--GIDEROSMTD:Gaming:showLeaderboard(leaderboardId) show a leaderboard--> |
− | [[Gaming:showWaitingRoom]] | + | [[Gaming:showWaitingRoom]] ''display the waiting room''<br/><!--GIDEROSMTD:Gaming:showWaitingRoom() display the waiting room--> |
− | [[Gaming:updateState]] | + | [[Gaming:updateState]] ''update a save/state''<br/><!--GIDEROSMTD:Gaming:updateState(key,data,immediate) update a save/state--> |
− | | style="width: 50%;"| | + | |
+ | |style="width: 50%; vertical-align:top;"| | ||
=== Events === | === Events === | ||
− | [[Event.CONNECTED_TO_ROOM]]<br/> | + | [[Event.CONNECTED_TO_ROOM]]<br/><!--GIDEROSEVT:Event.CONNECTED_TO_ROOM conntectedToRoom--> |
− | [[Event.DATA_RECEIVED]]<br/> | + | [[Event.DATA_RECEIVED]]<br/><!--GIDEROSEVT:Event.DATA_RECEIVED dataReceived--> |
− | [[Event.DISCONNECTED_FROM_ROOM]]<br/> | + | [[Event.DISCONNECTED_FROM_ROOM]]<br/><!--GIDEROSEVT:Event.DISCONNECTED_FROM_ROOM disconntectedFromRoom--> |
− | [[Event.GAME_STARTED]]<br/> | + | [[Event.GAME_STARTED]]<br/><!--GIDEROSEVT:Event.GAME_STARTED gameStarted--> |
− | [[Event.INVITATION_RECEIVED]]<br/> | + | [[Event.INVITATION_RECEIVED]]<br/><!--GIDEROSEVT:Event.INVITATION_RECEIVED invitationReceived--> |
− | [[Event.JOINED_ROOM]]<br/> | + | [[Event.JOINED_ROOM]]<br/><!--GIDEROSEVT:Event.JOINED_ROOM joinedRoom--> |
− | [[Event.LEFT_ROOM]]<br/> | + | [[Event.LEFT_ROOM]]<br/><!--GIDEROSEVT:Event.LEFT_ROOM leftRoom--> |
− | [[Event.LOAD_ACHIEVEMENTS_COMPLETE]]<br/> | + | [[Event.LOAD_ACHIEVEMENTS_COMPLETE]]<br/><!--GIDEROSEVT:Event.LOAD_ACHIEVEMENTS_COMPLETE loadAchievementsComplete--> |
− | [[Event.LOAD_ACHIEVEMENTS_ERROR]]<br/> | + | [[Event.LOAD_ACHIEVEMENTS_ERROR]]<br/><!--GIDEROSEVT:Event.LOAD_ACHIEVEMENTS_ERROR loadAchievementsError--> |
− | [[Event.LOAD_SCORES_COMPLETE]]<br/> | + | [[Event.LOAD_SCORES_COMPLETE]]<br/><!--GIDEROSEVT:Event.LOAD_SCORES_COMPLETE loadScoresComplete--> |
− | [[Event.LOAD_SCORES_ERROR]]<br/> | + | [[Event.LOAD_SCORES_ERROR]]<br/><!--GIDEROSEVT:Event.LOAD_SCORES_ERROR loadScoresComplete--> |
− | [[Event.LOGIN_COMPLETE]]<br/> | + | [[Event.LOGIN_COMPLETE]]<br/><!--GIDEROSEVT:Event.LOGIN_COMPLETE loginComplete--> |
− | [[Event.LOGIN_ERROR]]<br/> | + | [[Event.LOGIN_ERROR]]<br/><!--GIDEROSEVT:Event.LOGIN_ERROR loginError--> |
− | [[Event.PEER_CONNECTED]]<br/> | + | [[Event.PEER_CONNECTED]]<br/><!--GIDEROSEVT:Event.PEER_CONNECTED peerConnected--> |
− | [[Event.PEER_DECLINED]]<br/> | + | [[Event.PEER_DECLINED]]<br/><!--GIDEROSEVT:Event.PEER_DECLINED peerDeclined--> |
− | [[Event.PEER_DISCONNECTED]]<br/> | + | [[Event.PEER_DISCONNECTED]]<br/><!--GIDEROSEVT:Event.PEER_DISCONNECTED peerDisconnected--> |
− | [[Event.PEER_INVITED]]<br/> | + | [[Event.PEER_INVITED]]<br/><!--GIDEROSEVT:Event.PEER_INVITED peerInvited--> |
− | [[Event.PEER_JOINED]]<br/> | + | [[Event.PEER_JOINED]]<br/><!--GIDEROSEVT:Event.PEER_JOINED peerJoined--> |
− | [[Event.PEER_LEFT]]<br/> | + | [[Event.PEER_LEFT]]<br/><!--GIDEROSEVT:Event.PEER_LEFT peerLeft--> |
− | [[Event.PLAYER_INFORMATION_COMPLETE]]<br/> | + | [[Event.PLAYER_INFORMATION_COMPLETE]]<br/><!--GIDEROSEVT:Event.PLAYER_INFORMATION_COMPLETE playerInformationComplete--> |
− | [[Event.PLAYER_INFORMATION_ERROR]]<br/> | + | [[Event.PLAYER_INFORMATION_ERROR]]<br/><!--GIDEROSEVT:Event.PLAYER_INFORMATION_ERROR playerInformationError--> |
− | [[Event.PLAYER_SCORE_COMPLETE]]<br/> | + | [[Event.PLAYER_SCORE_COMPLETE]]<br/><!--GIDEROSEVT:Event.PLAYER_SCORE_COMPLETE playerScoreComplete--> |
− | [[Event.PLAYER_SCORE_ERROR]]<br/> | + | [[Event.PLAYER_SCORE_ERROR]]<br/><!--GIDEROSEVT:Event.PLAYER_SCORE_ERROR playerScoreError--> |
− | [[Event.REPORT_ACHIEVEMENT_COMPLETE]]<br/> | + | [[Event.REPORT_ACHIEVEMENT_COMPLETE]]<br/><!--GIDEROSEVT:Event.REPORT_ACHIEVEMENT_COMPLETE reportAchievementComplete--> |
− | [[Event.REPORT_ACHIEVEMENT_ERROR]]<br/> | + | [[Event.REPORT_ACHIEVEMENT_ERROR]]<br/><!--GIDEROSEVT:Event.REPORT_ACHIEVEMENT_ERROR reportAchievementError--> |
− | [[Event.REPORT_SCORE_COMPLETE]]<br/> | + | [[Event.REPORT_SCORE_COMPLETE]]<br/><!--GIDEROSEVT:Event.REPORT_SCORE_COMPLETE reportScoreComplete--> |
− | [[Event.REPORT_SCORE_ERROR]]<br/> | + | [[Event.REPORT_SCORE_ERROR]]<br/><!--GIDEROSEVT:Event.REPORT_SCORE_ERROR reportScoreError--> |
− | [[Event.ROOM_AUTO_MATCHING]]<br/> | + | [[Event.ROOM_AUTO_MATCHING]]<br/><!--GIDEROSEVT:Event.ROOM_AUTO_MATCHING roomAutoMatching--> |
− | [[Event.ROOM_CONNECTED]]<br/> | + | [[Event.ROOM_CONNECTED]]<br/><!--GIDEROSEVT:Event.ROOM_CONNECTED roomConnected--> |
− | [[Event.ROOM_CONNECTING]]<br/> | + | [[Event.ROOM_CONNECTING]]<br/><!--GIDEROSEVT:Event.ROOM_CONNECTING roomConnecting--> |
− | [[Event.ROOM_CREATED]]<br/> | + | [[Event.ROOM_CREATED]]<br/><!--GIDEROSEVT:Event.ROOM_CREATED roomCreated--> |
− | [[Event.STATE_CONFLICT]]<br/> | + | [[Event.STATE_CONFLICT]]<br/><!--GIDEROSEVT:Event.STATE_CONFLICT stateConflict--> |
− | [[Event.STATE_DELETED]]<br/> | + | [[Event.STATE_DELETED]]<br/><!--GIDEROSEVT:Event.STATE_DELETED stateDeleted--> |
− | [[Event.STATE_ERROR]]<br/> | + | [[Event.STATE_ERROR]]<br/><!--GIDEROSEVT:Event.STATE_ERROR stateError--> |
− | [[Event.STATE_LOADED]]<br/> | + | [[Event.STATE_LOADED]]<br/><!--GIDEROSEVT:Event.STATE_LOADED stateLoaded--> |
=== Constants === | === Constants === | ||
− | [[Gaming.ALL_PLAYERS]]<br/> | + | [[Gaming.ALL_PLAYERS]]<br/><!--GIDEROSCST:Gaming.ALL_PLAYERS 1--> |
− | [[Gaming.ALL_TIME]]<br/> | + | [[Gaming.ALL_TIME]]<br/><!--GIDEROSCST:Gaming.ALL_TIME 2--> |
− | [[Gaming.FRIENDS]]<br/> | + | [[Gaming.FRIENDS]]<br/><!--GIDEROSCST:Gaming.FRIENDS 0--> |
− | [[Gaming.HIDDEN]]<br/> | + | [[Gaming.HIDDEN]]<br/><!--GIDEROSCST:Gaming.HIDDEN 2--> |
− | [[Gaming.REVEALED]]<br/> | + | [[Gaming.REVEALED]]<br/><!--GIDEROSCST:Gaming.REVEALED 1--> |
− | [[Gaming.TODAY]]<br/> | + | [[Gaming.TODAY]]<br/><!--GIDEROSCST:Gaming.TODAY 0--> |
− | [[Gaming.UNLOCKED]]<br/> | + | [[Gaming.UNLOCKED]]<br/><!--GIDEROSCST:Gaming.UNLOCKED 0--> |
− | [[Gaming.WEEK]]<br/> | + | [[Gaming.WEEK]]<br/><!--GIDEROSCST:Gaming.WEEK 1--> |
|} | |} | ||
+ | |||
+ | {{GIDEROS IMPORTANT LINKS}} |
Latest revision as of 21:42, 7 December 2023
Supported platforms:
Available since: Gideros 2012.09
Description
The Gaming class currently supports:
- Gaming.new("googleplay") -- Android
- Gaming.new("gamekit") -- iOS
require("gaming")
Loading the gaming module also creates a global class Gaming.