Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17088

display sprite from URL

$
0
0

@Hemchand wrote:

I am getting this error: ‘SecurityError: The operation is insecure.’
for this code:

    var winSize = cc.director.getWinSize();
    var that = this;

    var imageURL = "https://discuss.cocos2d-x.org/uploads/default/original/3X/c/9/c9a024cd3656916ac85bb3a01034f8075bc8f827.png";
    cc.loader.loadImg(imageURL,  {isCrossOrigin : true}, function(err, texture)
    {


        var spriteTest = new cc.Sprite(texture);
        spriteTest.setPosition(winSize.width / 2, winSize.height / 2);
        that.addChild(spriteTest);
    });

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17088

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>