Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用Pixi.js构建视差滚动条_Javascript_Html_Pixi.js - Fatal编程技术网

Javascript 如何使用Pixi.js构建视差滚动条

Javascript 如何使用Pixi.js构建视差滚动条,javascript,html,pixi.js,Javascript,Html,Pixi.js,我对pixi.js“”教程有问题 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Parallax Scrolling Demo</title> <style> body { background-color: #000000; } canvas { background-colo

我对pixi.js“”教程有问题

<!DOCTYPE html>
 <html>
 <head>
    <meta charset="utf-8">
    <title>Parallax Scrolling Demo</title>
    <style> 
        body { background-color: #000000; }
        canvas { background-color: #222222;}
        </style>
 </head>
 <body onload="init();">
    <div align= "center">
        <canvas id= "game-canvas" width= "512" height="384"></canvas>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.0.0/pixi.min.js" ></script>
    <script> 
        function init() {
            stage = new PIXI.Container();
            renderer = PIXI.autoDetectRenderer(512,384, {view:document.getElementById("game-canvas")});

            var farTexture = PIXI.Texture.fromImage("resources/bg-far.png");
            far = new PIXI.Sprite(farTexture);
            far.position.x = 0;
            far.position.y = 0;
            stage.addChild(far)S

            renderer.render(stage);
        }
        </script>

 </body>
 </html> 

视差滚动演示
正文{背景色:#000000;}
画布{背景色:#2222222;}
函数init(){
stage=新的PIXI.Container();
renderer=PIXI.autoDetectRenderer(512384,{view:document.getElementById(“游戏画布”)});
var farTexture=PIXI.Texture.fromImage(“resources/bg far.png”);
far=新的PIXI.Sprite(farTexture);
远位置x=0;
远位置y=0;
stage.addChild(far)S
渲染器。渲染(舞台);
}

我无法获取要渲染的图像

在Microsoft中构建文件时,返回属性-->安全并确保您的权限设置(针对每个文件)匹配非常重要。 此外,为了避免CORS错误,使用管理设置也很重要;特别是IIS或Internet信息服务中的设置。
在此,您需要检查和调整权限设置

到教程的链接不起作用现在我也有一个CORS错误。这个东西在吗?教程链接:在教程HTML5视差下,你对与此相关的升华文本包有问题吗?如果不是,我不认为这是一个崇高的文本问题;作为一个文本编辑器,它与浏览器如何解释用它编写的代码无关。我认为尽可能多地传递信息是很重要的。