250x250
Rainbow๐ŸŒˆCoder
My dev Note๐Ÿ“’
Rainbow๐ŸŒˆCoder
์ „์ฒด ๋ฐฉ๋ฌธ์ž
์˜ค๋Š˜
์–ด์ œ
  • ๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ (411)
    • ๊ณต์ง€์‚ฌํ•ญ (0)
    • Debugger (10)
      • Visual Studio Debugger (1)
      • Chrome DevTools (3)
      • Visual Studio Code Debugger (4)
      • eclipse (1)
      • intelliJ (1)
    • OOP (2)
      • OOP (2)
    • TypeScript (54)
      • ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ TypeScript (54)
    • Javascript (87)
      • Javascript (45)
      • Node.js (19)
      • React (5)
      • FE ๊ฐœ๋ฐœํ™˜๊ฒฝ์„ค์ • (3)
      • React์™€ Node ๊ฐ™์ด ๋•Œ๋ ค์žก๊ธฐ (6)
      • next.js (2)
      • pixi.js (7)
    • ๋งˆํฌ์—… (23)
      • Html & Css (23)
    • C# (80)
      • C# (12)
      • ์ด๊ฒƒ์ด C#์ด๋‹ค (68)
    • C++ (30)
      • c++ (27)
      • win api (3)
    • Unity (18)
      • Unity(๊ธฐ์ดˆ) (8)
      • Unity(C#์ค‘๊ธ‰) (5)
      • ์œ ๋‹ˆํ‹ฐ ํฌํ†ค(๋„คํŠธ์›Œํฌ) (4)
      • unity c# MyCode (1)
    • Java & Spring (29)
      • Java (11)
      • ์Šคํ”„๋ง (8)
      • Java Algorithm (9)
      • Javs Data Structures (1)
    • ์ž๋ฃŒ๊ตฌ์กฐ์™€ ์•Œ๊ณ ๋ฆฌ์ฆ˜ (15)
      • ์ž๋ฃŒ๊ตฌ์กฐ (5)
      • ์•Œ๊ณ ๋ฆฌ์ฆ˜ (10)
    • ํ˜•์ƒ๊ด€๋ฆฌ (15)
      • Git (11)
      • ์†Œ์ŠคํŠธ๋ฆฌ (3)
    • ๊ทธ๋ž˜ํ”ฝ์Šค (7)
      • WebGl (7)
    • AWS (3)
      • aws (3)
    • ๋ฆฌ๋ˆ…์Šค (5)
      • ๋ฆฌ๋ˆ…์Šค (5)
    • ์ฑ… ๋ฆฌ๋ทฐ (13)
      • ํด๋ฆฐ์ฝ”๋“œ(์ฑ…๋ฆฌ๋ทฐ) (3)
      • ์œ ์ง€๋ณด์ˆ˜๊ฐ€๋Šฅํ•œ์ฝ”๋”ฉ์˜๊ธฐ์ˆ C#ํŽธ(์ฑ…๋ฆฌ๋ทฐ) (1)
      • ๋ฆฌํŒฉํ† ๋ง(์ž๋ฐ”์Šคํฌ๋ฆฝํŠธํŒ) (9)
    • Server (2)
      • ๊ฒŒ์ž„ ์„œ๋ฒ„(๋„คํŠธ์›Œํฌ, ๋ฉ€ํ‹ฐ์“ฐ๋ ˆ๋“œ,OS) (2)
    • ์„ค๊ณ„, ์•„ํ‚คํ…์ณ (4)
    • ํŒŒ์ด์ฌ (5)
    • ๋””์ž์ธํŒจํ„ด (2)
    • mocha (2)
    • Jest (1)
    • Spine (1)
    • ์ธ๊ณต์ง€๋Šฅ (1)
      • ํ˜ผ์ž๊ณต๋ถ€ํ•˜๋Š”๋จธ์‹ ๋Ÿฌ๋‹+๋”ฅ๋Ÿฌ๋‹ (1)

๋ธ”๋กœ๊ทธ ๋ฉ”๋‰ด

  • ํ™ˆ
  • ํƒœ๊ทธ
  • ๋ฐฉ๋ช…๋ก

๊ณต์ง€์‚ฌํ•ญ

์ธ๊ธฐ ๊ธ€

ํƒœ๊ทธ

  • ์œ„์ž„
  • MySQL
  • ใ…ฃใ„ท
  • ์ปดํฌ์ง€์…˜

์ตœ๊ทผ ๋Œ“๊ธ€

์ตœ๊ทผ ๊ธ€

ํ‹ฐ์Šคํ† ๋ฆฌ

hELLO ยท Designed By ์ •์ƒ์šฐ.
Rainbow๐ŸŒˆCoder

My dev Note๐Ÿ“’

๊ทธ๋ž˜ํ”ฝ์Šค/WebGl

[2D WebGL][pixiJS] Renderer, Ticker, & Stage

2022. 5. 13. 00:24
728x90

https://youtu.be/2J0VUiozAVM

 

์ฝ”๋“œ ์ˆ˜์ •์ „

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Document</title>
    <style>
      body {
        margin: 0;
      }
      canvas {
        display: block;
        background-color: blue;
      }
    </style>
  </head>
  <body>
    <canvas id="mycanvas"></canvas>
    <script src="pixi.js"></script>
    <script type="text/javascript">
      const canvas = document.getElementById("mycanvas");
      // Create the application helper and add its render target to the page
      const app = new PIXI.Application({
        view: canvas,
        width: window.innerWidth,
        height: window.innerHeight,
      });

      // Create the sprite and add it to the stage
      const texture = PIXI.Texture.from("bike.png");
      const img = new PIXI.Sprite(texture);
      img.x = app.renderer.width / 2;
      img.y = app.renderer.height / 2;
      img.anchor.x = 0.5;
      img.anchor.y = 0.5;
      app.stage.addChild(img);

      app.ticker.add(animate);
      function animate() {
        img.rotation += 0.1;
      }
    </script>
  </body>
</html>

 

์ฝ”๋“œ ์ˆ˜์ • ํ›„

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Document</title>
    <style>
      body {
        margin: 0;
      }
      canvas {
        display: block;
        background-color: blue;
      }
    </style>
  </head>
  <body>
    <canvas id="mycanvas"></canvas>
    <script src="pixi.js"></script>
    <script type="text/javascript">
      const canvas = document.getElementById("mycanvas");

      const renderer = new PIXI.Renderer({
        view: canvas,
        width: window.innerWidth,
        height: window.innerHeight,
      });
      const stage = new PIXI.Container();

      const texture = PIXI.Texture.from("bike.png");
      const img = new PIXI.Sprite(texture);

      img.x = renderer.width / 2;
      img.y = renderer.height / 2;
      img.anchor.x = 0.5;
      img.anchor.y = 0.5;
      stage.addChild(img);

      const ticker = new PIXI.Ticker();
      ticker.add(animate);
      ticker.start();

      function animate() {
        img.rotation += 0.1;
        renderer.render(stage);
      }
    </script>
  </body>
</html>

 

 

<๋ฆฌ์‚ฌ์ด์ฆˆ ๋กœ์ง ์ ์šฉ ์ตœ์ข… ์†Œ์Šค์ฝ”๋“œ>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Document</title>
    <style>
      body {
        margin: 0;
      }
      canvas {
        display: block;
        background-color: blue;
      }
    </style>
  </head>
  <body>
    <canvas id="mycanvas"></canvas>
    <script src="pixi.js"></script>
    <script type="text/javascript">
      const canvas = document.getElementById("mycanvas");

      let _w = window.innerWidth;
      let _h = window.innerHeight;

      const renderer = new PIXI.Renderer({
        view: canvas,
        width: _w,
        height: _h,
        resolution: window.devicePixelRatio,
        autoDensity: true,
      });
      window.addEventListener("resize", resize);
      function resize() {
        _w = window.innerWidth;
        _h = window.innerHeight;

        renderer.resize(_w, _h);
      }
      const stage = new PIXI.Container();

      const texture = PIXI.Texture.from("bike.png");
      const img = new PIXI.Sprite(texture);

      img.anchor.x = 0.5;
      img.anchor.y = 0.5;
      stage.addChild(img);

      const ticker = new PIXI.Ticker();
      ticker.add(animate);
      ticker.start();

      function animate() {
        img.x = renderer.screen.width / 2;
        img.y = renderer.screen.height / 2;
        img.rotation += 0.1;
        renderer.render(stage);
      }
    </script>
  </body>
</html>
728x90

'๊ทธ๋ž˜ํ”ฝ์Šค > WebGl' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[Spine][pixiJs] Api ์‚ฌ์ดํŠธ  (0) 2022.05.11
[2D WebGL][pixi.Js] ์„ธ๋ถ€์‚ฌํ•ญ  (0) 2022.05.10
[2D WebGL][pixiJS] Getting Started!  (0) 2022.05.09
[2D WebGL][pixiJS] Architecture Overview  (0) 2022.05.09
[3D WebGL][three.js] three.js ํ”„๋กœ์ ํŠธ ์‹œ์ž‘ํ•ด๋ณด๊ธฐ  (0) 2022.05.09
    '๊ทธ๋ž˜ํ”ฝ์Šค/WebGl' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€
    • [Spine][pixiJs] Api ์‚ฌ์ดํŠธ
    • [2D WebGL][pixi.Js] ์„ธ๋ถ€์‚ฌํ•ญ
    • [2D WebGL][pixiJS] Getting Started!
    • [2D WebGL][pixiJS] Architecture Overview
    Rainbow๐ŸŒˆCoder
    Rainbow๐ŸŒˆCoder
    ๋ชฐ๋ผ๋„ ๊ฒฐ๊ตญ์€ ์•„๋Š” ๊ฐœ๋ฐœ์ž, ๊ทธ๋Ÿฐ ์‚ฌ๋žŒ์ด ๋˜๊ธฐ ์œ„ํ•œ ๋งค์ผ์˜ ํ•œ๊ฑธ์Œ

    ํ‹ฐ์Šคํ† ๋ฆฌํˆด๋ฐ”