-- 获取头像的地址
local sHeadUrl = self._ResultInfoTable.tbUserPoint[tostring(realSeat)].sHeadUrl;
if sHeadUrl and sHeadUrl ~= "" then
--创建头像
local headSp = WebSprite.create(sHeadUrl, 60, 60);
headNode:addChild(headSp);
else
-- 创建默认头像
local defaultHeadSp = cc.Sprite:create("这里使用默认头像");
defaultHeadSp:setPosition(0, -5);
headNode:addChild(defaultHeadSp);
local sHeadUrl = self._ResultInfoTable.tbUserPoint[tostring(realSeat)].sHeadUrl;
if sHeadUrl and sHeadUrl ~= "" then
--创建头像
local headSp = WebSprite.create(sHeadUrl, 60, 60);
headNode:addChild(headSp);
else
-- 创建默认头像
local defaultHeadSp = cc.Sprite:create("这里使用默认头像");
defaultHeadSp:setPosition(0, -5);
headNode:addChild(defaultHeadSp);
end
-----------------------------WebSprite.lua--------------------------------------
local WebSprite = class("WebSprite",function()
return cc.Sprite:create()
end)
function WebSprite.create(imgurlPath,fWidth,fHeight)
local pSpr = WebSprite.new()
pSpr:createC