Javascript

    [PIXI] ์ด๋ฏธ์ง€๋ฅผ ๋กœ๋“œํ•˜์—ฌ texture -> sprite -> canvas์— add ํ•˜๋Š” ๊ณผ์ •

    [PIXI] ์ด๋ฏธ์ง€๋ฅผ ๋กœ๋“œํ•˜์—ฌ texture -> sprite -> canvas์— add ํ•˜๋Š” ๊ณผ์ •

    ์ด๋ฏธ์ง€ ๋กœ๋“œ ์ด๋ฏธ์ง€๋กœ ์ž‘์—…ํ•˜๊ธฐ ์œ„ํ•œ ์ฒซ ๋ฒˆ์งธ ๋‹จ๊ณ„๋Š” ์›น ์„œ๋ฒ„์—์„œ ์‚ฌ์šฉ์ž์˜ ์›น ๋ธŒ๋ผ์šฐ์ €๋กœ ์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ๊ฐ€์ ธ์˜ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ด๋ฅผ PIXI.Texture.from()์œ„ํ•ด ๋น ๋ฅธ ๋ฐ๋ชจ์šฉ์œผ๋กœ ์ž‘๋™ํ•˜๋Š” ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์ง€๋งŒ ํ”„๋กœ๋•์…˜์—์„œ๋Š” Loader ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๋กœ๋”๋Š” ์š”์†Œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ž˜ํ•‘ํ•˜๊ณ  ๊ด€๋ฆฌํ•˜์—ฌ ๋ธŒ๋ผ์šฐ์ €์— ์ด๋ฏธ์ง€๋ฅผ ๊ฐ€์ ธ์˜ค๋„๋ก ์ง€์‹œํ•œ ๋‹ค์Œ ์™„๋ฃŒ๋˜๋ฉด ์•Œ๋ ค์ค๋‹ˆ๋‹ค. ์ด ํ”„๋กœ์„ธ์Šค๋Š” ๋น„๋™๊ธฐ์‹ ์ž…๋‹ˆ๋‹ค . ๋กœ๋“œ๋ฅผ ์š”์ฒญํ•œ ๋‹ค์Œ ์‹œ๊ฐ„์ด ์ง€๋‚˜๋ฉด ๋กœ๋“œ๊ฐ€ ์™„๋ฃŒ๋˜์—ˆ์Œ์„ ์•Œ๋ฆฌ๋Š” ์ด๋ฒคํŠธ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. BaseTextures๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์†Œ์œ ํ•ฉ๋‹ˆ๋‹ค ๋กœ๋”๊ฐ€ ์ž‘์—…์„ ์™„๋ฃŒํ•˜๋ฉด ๋กœ๋“œ๋œ ์š”์†Œ์— ํ•„์š”ํ•œ ํ”ฝ์…€ ๋ฐ์ดํ„ฐ๊ฐ€ ํฌํ•จ๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ๋ฌด์–ธ๊ฐ€๋ฅผ ๋ Œ๋”๋งํ•˜๋Š” ๋ฐ ์‚ฌ์šฉํ•˜๋ ค๋ฉด PixiJS๊ฐ€ ์›์‹œ ์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ๊ฐ€์ ธ์™€ GPU์— ์—…๋กœ๋“œํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด..

    [PIXI] ticker ์‚ฌ์šฉ๋ฐฉ๋ฒ•

    [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 ์‚ฌ์šฉ ๋ฐฉ๋ฒ•

    [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 ํด๋ž˜์Šค ํ™œ์šฉํ•˜์—ฌ ๋„ํ˜•๊ทธ๋ฆฌ๊ธฐ

    [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 ๋ฆฌ์•กํŠธ๋กœ ๊ฐ€์ ธ์˜ค๊ธฐ

    [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(์‚ฌ์‹ค์ƒ ์บ”๋ฒ„์Šค ํƒœ๊ทธ) ์†์„ฑ ์‚ดํŽด๋ณด๊ธฐ

    [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 ๊ฐ์ฒด ์‚ดํŽด๋ณด๊ธฐ

    [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] ํ”ฝ์‹œ ๊ณต๋ถ€ ์‹œ์ž‘

    [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 ์„ค์น˜ ํ™˜๊ฒฝ ์กฐ์„ฑํ•ด๋ณด๊ธฐ

    [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 ํ•˜๊ณ (๋‚ด ํ”ผ์”จ์— ๋…ธ๋“œ๋ชฌ์ด ์ „์—ญ์œผ๋กœ ๊น”๋ ค์žˆ..