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.

52 lines
1.3 KiB

  1. local MJ=MJFramework.MJFrameworkClassImprot("mj.luaScript.Views.Game.MJ")
  2. local hongzhong=class("hongzhong",MJ)
  3. local MJDefine=MJFramework.MJImport("mj.luaScript.MJDefine")
  4. function hongzhong:ctor(...)
  5. hongzhong.super.ctor(self,...)
  6. self.dltx , self.dlty = 0, 0
  7. end
  8. function hongzhong:initSortValue(value)
  9. if value==0x41 then --红中的排序值修改
  10. self.sortValue=0x00
  11. else
  12. self.sortValue=value
  13. end
  14. end
  15. function hongzhong:recordPostion(initY)
  16. hongzhong.super.recordPostion(self, initY)
  17. self.dltx , self.dlty = 0, 0
  18. end
  19. -- 初始触摸偏移
  20. function hongzhong:checkDltPos( pt )
  21. local dltx = pt.x - self.initPostion.x
  22. local dlty = pt.y - self.initPostion.y
  23. self.dltx , self.dlty = dltx, dlty
  24. end
  25. function hongzhong:getDltPos()
  26. return self.dltx, self.dlty
  27. end
  28. -- 触点与最初位置的距离
  29. function hongzhong:getTouchDistance()
  30. local curPos = self:getPosition()
  31. local iniPos = self.initPostion
  32. return cc.pGetDistance(curPos, iniPos)
  33. end
  34. function hongzhong:setStandImage(value,viewId)
  35. hongzhong.super.setStandImage(self,value,viewId)
  36. if tonumber(value)==41 and viewId == MJDefine.MyViewId then
  37. local laiFlog = cc.Sprite:createWithSpriteFrameName("mj_flog_laizi.png")
  38. laiFlog:setTag(MJ.MJ_HAND_CARD_FLAG_LAIZI)
  39. self:addChild(laiFlog)
  40. laiFlog:setPosition(17,100)
  41. end
  42. end
  43. return hongzhong