|
- local ZPDef = ZPFramework.ZPImport("zp_base.luaScript.ZPDef")
- local ZPFuc = ZPFramework.ZPImport("zp_base.luaScript.ZPFunctions")
- local changpaiCard = class("changpaiCard",function()
- local node=cc.ImageView:create()
- return node
- end)
-
-
- function changpaiCard:ctor(value,mType,viewId,colorType,desktopType)
-
- self.value=value
-
- self.viewId=viewId
-
- self.mType = mType
-
- self.colorType = colorType or ZPDef.ColorType.White
-
- self.desktopType = desktopType or ZPDef.DesktopType.ThreeD
-
- local fileName = ZPFuc.getZPCardImgByValue(value,mType,self.colorType)
-
- self:setVisible(true)
-
- self:loadTextureFromPlist(fileName)
-
- self:setCardRoataition(viewId,mType,self.colorType,self.desktopType)
- end
-
-
- function changpaiCard:setCardRoataition(viewId,mType,colorType,desktopType)
-
- if mType == ZPDef.CardType.CARD_TYPE_GROUP_OUT then
- if colorType == ZPDef.ColorType.White then
- self:setScale(0.42)
- else
- self:setScale(0.46)
- end
-
- if viewId == 2 or viewId == 4 then
- self:setEulerRotation(cc.vec3(0, 0, 90))
- end
-
- if (viewId == 1 or viewId == 3) and desktopType == ZPDef.DesktopType.ThreeD then ---3dµÄʱºòÅÆÒªÇãб
- if viewId == 1 then
- self:setEulerRotation(cc.vec3(-38, 25, 18))
- else
- self:setEulerRotation(cc.vec3(37, 24, -18))
- end
-
- end
- end
- end
-
-
- return changpaiCard
|