Javascript
[PIXI] ์ด๋ฏธ์ง๋ฅผ ๋ก๋ํ์ฌ texture -> sprite -> canvas์ add ํ๋ ๊ณผ์
์ด๋ฏธ์ง ๋ก๋ ์ด๋ฏธ์ง๋ก ์์ ํ๊ธฐ ์ํ ์ฒซ ๋ฒ์งธ ๋จ๊ณ๋ ์น ์๋ฒ์์ ์ฌ์ฉ์์ ์น ๋ธ๋ผ์ฐ์ ๋ก ์ด๋ฏธ์ง ํ์ผ์ ๊ฐ์ ธ์ค๋ ๊ฒ์ ๋๋ค. ์ด๋ฅผ PIXI.Texture.from()์ํด ๋น ๋ฅธ ๋ฐ๋ชจ์ฉ์ผ๋ก ์๋ํ๋ ๋ฅผ ์ฌ์ฉํ ์ ์์ง๋ง ํ๋ก๋์ ์์๋ Loader ํด๋์ค๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๋ก๋๋ ์์๋ฅผ ์ฌ์ฉํ์ฌ ๋ํํ๊ณ ๊ด๋ฆฌํ์ฌ ๋ธ๋ผ์ฐ์ ์ ์ด๋ฏธ์ง๋ฅผ ๊ฐ์ ธ์ค๋๋ก ์ง์ํ ๋ค์ ์๋ฃ๋๋ฉด ์๋ ค์ค๋๋ค. ์ด ํ๋ก์ธ์ค๋ ๋น๋๊ธฐ์ ์ ๋๋ค . ๋ก๋๋ฅผ ์์ฒญํ ๋ค์ ์๊ฐ์ด ์ง๋๋ฉด ๋ก๋๊ฐ ์๋ฃ๋์์์ ์๋ฆฌ๋ ์ด๋ฒคํธ๊ฐ ๋ฐ์ํฉ๋๋ค. BaseTextures๋ ๋ฐ์ดํฐ๋ฅผ ์์ ํฉ๋๋ค ๋ก๋๊ฐ ์์ ์ ์๋ฃํ๋ฉด ๋ก๋๋ ์์์ ํ์ํ ํฝ์ ๋ฐ์ดํฐ๊ฐ ํฌํจ๋ฉ๋๋ค. ๊ทธ๋ฌ๋ ๋ฌด์ธ๊ฐ๋ฅผ ๋ ๋๋งํ๋ ๋ฐ ์ฌ์ฉํ๋ ค๋ฉด PixiJS๊ฐ ์์ ์ด๋ฏธ์ง ํ์ผ์ ๊ฐ์ ธ์ GPU์ ์ ๋ก๋ํด์ผ ํฉ๋๋ค. ์ด..
[PIXI] ticker ์ฌ์ฉ๋ฐฉ๋ฒ
์ ์ฒด ์ฝ๋ const Application = PIXI.Application; const app = new Application({ width: window.innerWidth, height: window.innerHeight, transparent: false, antialias: true, backgroundColor: 0xAAAAAA }); app.renderer.backgroundColor = 0x23395D; app.renderer.view.style.position = 'absolute'; document.body.appendChild(app.view); const graphics = PIXI.Graphics; app.ticker.add(delta => loop(delta)); function..
[PIXI] PIXI.Text์ PIXI.TextStyle ์ฌ์ฉ ๋ฐฉ๋ฒ
๊ธฐ๋ณธ ์ฝ๋ const Application = PIXI.Application; const app = new Application({ width: window.innerWidth, height: window.innerHeight, transparent: false, antialias: true, backgroundColor: 0xAAAAAA }); //๋ฐฐ๊ฒฝ์ ๋ณ๊ฒฝ app.renderer.backgroundColor = 0x23395D; //์์ฑ์๊ฐ ์๋๋๋ผ๋ ์ด์ ๊ฐ์ด ํฌ๊ธฐ ์กฐ์ ๊ฐ๋ฅ app.renderer.view.style.position = 'absolute'; document.body.appendChild(app.view); const style = new PIXI.TextStyle({ fontFa..
[PIXI] Graphic ํด๋์ค ํ์ฉํ์ฌ ๋ํ๊ทธ๋ฆฌ๊ธฐ
app.renderer vs app.view app.renderer๋ ๋ด๋ถ ๋งค์ปค๋์ฆ์ด๋ผ๋ฉด,(์บ๋ฒ์ค ์์ ์กฐ์ ) app.view๋ ์ด๋ฏธ ๋ง๋ค์ด์ง ์บ๋ฒ์ค ์์ฒด //๋ฐฐ๊ฒฝ์ ๋ณ๊ฒฝ app.renderer.backgroundColor = 0x23395D; //css app.renderer.view.style.position = 'absolute'; Graphic ํด๋์ค - ์ฌ๊ฐํ app.stage๋ ํฌํ ์ต์์ ๋ ์ด์ด๋ฅผ ์๋ก ๊ณ์ ์์๊ฐ๋ ๋๋์ ์๊ฐํ๋ฉด ์ฝ๋ค. const graphics = PIXI.Graphics; const rect = new graphics(); rect.beginFill(0x00ff00) .drawRect(40, 40, 200, 250)//x์ขํ y์ขํ ๋๋น ๋์ด .endFill() app...
[React] fontawesome ๋ฆฌ์กํธ๋ก ๊ฐ์ ธ์ค๊ธฐ
https://fontawesome.com/v5/docs/web/use-with/react React The internet's icon library + toolkit. Used by millions of designers, devs, & content creators. Open-source. Always free. Always awesome. fontawesome.com ์ ์ธ์ค์ ์ผ๋ฌด์ง๊ฒ ๋ค์ด๋ฐ์ ์ค๋ค. npm i --save @fortawesome/fontawesome-svg-core npm install --save @fortawesome/free-solid-svg-icons npm install --save @fortawesome/react-fontawesome import React from..
[PIXI] app.view(์ฌ์ค์ ์บ๋ฒ์ค ํ๊ทธ) ์์ฑ ์ดํด๋ณด๊ธฐ
app.view = pixi ๋์ฐ๋ฏธ ํด๋์ค๋ก ์์ฑํ app.view๋ ๊ฒฐ๊ตญ ์บ๋ฒ์ค ํ๊ทธ์ด๊ธฐ ๋๋ฌธ์ HTML Canvas ๊ธฐ์ด ์ ๋ฐ์ ํ๋ฒ ํ๋ ๊ฒ์ด ์ข๋ค. ์๋ ๋งํฌ๊ฐ ์ ๋ฐ์ ์ผ๋ก ์ ์ค๋ช ๋์ด ์์ด์ ์ฒจ๋ถํ๋ค. https://unikys.tistory.com/274 [HTML5 ํํ ๋ฆฌ์ผ] Canvas ๊ธฐ์ด ๊ฐ์ข * ์ด๋ฒ์๋ HTML5์ ๊ฐ๋ ฅํ ๊ธฐ๋ฅ ์ค ํ๋์ธ ํ๊ทธ์ ๋ํด์ ์์๋ณด์. 2012/10/25 - [HTML5 ํํ ๋ฆฌ์ผ] HTML5์ ๋ฑ์ฅ ๋ฐฐ๊ฒฝ๊ณผ ์ฌ๋ฌ ๊ฐ์ง ๊ฐ๋ฐ ํ๊ฒฝ ๋ฐ ํ์ฌ ํํฉ 2012/11/03 - [HTML5 ํํ ๋ฆฌ์ผ] ๊ธฐ์ด ๋ฐ ๊ธฐ๋ณธ ๊ตฌ์กฐ, unikys.tistory.com ๊ด๋ จ ํฌ์คํ app.view.style = CSSStyleDeclaration ๊ด๋ จ ํฌ์คํ ์ฆ app.view๋ ์บ๋ฒ์ค..
[Pixi.js] ํ๊ฒฝ์ค์ ๊ณผ PIXI ๊ฐ์ฒด ์ดํด๋ณด๊ธฐ
git init npm install pixi.js index.html์์ ์๋ ์ถ๊ฐ ํด์ฃผ๊ฑฐ๋ npm์ผ๋ก ๋ค์ด๋ฐ์ง ์๋๋ผ๋ ์๋ ๋ผ์ธ์ ์ถ๊ฐํด์ฃผ๋ฉด ๋๋ค. index.html PIXI STUDY 1 2 3 2022๋ 12์ 21์ผ PIXI ํ๊ฒฝ์ค์ ๊ณผ ๊ธฐ๋ณธ ์์ฑ ํ์ต (Source1) (Source2) ์์ ๊ฐ์ด ์์ ์ฝ๋ ์์ฑ app.js const Application = PIXI.Application; const app = new Application(); ์ฌ๊ธฐ๊น์ง ํด์ค ๋ค, ์ฝ์์ PIXI๋ฅผ ์์ฑํ๋ฉด, ํผ์ณ๋ณด๋๋ก ํ๋ค. ์์ฒญ๋๊ฒ ๋ง์ด ๋์จ๋ค...๐ ์ด์ ์ค๋ฌด์์ ํฝ์๋ export default class ๊ณ ์์ดํ์ extends ๊ธฐ๋ณธํ์ { app: PIXI.Application | null; cl..
[Pixi.js] ํฝ์ ๊ณต๋ถ ์์
https://youtu.be/_HjQTzpbRK4 ํ์ฌ ์คํ์ธ ํฝ์๋ฅผ ์์ฃผ ์น์ด๋จน์ด๋ณด๊ณ ์ถ์ด์ ์ ํ๋ธ ํํ ๋ฆฌ์ผ ์์์ ๋ณด๊ณ ๋ฐ๋ผํด๋ณผ๊นํ๋ค. ๋๋ ๋ฌด์ธ๊ฐ๋ฅผ ๊ฐ์ก๊ณ ๊ณต๋ถํ๋ค(์์ํ๋ค)์ ๊ธฐ์ค์ด ์์ํ์ต์ด๋ค. ์ด ๊ณต๋ถ๋ฅผ ์์ํ๊ฒ ๋ ๊ณ๊ธฐ๋ ๋ค์๊ณผ ๊ฐ๋ค. ํ์ฌ์์ ์์ดํ ์ด ๊ฒน์น ๋ ๊ฐ์ฅ ์์ ๋ฌ ํ์ ์ ๋ฒํผ์ด ๋๋ฆฌ์ง ์๋ ์ด์๊ฐ ์์๋๋ฐ, ๋ฒํผ ์๋์ ๋ค๋ฅธ ํฝ์์ฑ ์์ดํ ๊ณผ ๊ฒน์ณค๊ธฐ ๋๋ฌธ์ด๋ค. ๋ ์์ธํ๊ฒ ๊ธฐ์ ํ์๋ฉด, ํด๋น ํฝ์์ฑ์ ํน์ ํ๋๊ทธ์ ๋ง์ฐ์ค ์ขํ์์ ํด๋ฆญ ์ด๋ฒคํธ๊ฐ ๋ฑ๋ก์์๋๋ฐ ์์ ๋ค๋ฅธ ํ์ ์ด ์ผ์ง๋๋ฐ๋ ํ๋๊ทธ๋ฅผ ๊บผ์ฃผ์ง ์์๋ค. ๋ฐ๋ผ์ ์ถ๊ฐ ํ์ ์ด ์ด๋ฆด ๋ ํฝ์์ฑ์ ํ๋๊ทธ๋ฅผ ๋๊ณ , ์ถ๊ฐ๋ ํ์ ์ด ๋ค์ ๋ซํ ๋ ํฝ์์ฑ์ ํ๋๊ทธ ์ผ๋๋ฅผ ์ถ๊ฐํ์ฌ ์ด์๋ ํด๊ฒฐํ์๋ค. ์ด ๊ณผ์ ์์ ์ค์ค๋ก ์์ฌ์ ๋ ์ ์ ์ดํํฐ..
[JavaScript] document.getElementsByClassName() - ํน์ class๋ฅผ ๊ฐ์ง๊ณ ์๋ dom ์์๋ค์ ์ฐพ๊ธฐ/๊ฐ์ ธ์ค๊ธฐ
https://mine-it-record.tistory.com/494 [JavaScript] document.getElementsByClassName() - ํน์ class๋ฅผ ๊ฐ์ง๊ณ ์๋ dom ์์๋ค์ ์ฐพ๊ธฐ/๊ฐ์ ธ์ค๊ธฐ (ft. elem javascript๋ก dom ์์๋ฅผ ์ ์ดํ ๋ ์ฌ์ฉ๋๋ ๋ฉ์๋์ค ํ๋์ธ document.getElementByClassName()์ ๋ํด ์์๋ณด์. ๋ฉ์๋๋ช ๊ทธ ์๋ฏธ๋ฅผ ๊ทธ๋๋ก ๊ฐ์ง๊ณ ์์ด, ํน์ class๋ฅผ ๊ฐ์ง๊ณ ์๋ ๋ชจ๋ dom ์์์ ์ ๊ทผํ๊ธฐ mine-it-record.tistory.com https://developer.mozilla.org/ko/docs/Web/API/Node/insertBefore Node.insertBefore() - Web API | MDN N..
[node] express ์ค์น ํ๊ฒฝ ์กฐ์ฑํด๋ณด๊ธฐ
ํด๋ ๋ง๋ค๊ณ 1. npm init --yes 2. npm install express 3. package.json ์ ์๋์ ๊ฐ์ด ๋ณ๊ฒฝ { "name": "1.express-basic", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start":"nodemon app" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "express": "^4.18.2" } } 4. npm i nodemon --save-dev ํ๊ณ (๋ด ํผ์จ์ ๋ ธ๋๋ชฌ์ด ์ ์ญ์ผ๋ก ๊น๋ ค์..