View unanswered posts | View active topics It is currently 2019-06-27 18:23



This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
 Node 下面的icon属性 效果出不来 
Author Message
新手上路

Joined: 2016-01-25 16:24
Posts: 1
Post Node 下面的icon属性 效果出不来
//------图片加载------
[Embed(source="images/pc.png")]
public static const pcImage:Class;
[Embed(source="images/right.jpg")]
public static const rightImage:Class;
//-----图片注册-----
Utils.registerImageByClass("pcImage",pcImage);
Utils.registerImageByClass("rightImage",rightImage);
//-----创建节点-----
var pc:Node = new Node();
pc.name = "pc";
pc.image="pcImage";
//----------添加icon图标-----------
pc.setStyle(Styles.ICONS_NAMES, "rightImage");
pc.setStyle(Styles.ICONS_POSITION, Consts.POSITION_BOTTOMRIGHT_TOPRIGHT);

//---------------------------------
pc.location = new Point(1,75);
box.add(pc);
-------------
但是拓扑图出不了icon的效果,直接都不显示节点了,这是什么原因?
代码我都按照demo文档写的,网上也找了都是这么写,怎么就我出不来效果?求帮助指导!!!


2016-01-25 16:37
Profile
TWaver开发组
User avatar

Joined: 2009-04-20 18:37
Posts: 3115
Post Re: Node 下面的icon属性 效果出不来
试试:
pc.setStyle(Styles.ICONS_NAMES, ["rightImage"]);


2016-01-25 17:42
Profile
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron