[]代码里能控制图片的锚点吗?


var heroidstr = "role/herohead"+Hero.getHeadID()+".png";
m_herohead = new Image();
var texture = Laya.loader.getRes(heroidstr);
m_herohead.graphics.drawTexture(texture);
m_herohead.anchorX = 0.5;
m_herohead.anchorY = 1;
m_herohead.pos(m_heroPosX,m_heroPosY);
m_mapbg.addChild(m_herohead);
 
 
我在代码里创建图片,可是设置锚点后,显示还是0,0没有改变锚点的位置。。
 
已邀请:

ymsdandan

赞同来自:

你的图片是否设有宽高,如果没有宽高的话改变锚点也是无效的

要回复问题请先

商务合作
商务合作