用于3D和2D游戏的C++扩展Firebase。

igeFirebase的Python项目详细描述


igeFirebase公司

< P> C++扩展Firebase的3D和2D游戏。在

在运行本教程之前,您必须安装igeFirebase

[pip install igeFirebase]

可用库

^{pr2}$

功能

火力基地

  • 首先,您需要导入并初始化firebase系统
     import igeFirebase
     igeFirebase.init()
    
  • 一切都做完了就放了
     igeFirebase.release()
    

Firebase Admob

https://firebase.google.com/docs/admob/cpp/quick-start

  • 首先,初始化firebase admob系统

    • 遵循以下结构:“adMobApp”,“bannerSize”,“gender”,“childDirectedTreatment”,“关键字”,“生日”,“testDevicesIds”
    • 支持元组
     fb_admob = igeFirebase.admob()
     fb_admob.init(("ca-app-pub-1009273426450955~3020262852", "ca-app-pub-3940256099942544/6300978111", "ca-app-pub-3940256099942544/1033173712", "ca-app-pub-3940256099942544/2888167318"), (320, 50), 1, 1, ("game", "games", "gamess", "gamesss"), (12, 11, 1988), ("112F1C63CDDE8BAAEE287FDE3BA4C662",))
    
  • 显示广告

    • Banner
    PositionMoveTo Enum
    Top of the screen, horizontally centered.kPositionTop = 0,
    Bottom of the screen, horizontally centered.kPositionBottom,
    Top-left corner of the screen.kPositionTopLeft,
    Top-right corner of the screen.kPositionTopRight,
    Bottom-left corner of the screen.kPositionBottomLeft,
    Bottom-right corner of the screen.kPositionBottomRight,
     fb_admob.showBanner()
     fb_admob.bannerMoveTo(0)
     fb_admob.bannerMoveTo(1)
     fb_admob.bannerMoveTo(2)
     fb_admob.bannerMoveTo(3)
     fb_admob.bannerMoveTo(4)
     fb_admob.bannerMoveTo(5)
     fb_admob.hideBanner()
    
    • 填空
     fb_admob.showInterstitial()
    
    • RewardedVideo
     fb_admob.showRewardedVideo()
     fb_admob.pauseRewardedVideo()
     fb_admob.resumeRewardedVideo()
    
  • 完成所有操作后释放它

     fb_admob.release()
    

Firebase分析

https://firebase.google.com/docs/analytics/cpp/events

  • 首先,初始化firebase admob系统
     fb_analytics = igeFirebase.analytics()
     fb_analytics.init()
    
  • 发送事件
     fb_analytics.setUserProperty("sign_up_method", "google")
     fb_analytics.setUserId("uber_user_510")
     fb_analytics.setCurrentScreen("Firebase Analytics C++ testapp", "testapp")
    
     fb_analytics.logEvent("login")
     fb_analytics.logEvent("progress", "percent", 0.4)
     fb_analytics.logEvent("post_score", "score", 42)
     fb_analytics.logEvent("join_group", "group_id", "spoon_welders")
    
     levelUpParameters = (("level", 5), ("character", "mrspoon"), ("hit_accuracy", 3.14))
     fb_analytics.logEvent("level_up", levelUpParameters)
    
  • 完成所有操作后释放它
     fb_analytics.release()
    

Firebase身份验证

https://firebase.google.com/docs/auth/cpp/start

  • 首先,初始化firebase admob系统
     fb_auth = igeFirebase.auth()
     fb_auth.init()
    
  • Authenticate
     print('signInWithEmailAndPassword : ' + str(fb_auth.signInWithEmailAndPassword("doan.do@indigames.net", "doan.do")))
     print('isPlayerAuthenticated : ' + str(fb_auth.isPlayerAuthenticated()))
    
     print('signOut : ' + str(fb_auth.signOut()))
     print('isPlayerAuthenticated : ' + str(fb_auth.isPlayerAuthenticated()))
    
     print('registerWithEmailAndPassword : ' + str(fb_auth.registerWithEmailAndPassword("dodoan.it@gmail.com", "indigames")))
     print('isPlayerAuthenticated : ' + str(fb_auth.isPlayerAuthenticated()))
    
  • 完成所有操作后释放它
     fb_auth.release()
    

