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.

56 line
1.3 KiB

  1. local ZPDef = ZPFramework.ZPImport("zp_base.luaScript.ZPDef")
  2. local ZPFuc = ZPFramework.ZPImport("zp_base.luaScript.ZPFunctions")
  3. local changpaiCard = class("changpaiCard",function()
  4. local node=cc.ImageView:create()
  5. return node
  6. end)
  7. function changpaiCard:ctor(value,mType,viewId,colorType,desktopType)
  8. self.value=value
  9. self.viewId=viewId
  10. self.mType = mType
  11. self.colorType = colorType or ZPDef.ColorType.White
  12. self.desktopType = desktopType or ZPDef.DesktopType.ThreeD
  13. local fileName = ZPFuc.getZPCardImgByValue(value,mType,self.colorType)
  14. self:setVisible(true)
  15. self:loadTextureFromPlist(fileName)
  16. self:setCardRoataition(viewId,mType,self.colorType,self.desktopType)
  17. end
  18. function changpaiCard:setCardRoataition(viewId,mType,colorType,desktopType)
  19. if mType == ZPDef.CardType.CARD_TYPE_GROUP_OUT then
  20. if colorType == ZPDef.ColorType.White then
  21. self:setScale(0.42)
  22. else
  23. self:setScale(0.46)
  24. end
  25. if viewId == 2 or viewId == 4 then
  26. self:setEulerRotation(cc.vec3(0, 0, 90))
  27. end
  28. if (viewId == 1 or viewId == 3) and desktopType == ZPDef.DesktopType.ThreeD then ---3dµÄʱºòÅÆÒªÇãб
  29. if viewId == 1 then
  30. self:setEulerRotation(cc.vec3(-38, 25, 18))
  31. else
  32. self:setEulerRotation(cc.vec3(37, 24, -18))
  33. end
  34. end
  35. end
  36. end
  37. return changpaiCard