You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

279 lines
9.7 KiB

  1. local designSize = cc.size(1280,720)
  2. local config = {}
  3. config.HANDCARD_VIEW = "mj.luaScript.Common.2d.CommonHandCard"
  4. config.MAHJONG_CARD = "mj.luaScript.Common.2d.CommonMahjongCard"
  5. config.OUTCARD_VIEW = "mj.luaScript.Common.2d.CommonOutCardView"
  6. config.HU_CARD_VIEW = "mj.luaScript.Common.2d.CommonHuCardView"
  7. config.GROUP_CHI = "mj.luaScript.Common.2d.CommonGroupChi"
  8. config.GROUP_PENG = "mj.luaScript.Common.2d.CommonGroupPeng"
  9. config.GROUP_GANG = "mj.luaScript.Common.2d.CommonGroupGang"
  10. config.GROUP_ANGANG = "mj.luaScript.Common.2d.CommonGroupAnGang"
  11. config.GROUP_BAGANG = "mj.luaScript.Common.2d.CommonGroupBaGang"
  12. -- 麻将牌类型
  13. config.MJType = {
  14. Stand = 1, -- 标准牌
  15. Out = 2, -- 出去的牌
  16. OutBlack = 3, -- 出去盖着的牌
  17. Operate = 4, -- 操作的牌 吃碰杠
  18. OperateBlack = 5, -- 操作的牌背面,伪3d需要
  19. Hu = 6, -- 胡牌正面,伪3d需要
  20. HuBlack = 7, -- 胡牌背面,伪3d需要
  21. Open = 8, -- 摊牌正面,伪3d需要
  22. OpenBlack = 9, -- 摊牌背面,伪3d需要
  23. }
  24. config.OutCardRowCount={
  25. -- 2人场
  26. [2] = {
  27. [1] = 10, [2] = 22, [3] = 10, [4] = 22,
  28. },
  29. -- 3人场
  30. [3] = {
  31. [1] = 11, [2] = 11, [3] = 11, [4] = 11,
  32. },
  33. -- 4人场
  34. [4] = {
  35. [1] = 11, [2] = 11, [3] = 11, [4] = 11,
  36. },
  37. }
  38. --麻将标准手牌图片
  39. config.MJStandImage={
  40. [1]="mj_2d_handcard_right.png",
  41. [2]="mj_2d_handcard_top.png",
  42. [3]="mj_2d_handcard_left.png",
  43. [4]="mj_2d_handcard_mine.png",
  44. }
  45. --麻将出牌图片
  46. config.MJOutImage={
  47. [1]="mj_2d_outcard_right.png",
  48. [2]="mj_2d_outcard_mine.png",
  49. [3]="mj_2d_outcard_right.png",
  50. [4]="mj_2d_outcard_mine.png",
  51. }
  52. config.MJHuImage = {
  53. [1]="mj_2d_outcard_right.png",
  54. [2]="mj_2d_outcard_mine.png",
  55. [3]="mj_2d_outcard_right.png",
  56. [4]="mj_2d_outcard_mine.png",
  57. }
  58. config.MJHuScale = {
  59. [1] = 0.8, [2] = 0.8, [3] = 0.8, [4] = 0.8,
  60. }
  61. --麻将操作图片
  62. config.MJOperateGroupImage={
  63. [1]="mj_2d_outcard_right.png",
  64. [2]="mj_2d_outcard_mine.png",
  65. [3]="mj_2d_outcard_right.png",
  66. [4]="mj_2d_opcard_mine.png",
  67. }
  68. --麻将背牌图片
  69. config.MJOutBlackImage={
  70. [1]="mj_2d_cardback_right.png",
  71. [2]="mj_2d_cardback_top.png",
  72. [3]="mj_2d_cardback_right.png",
  73. [4]="mj_2d_cardback_top.png",
  74. }
  75. --麻将组合背牌图片
  76. config.MJOperateBlackImage={
  77. [1]="mj_2d_cardback_right.png",
  78. [2]="mj_2d_cardback_top.png",
  79. [3]="mj_2d_cardback_right.png",
  80. [4]="mj_2d_cardback_mine.png",
  81. }
  82. -- 手牌起始位置
  83. config.HandCardStartPos = {
  84. [1] = {x = (designSize.width - 160)*g_radio_x, y = (170-10)*g_radio_y},
  85. [2] = {x = (designSize.width / 2 + 290)*g_radio_x, y = (designSize.height - 45)*g_radio_y},
  86. [3] = {x = 160*g_radio_x, y = (designSize.height - 90)*g_radio_y},
  87. [4] = {x = 70+(designSize.width*g_radio_x-designSize.width)/2, y = 60},
  88. }
  89. config.HandCardStartPosOfCardNum = {
  90. [7] = {
  91. [1] = {x = (designSize.width - 160) * g_radio_x, y = 250 * g_radio_y},
  92. [2] = {x = (designSize.width / 2 + 290) * g_radio_x - 150, y = (designSize.height - 45)*g_radio_y},
  93. [3] = {x = 160 * g_radio_x, y = (designSize.height - 150)*g_radio_y},
  94. [4] = {x = 350+(designSize.width*g_radio_x-designSize.width)/2, y = 60},
  95. },
  96. [10] = {
  97. [1] = {x = (designSize.width - 160)*g_radio_x, y = (170-10)*g_radio_y},
  98. [2] = {x = (designSize.width / 2 + 290)*g_radio_x - 130, y = (designSize.height - 45)*g_radio_y},
  99. [3] = {x = 160*g_radio_x, y = (designSize.height - 90)*g_radio_y},
  100. [4] = {x = 200+(designSize.width*g_radio_x-designSize.width)/2, y = 60},
  101. },
  102. [13] = {
  103. [1] = {x = (designSize.width - 160)*g_radio_x, y = (170-10)*g_radio_y},
  104. [2] = {x = (designSize.width / 2 + 290)*g_radio_x, y = (designSize.height - 45)*g_radio_y},
  105. [3] = {x = 160*g_radio_x, y = (designSize.height - 90)*g_radio_y},
  106. [4] = {x = 70+(designSize.width*g_radio_x-designSize.width)/2, y = 60},
  107. },
  108. }
  109. -- 手牌每个麻将子偏移量
  110. -- HandCardOffset[viewId].x
  111. config.HandCardOffsetPos = {
  112. [1] = {x = 0, y = -32},
  113. [2] = {x = -2, y = 0},
  114. [3] = {x = 0, y = -32},
  115. [4] = {x = -1, y = 0},
  116. }
  117. -- 组合牌坐标调整
  118. -- GroupOffsetConfig[viewId].x
  119. config.GroupOffsetConfig = {
  120. [1] = {x = 0, y = 116+2},
  121. [2] = {x = 140, y = 0},
  122. [3] = {x = 0, y = 116+2},
  123. [4] = {x = 200, y = 0},
  124. }
  125. -- 组合牌每张牌偏移量
  126. -- GroupCardOffsetConfig[viewId][cardIndex].x
  127. config.GroupCardOffsetConfig = {
  128. [1] = {
  129. [1] = {x = 0, y = -14},
  130. [2] = {x = 0, y = -14},
  131. [3] = {x = 0, y = -14},
  132. [4] = {x = 0, y = -35},
  133. },
  134. [2] = {
  135. [1] = {x = -2, y = 0},
  136. [2] = {x = -2, y = 0},
  137. [3] = {x = -2, y = 0},
  138. [4] = {x = -31, y = 15},
  139. },
  140. [3] = {
  141. [1] = {x = 0, y = -14},
  142. [2] = {x = 0, y = -14},
  143. [3] = {x = 0, y = -14},
  144. [4] = {x = 0, y = -43},
  145. },
  146. [4] = {
  147. [1] = {x = 0, y = -22},
  148. [2] = {x = -3, y = -22},
  149. [3] = {x = -3, y = -22},
  150. [4] = {x = -43.8, y = -2},
  151. },
  152. }
  153. -- 出牌区起始位置,每个玩家视角左上角第一颗麻将子的位置
  154. config.OutCardStartPos = {
  155. [1] = {x = (designSize.width / 2 + 273)*g_radio_x, y = (designSize.height / 2 - 145)*g_radio_y},
  156. [2] = {x = (designSize.width / 2 + 220)*g_radio_x, y = (designSize.height / 2 + 144 - 11)*g_radio_y},
  157. [3] = {x = (designSize.width / 2 - 272)*g_radio_x, y = (designSize.height / 2 + 225)*g_radio_y},
  158. [4] = {x = (designSize.width / 2 - 220)*g_radio_x, y = (designSize.height / 2 - 90 + 10)*g_radio_y},
  159. }
  160. config.OutCardStartPos2 = {
  161. [2] = {x = (designSize.width / 2 + 460)*g_radio_x, y = (designSize.height / 2 + 134)*g_radio_y},
  162. [4] = {x = (designSize.width / 2 - 464)*g_radio_x, y = (designSize.height / 2 - 58)*g_radio_y},
  163. }
  164. -- 出牌区每颗麻将子的位置
  165. -- 对应的x、y
  166. config.OutCardOffsetConfig = {
  167. [1] = {x = -2, y = -14},
  168. [2] = {x = -1, y = -12},
  169. [3] = {x = -2, y = -14},
  170. [4] = {x = -1, y = -12},
  171. }
  172. -- 出牌区每颗麻将子的位置
  173. -- 对应的x、y
  174. config.OutCardOffsetConfig2 = {
  175. [2] = {x = -1, y = -12},
  176. [4] = {x = -1, y = -12},
  177. }
  178. config.OpenCardOffsetConfig = {
  179. [1] = {x = 0, y = -14},
  180. [2] = {x = -2, y = 0},
  181. [3] = {x = 0, y = -14},
  182. [4] = {x = 0, y = 0},
  183. }
  184. config.HandCardFaceOffsetConfig = {
  185. [1] = {x = 0, y = 0, scale = 1.0, rotation = 90},
  186. [2] = {x = 0, y = 0, scale = 1.0, rotation = 0},
  187. [3] = {x = 0, y = 0, scale = 1.0, rotation = -90},
  188. [4] = {x = 0, y = -4, scale = 1.0, rotation = 0},
  189. }
  190. config.OpenCardFaceOffsetConfig = {
  191. [1] = {x = 0, y = 8, scale = 0.5, rotation = 90},
  192. [2] = {x = 0, y = 8, scale = 0.5, rotation = 0},
  193. [3] = {x = 0, y = 8, scale = 0.5, rotation = -90},
  194. [4] = {x = 0, y = 0, scale = 1.0, rotation = 0},
  195. }
  196. -- 出牌区起始位置,每个玩家视角左上角第一颗麻将子的位置
  197. config.HuXueliuCardStartPos = {
  198. --[[[1] = {x = (designSize.width / 2 + 273)*g_radio_x, y = (designSize.height / 2 - 145)*g_radio_y},
  199. [2] = {x = (designSize.width / 2 + 220)*g_radio_x, y = (designSize.height / 2 + 144)*g_radio_y},
  200. [3] = {x = (designSize.width / 2 - 272)*g_radio_x, y = (designSize.height / 2 + 225)*g_radio_y},
  201. [4] = {x = (designSize.width / 2 - 220)*g_radio_x, y = (designSize.height / 2 - 90)*g_radio_y},--]]
  202. [1] = {x = (designSize.width / 2 + 273 + 66 * 2)*g_radio_x, y = (designSize.height / 2 - 145)*g_radio_y},
  203. [2] = {x = (designSize.width / 2 + 220)*g_radio_x, y = (designSize.height / 2 + 144 + 66 * 2 - 20)*g_radio_y},
  204. [3] = {x = (designSize.width / 2 - 272 - 66 * 2)*g_radio_x, y = (designSize.height / 2 + 225)*g_radio_y},
  205. [4] = {x = (designSize.width / 2 - 220)*g_radio_x, y = (designSize.height / 2 - 90 - 66 * 2 + 14)*g_radio_y},
  206. }
  207. config.HuXueliuCardStartPos2 = {
  208. --[[[2] = {x = (designSize.width / 2 + 460)*g_radio_x, y = (designSize.height / 2 + 134)*g_radio_y},
  209. [4] = {x = (designSize.width / 2 - 464)*g_radio_x, y = (designSize.height / 2 - 58)*g_radio_y},--]]
  210. [2] = {x = (designSize.width / 2 + 220)*g_radio_x, y = (designSize.height / 2 + 134 + 66* 2 - 12)*g_radio_y},
  211. [4] = {x = (designSize.width / 2 - 220)*g_radio_x, y = (designSize.height / 2 - 58 - 66 * 2)*g_radio_y},
  212. }
  213. config.HuCardStartPos = {
  214. [1] = {x = (designSize.width / 2 + 420)*g_radio_x, y = (designSize.height / 2 + 250)*g_radio_y},
  215. [2] = {x = (designSize.width / 2 - 235)*g_radio_x, y = (designSize.height / 2 + 250)*g_radio_y},
  216. [3] = {x = (designSize.width / 2 - 420)*g_radio_x, y = (designSize.height / 2 - 170)*g_radio_y},
  217. [4] = {x = (designSize.width / 2 + 333)*g_radio_x, y = 150*g_radio_y},
  218. }
  219. config.HuCardOffsetPos = {
  220. [1] = {x = -13, y = -21},
  221. [2] = {x = -10, y = -23},
  222. [3] = {x = -13, y = -21},
  223. [4] = {x = -10, y = -23},
  224. }
  225. config.HuCardRowCount = {
  226. [1] = 15, [2] = 15, [3] = 15, [4] = 20,
  227. }
  228. -- 出牌区牌面偏移量配置
  229. config.OutCardFaceOffsetConfig = {
  230. [1] = {x = 0, y = 7, scale = 0.5, rotation = 90},
  231. [2] = {x = 0, y = 6, scale = 0.5, rotation = 0},
  232. [3] = {x = 0, y = 7, scale = 0.5, rotation = -90},
  233. [4] = {x = 0, y = 6, scale = 0.5, rotation = 0},
  234. }
  235. -- 胡牌区牌面偏移量配置
  236. config.HuCardFaceOffsetConfig = {
  237. [1] = {x = 0, y = 8, scale = 0.5, rotation = 90},
  238. [2] = {x = 0, y = 8, scale = 0.5, rotation = 0},
  239. [3] = {x = 0, y = 8, scale = 0.5, rotation = -90},
  240. [4] = {x = 0, y = 8, scale = 0.5, rotation = 0},
  241. }
  242. config.OpCardFaceOffsetConfig = {
  243. [1] = {x = 0, y = 7, scale = 0.5, rotation = 90},
  244. [2] = {x = 0, y = 6, scale = 0.5, rotation = 0},
  245. [3] = {x = 0, y = 7, scale = 0.5, rotation = -90},
  246. [4] = {x = 0, y = 10, scale = 0.7, rotation = 0},
  247. }
  248. return config