|
-
- local MJ=MJFramework.MJFrameworkClassImprot("mj.luaScript.Views.Game.MJ")
- local hongzhong=class("hongzhong",MJ)
- local MJDefine=MJFramework.MJImport("mj.luaScript.MJDefine")
-
- function hongzhong:ctor(...)
- hongzhong.super.ctor(self,...)
- self.dltx , self.dlty = 0, 0
- end
-
- function hongzhong:initSortValue(value)
- if value==0x41 then --红中的排序值修改
- self.sortValue=0x00
- else
- self.sortValue=value
- end
- end
-
- function hongzhong:recordPostion(initY)
- hongzhong.super.recordPostion(self, initY)
- self.dltx , self.dlty = 0, 0
- end
-
- -- 初始触摸偏移
- function hongzhong:checkDltPos( pt )
- local dltx = pt.x - self.initPostion.x
- local dlty = pt.y - self.initPostion.y
- self.dltx , self.dlty = dltx, dlty
- end
-
- function hongzhong:getDltPos()
- return self.dltx, self.dlty
- end
-
- -- 触点与最初位置的距离
- function hongzhong:getTouchDistance()
- local curPos = self:getPosition()
- local iniPos = self.initPostion
- return cc.pGetDistance(curPos, iniPos)
- end
-
- function hongzhong:setStandImage(value,viewId)
- hongzhong.super.setStandImage(self,value,viewId)
- if tonumber(value)==41 and viewId == MJDefine.MyViewId then
- local laiFlog = cc.Sprite:createWithSpriteFrameName("mj_flog_laizi.png")
- laiFlog:setTag(MJ.MJ_HAND_CARD_FLAG_LAIZI)
- self:addChild(laiFlog)
- laiFlog:setPosition(17,100)
- end
- end
-
- return hongzhong
|