Firebase MLKit

https://firebase.google.com/docs/ml-kit

  • First,初始化firebase mlkit系统
     fb_mlkit = igeFirebase.mlKit()
     fb_mlkit.init(mode)	// 1 = FAST ; 2 = ACCURATE
    
  • API
     fb_mlkit.getCameraSize()				// result : tuple(w, h)
     fb_mlkit.getCameraData()				// result : list(unsigned char)
     fb_mlkit.getContours					// result : list(float)
     fb_mlkit.getLeftEyeOpenProbability		// Returns a value between 0.0 and 1.0 giving a probability that the face's left eye is open
     fb_mlkit.getRightEyeOpenProbability		// Returns a value between 0.0 and 1.0 giving a probability that the face's right eye is open
    
  • 完成所有操作后释放它
     fb_mlkit.release()
    

Firebase Firestore

  • callback

     def FirestoreGetCB(self, collection, field, value):
         print(self, 'get --- collection=' + collection + ' field=' + str(field) + ' value=' + str(value))
    
     def FirestoreSetCB(self, collection, field, value):
         print(self, 'set --- collection=' + collection + ' field=' + str(field) + ' value=' + str(value))
    
     def FirestoreDeleteCB(self, collection, field=None, value=None):
         print(self, 'del --- collection=' + collection + ' field=' + str(field) + ' value=' + str(value))
    
  • get

    get data with Cloud Firestore

    firestore().get(collection, field, callback)

    collection : string

    field : string or None

    callback : function(collection, field, value)

    value : (string, int, double, dictionary)

    示例

     igeFirebase.firestore().get("users", "str_s", self.FirestoreGetCB)
     igeFirebase.firestore().get("users", "int_s", self.FirestoreGetCB)
     igeFirebase.firestore().get("users", "double_s", self.FirestoreGetCB)
     igeFirebase.firestore().get("users", "bool_s", self.FirestoreGetCB)
     igeFirebase.firestore().get("users", "map_s", self.FirestoreGetCB)
     igeFirebase.firestore().get("users", None, self.FirestoreGetCB)
    
  • set

    add data to Cloud Firestore

    firestore().set(collection, field, value, callback, timestamp)

    collection : string

    field : string

    value : (string, int, double, dictionary)

    callback : optional function(collection, field, result)

    timestamp : bool(optinal)

    示例

    ^{pr21}$ 在
  • delete

    delete data from Cloud Firestore

    firestore().delete(collection, field, callback)

    collection : string

    field : string or None

    callback : optional function(collection, field, result)

    示例

     igeFirebase.firestore().delete("users", "bool_s", self.FirestoreDeleteCB)
     igeFirebase.firestore().delete("users", None, self.FirestoreDeleteCB)
    

注释

- Firebase C++ SDK desktop support is a beta feature so only a subset of features supported for now.
	- Authentication
	- Cloud Functions
	- Cloud Storage
	- Realtime Database
	- Remote Config
	- Firestore [TODO]

参考

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
接收com。太阳媒体声音Java中来自MIDI控制器的FastShortMessage,如何解码?   JAVA日志记录:当日志文件将要滚动时,应用程序将暂停   java如何使用循环来重复函数选择   java OpenJPA和存储过程,Weblogic 12c   编码风格什么是正确的方式来使用。Java中的equals方法?   通过tcpsocket将xml从java发送到C#   java对象比JTable效率更高   java在运行时删除标志\半透明\状态   java将一个数均匀随机地分成m个部分   链表的Java数组   javajaxws:在数据库中记录请求和响应   java maven,执行标记,缺少id标记   泛型类中的java泛型转换