请教大家,关于Sprite的特性:load image from url
construct2吧
全部回复
仅看楼主
level 9
Vzad 楼主
之前虽然也试过 但似乎没注意过这个问题 直到昨天
同一个Sprite 创建多个Instance之后 能否让他们各自载入不同的网络图片呢?
或者这么说 一个Sprite创建了多个Instance 如果这时候对某一个instance执行Load image from url 那么其他之前已经load过网络图片的instance 图像会发生变化吗?
目前我在202版本测试 发现所有通过load image from url的sprite instanse 一个变化 其他也都在变。。这个。。是BUG吗?
2015年04月20日 14点04分 1
level 13
一个<Sprite>中只能存在维一的一套"Animation1",一个"Animation1"中只能存在维一的"frame1"。所以只要动到<Sprite>->"Animation1"->"frame1",布局中的所有<Sprite>都会受到改变。
解决的方法是预先设置多组<AnimationN>,将读入的影像分流避免干扰。
2015年04月20日 17点04分 2
额。。我一直以为同一sprite复制出来的,设置任意sprite_n的时候都是把所有都一起改变了,这里面涉及用uid设置?还是设置frame1--load image from url1,frame2--load image from url2?这样不会改变其他sprite_n?
2015年04月21日 01点04分
@totoyan72021 用不同的sprite/frame来分流影像都可以的。若用animation来分,那麼这样的思路可以跟@rexrainbow的<AnimationLoad>插件配合的较好。
2015年04月21日 04点04分
level 9
Vzad 楼主
原来是这样! 感谢傅老师!
2015年04月20日 22点04分 3
2015年04月21日 04点04分
level 9
如果只是要显示图, 不需要animation, 可以用rojo的canvas plugin. 配上rex_canvasext behavior的load image from URL.
这样load image之后, 只会改变当下的canvas instance.
2015年04月21日 04点04分 4
1