資源簡介
1、基于NODEJS+MYSQL的服務器,成熟的技術方案,高效穩定,且方便Windows開發,Linux平臺布署,節約服務器運轉成本。
2、采用最新版本的cocos引擎,cocos creator開發,可快速的進行界面調整。且能夠快速地發布iOS,Android版本。
3、如需H5版本,只需針對H5平臺進行資源優化即可。
4、成熟可靠的房卡式設計,能滿足大部分用戶使用體驗。
5、產品經過大量測試,可以運轉穩定。
客戶端使用Cocos Creator 1.3.2開發
服務器使用NodeJS 4.6.0
MYSQL使用MySQL 5.1.x
代碼片段和文件信息
#!python
import?ossys
from?xml.etree?import?ElementTree
from?PIL?import?Image
def?tree_to_dict(tree):
????d?=?{}
????for?index?item?in?enumerate(tree):
????????if?item.tag?==?‘key‘:
????????????if?tree[index+1].tag?==?‘string‘:
????????????????d[item.text]?=?tree[index?+?1].text
????????????elif?tree[index?+?1].tag?==?‘true‘:
????????????????d[item.text]?=?True
????????????elif?tree[index?+?1].tag?==?‘false‘:
????????????????d[item.text]?=?False
????????????elif?tree[index+1].tag?==?‘dict‘:
????????????????d[item.text]?=?tree_to_dict(tree[index+1])
????return?d
def?gen_png_from_plist(plist_filename?png_filename):
????file_path?=?plist_filename.replace(‘.plist‘?‘‘)
????big_image?=?Image.open(png_filename)
????root?=?ElementTree.fromstring(open(plist_filename?‘r‘).read())
????plist_dict?=?tree_to_dict(root[0])
????to_list?=?lambda?x:?x.replace(‘{‘‘‘).replace(‘}‘‘‘).split(‘‘)
????for?kv?in?plist_dict[‘frames‘].items():
????????rectlist?=?to_list(v[‘frame‘])
????????width?=?int(?rectlist[3]?if?v[‘rotated‘]?else?rectlist[2]?)
????????height?=?int(?rectlist[2]?if?v[‘rotated‘]?else?rectlist[3]?)
????????box=(?
????????????int(rectlist[0])
????????????int(rectlist[1])
????????????int(rectlist[0])?+?width
????????????int(rectlist[1])?+?height
????????????)
????????sizelist?=?[?int(x)?for?x?in?to_list(v[‘sourceSize‘])]
????????rect_on_big?=?big_image.crop(box)
????????if?v[‘rotated‘]:
????????????rect_on_big?=?rect_on_big.rotate(90)
????????result_image?=?Image.new(‘RGBA‘?sizelist?(0000))
????????if?v[‘rotated‘]:
????????????result_box=(
????????????????(?sizelist[0]?-?height?)/2
????????????????(?sizelist[1]?-?width?)/2
????????????????(?sizelist[0]?+?height?)/2
????????????????(?sizelist[1]?+?width?)/2
????????????????)
????????else:
????????????result_box=(
????????????????(?sizelist[0]?-?width?)/2
????????????????(?sizelist[1]?-?height?)/2
????????????????(?sizelist[0]?+?width?)/2
????????????????(?sizelist[1]?+?height?)/2
????????????????)
????????result_image.paste(rect_on_big?result_box?mask=0)
????????if?not?os.path.isdir(file_path):
????????????os.mkdir(file_path)
????????outfile?=?(file_path+‘/‘?+?k).replace(‘gift_‘?‘‘)
????????print?outfile?“generated“
????????result_image.save(outfile)
if?__name__?==?‘__main__‘:
????filename?=?sys.argv[1]
????plist_filename?=?filename?+?‘.plist‘
????png_filename?=?filename?+?‘.png‘
????if?(os.path.exists(plist_filename)?and?os.path.exists(png_filename)):
????????gen_png_from_plist(?plist_filename?png_filename?)
????else:
????????print?“make?sure?you?have?boith?plist?and?png?files?in?the?same?directory“
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-07-28?10:07??cocos?Creator?js?房卡麻將\
?????目錄???????????0??2017-07-28?10:07??cocos?Creator?js?房卡麻將\ddmj_20161230\
?????目錄???????????0??2017-07-28?10:07??cocos?Creator?js?房卡麻將\ddmj_20161230\client\
?????文件????????1482??2016-12-02?00:32??cocos?Creator?js?房卡麻將\ddmj_20161230\client\.gitignore
?????文件??????????48??2016-12-02?00:28??cocos?Creator?js?房卡麻將\ddmj_20161230\client\README.md
?????文件?????????747??2016-12-02?00:27??cocos?Creator?js?房卡麻將\ddmj_20161230\client\README_copy.md
?????文件????????7680??2017-02-27?03:09??cocos?Creator?js?房卡麻將\ddmj_20161230\client\Thumbs.db
?????目錄???????????0??2017-07-28?10:07??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\
?????文件??????260070??2016-12-02?00:32??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\Icon.png
?????文件?????????677??2017-01-18?18:24??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\Icon.png.me
?????文件???????12288??2017-02-27?03:09??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\Thumbs.db
?????目錄???????????0??2017-07-28?10:07??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\
?????文件????????1594??2016-08-28?22:51??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\angry.anim
?????文件??????????88??2017-01-18?18:24??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\angry.anim.me
?????文件?????????870??2016-12-25?12:55??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\dingque_tuijian.anim
?????文件??????????88??2017-01-18?18:24??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\dingque_tuijian.anim.me
?????文件?????????939??2016-08-28?22:52??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\fennu.anim
?????文件??????????88??2017-01-18?18:24??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\fennu.anim.me
?????文件????????1601??2016-10-30?19:39??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\guafeng.anim
?????文件??????????88??2017-01-18?18:24??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\guafeng.anim.me
?????文件?????????616??2016-08-28?22:52??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\han.anim
?????文件??????????88??2017-01-18?18:24??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\han.anim.me
?????文件?????????618??2016-08-28?22:53??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\happy.anim
?????文件??????????88??2017-01-18?18:24??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\happy.anim.me
?????文件????????1597??2016-08-28?22:53??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\huaixiao.anim
?????文件??????????88??2017-01-18?18:24??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\huaixiao.anim.me
?????文件????????1258??2016-08-28?22:48??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\jiong.anim
?????文件??????????88??2017-01-18?18:24??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\jiong.anim.me
?????文件????????2402??2016-08-28?22:49??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\lihai.anim
?????文件??????????88??2017-01-18?18:24??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\lihai.anim.me
?????文件????????2802??2016-12-06?21:00??cocos?Creator?js?房卡麻將\ddmj_20161230\client\assets\anims\play_gang.anim
............此處省略8175個文件信息
評論
共有 條評論