Skip to content

entrylabs/entryjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

entryjs

entryjs๋Š” ์—”ํŠธ๋ฆฌ์—์„œ ๊ฐœ๋ฐœํ•œ HTML5 ๊ธฐ๋ฐ˜์˜ ๋ธ”๋ก์ฝ”๋”ฉ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ž…๋‹ˆ๋‹ค. ์—”ํŠธ๋ฆฌ ์‚ฌ์ดํŠธ์— ์ ‘์†ํ•˜์‹œ๋ฉด entryjs๋ฅผ ์‚ฌ์šฉํ•œ ๋ธ”๋ก์ฝ”๋”ฉ ํ™˜๊ฒฝ์„ ํ™•์ธํ•ด ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์‹œ์ž‘ํ•˜๊ธฐ

entryjs๋Š” HTML Canvas์™€ ์˜ค๋””์˜ค, ๋ฒกํ„ฐ ์ด๋ฏธ์ง€๋“ฑ์„ ๋‹ค๋ฃจ๊ธฐ ์œ„ํ•ด ๋ช‡๊ฐ€์ง€ ์˜คํ”ˆ์†Œ์Šค ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค์ด ์›นํ”„๋กœ์ ํŠธ์— ๋จผ์ € ๋กœ๋”ฉ๋œ ํ›„์— entryjs๋ฅผ ๋กœ๋”ฉํ•˜์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์จ๋“œํŒŒํ‹ฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ

  • jQuery - 1.9.1
  • jquery-ui - 1.10.4
  • Underscore - 1.8.3
  • CreateJS
    • EaselJS - 0.8.0
    • PreloadJS - 0.6.0
    • SoundJS - 0.6.0
  • Lodash - 4.17.10
  • Velocity - ~1.2.3
  • CodeMirror - 5.12.0
  • Fuzzy - ~0.1.1
  • Literallycanvas - entry version
  • EntryTool - entry version ์œ„ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค์€ ๋ชจ๋‘ ์˜คํ”ˆ์†Œ์Šค๋กœ ๋ฐฐํฌ๋˜๋ฉฐ, ์ง์ ‘ ๋‹ค์šด๋กœ๋“œ ๋ฐ›๊ฑฐ๋‚˜ npm, bower๋“ฑ์„ ์ด์šฉํ•ด ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ

<!-- ์จ๋“œํŒŒํ‹ฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค -->
<script type="text/javascript" src="${LIBDIR}/PreloadJS/lib/preloadjs-0.6.0.min.js"></script>
<script type="text/javascript" src="${LIBDIR}/EaselJS/lib/easeljs-0.8.0.min.js"></script>
<script type="text/javascript" src="${LIBDIR}/SoundJS/lib/soundjs-0.6.0.min.js"></script>
<script type="text/javascript" src="${LIBDIR}/SoundJS/lib/flashaudioplugin-0.6.0.min.js"></script>
<script type="text/javascript" src="${LIBDIR}/lodash/dist/lodash.min.js"></script>
<script type="text/javascript" src="${LIBDIR}/jquery/jquery.min.js"></script>
<script type="text/javascript" src="${LIBDIR}/jquery-ui/ui/minified/jquery-ui.min.js"></script>
<script type="text/javascript" src="${LIBDIR}/velocity/velocity.min.js"></script>
<script type="text/javascript" src="${LIBDIR}/codemirror/lib/codemirror.js"></script>
<script type="text/javascript" src="${LIBDIR}/codemirror/addon/hint/show-hint.js"></script>
<script type="text/javascript" src="${LIBDIR}/codemirror/addon/lint/lint.js"></script>
<script type="text/javascript" src="${LIBDIR}/codemirror/addon/selection/active-line.js"></script>
<script type="text/javascript" src="${LIBDIR}/codemirror/mode/javascript/javascript.js"></script>
<script type="text/javascript" src="${LIBDIR}/codemirror/addon/hint/javascript-hint.js"></script>
<script type="text/javascript" src="${LIBDIR}/fuzzy/lib/fuzzy.js"></script>
<script type="text/javascript" src="${LIBDIR}/socket.io-client/socket.io.js"></script>
<script type="text/javascript" src="${LIBDIR}/react/react.js"></script>
<script type="text/javascript" src="${LIBDIR}/react/react-dom.js"></script>
<script type="text/javascript" src="${LIBDIR}/entry-lms/dist/assets/app.js"></script>
<script
    type="text/javascript"
    src="${LIBDIR}/literallycanvas-mobile/lib/js/literallycanvas.js"
></script>
<script type="text/javascript" src="${LIBDIR}/entry-tool/dist/entry-tool.js"></script>

<!-- playentry ์„œ๋ฒ„์— ํฌํ•จ๋œ ์ฝ”๋“œ -->
<script type="text/javascript" src="https://playentry.org/js/jshint.js"></script>
<script type="text/javascript" src="https://playentry.org/js/textmode/python/python.js"></script>

<!-- entryjs ๋ฐ entryjs ์— ํฌํ•จ๋œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค -->
<script type="text/javascript" src="${LIBDIR}/entryjs/extern/util/filbert.js"></script>
<script type="text/javascript" src="${LIBDIR}/entryjs/extern/util/CanvasInput.js"></script>
<script type="text/javascript" src="${LIBDIR}/entryjs/extern/util/ndgmr.Collision.js"></script>
<script type="text/javascript" src="${LIBDIR}/entryjs/extern/util/handle.js"></script>
<script type="text/javascript" src="${LIBDIR}/entryjs/extern/util/bignumber.min.js"></script>

<!-- entryjs core / ์–ธ์–ด ๋ฐ ๊ธ€๋กœ๋ฒŒ ์„ค์ •์ด ํฌํ•จ๋˜์–ด์žˆ์Šต๋‹ˆ๋‹ค. -->
<script type="text/javascript" src="${LIBDIR}/entryjs/extern/lang/ko.js"></script>
<script type="text/javascript" src="${LIBDIR}/entryjs/extern/util/static.js"></script>
<script type="text/javascript" src="${LIBDIR}/entryjs/dist/entry.min.js"></script>

entryjs ์Šคํƒ€์ผ์‹œํŠธ

๋ธ”๋ก ๋””์ž์ธ๊ณผ ๊ด€๋ จ๋œ ๊ธฐ๋ณธ์ ์ธ ์Šคํƒ€์ผ๋“ค์ด ์ •์˜๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

<link rel="stylesheet" href="${LIBDIR}/entryjs/dist/entry.css" />

์—”ํŠธ๋ฆฌ ์ดˆ๊ธฐํ™” (Inject Options)

ํ•„์š”ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ entryjs๋ฅผ ๋กœ๋”ฉํ•˜์˜€์œผ๋ฉด ํ˜„์žฌ DOM์˜ ํŠน์ • ์œ„์น˜์— Javascript๋ฅผ ์ด์šฉํ•ด entryjs workspace๋ฅผ ์ฃผ์ž…ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • Entry.init(domElement, initOptions);

    <div id="workspace"></div>
    var workspace = document.getElementById('workspace');
    var initOptions = {
        type: 'workspace',
        libDir: '/lib',
        fonts: [
            {
                name: '๋‚˜๋ˆ”๊ณ ๋”•',
                family: 'Nanum Gothic',
                url: '/css/nanumgothic.css',
            },
        ],
    };
    Entry.init(workspace, initOptions);
  • domElement : Entry๊ฐ€ Inject๋  DOM ๋…ธ๋“œ.

  • initOptions : entryjs workspace์˜ ์˜ต์…˜๊ฐ’.

initOptions

Workspace ํƒ€์ž…๊ณผ ํฐํŠธ์ •๋ณด๋ฅผ ์ œ์™ธํ•œ ๋ชจ๋“  ์˜ต์…˜์€ ์„ ํƒ์‚ฌํ•ญ์ด๋ฉฐ Boolean ํƒ€์ž…์ž…๋‹ˆ๋‹ค.

  • ํ•„์ˆ˜ํ•ญ๋ชฉ

    • type: ์›Œํฌ์ŠคํŽ˜์ด์Šค ํƒ€์ž…. (workspace: ๋งŒ๋“ค๊ธฐ ํ™˜๊ฒฝ, minimize: ๊ตฌ๊ฒฝํ•˜๊ธฐ ํ™˜๊ฒฝ)
    • libDir: ์จ๋“œํŒŒํ‹ฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ €์žฅ์†Œ. entryjs๋ฅผ ํฌํ•จํ•œ Library ์œ„์น˜. (๊ธฐ๋ณธ๊ฐ’: '/lib')
    • fonts: ์›นํฐํŠธ ์ •๋ณด
  • ์„ ํƒํ•ญ๋ชฉ

    • projectsaveable: ํ”„๋กœ์ ํŠธ ์ €์žฅ๊ฐ€๋Šฅ ์—ฌ๋ถ€ (true)
    • objectaddable: ์˜ค๋ธŒ์ ํŠธ ์ถ”๊ฐ€๊ฐ€๋Šฅ ์—ฌ๋ถ€ (true)
    • objectEditable: ์˜ค๋ธŒ์ ํŠธ ์ˆ˜์ •๊ฐ€๋Šฅ ์—ฌ๋ถ€ (true). ์ด๊ฐ’์„ false๋กœ ์„ธํŒ…ํ•˜๋ฉด objectAddable๋„ false๊ฐ€ ๋œ๋‹ค.
    • objectdeletable: ์˜ค๋ธŒ์ ํŠธ ์‚ญ์ œ๊ฐ€๋Šฅ ์—ฌ๋ถ€ (true)
    • soundeditable: ์†Œ๋ฆฌ ์ˆ˜์ •๊ฐ€๋Šฅ ์—ฌ๋ถ€ (true)
    • pictureeditable: ๋ชจ์–‘ ์ˆ˜์ •๊ฐ€๋Šฅ ์—ฌ๋ถ€ (true)
    • sceneEditable: ์žฅ๋ฉด ์ˆ˜์ •๊ฐ€๋Šฅ ์—ฌ๋ถ€ (true)
    • functionEnable: ํ•จ์ˆ˜ ์‚ฌ์šฉ๊ฐ€๋Šฅ ์—ฌ๋ถ€ (true)
    • messageEnable: ์‹ ํ˜ธ ์‚ฌ์šฉ๊ฐ€๋Šฅ ์—ฌ๋ถ€ (true)
    • variableEnable: ๋ณ€์ˆ˜ ์‚ฌ์šฉ๊ฐ€๋Šฅ ์—ฌ๋ถ€ (true)
    • listEnable: ๋ฆฌ์ŠคํŠธ ์‚ฌ์šฉ๊ฐ€๋Šฅ ์—ฌ๋ถ€ (true)
    • isForLecture: ๊ฐ•์˜์šฉ ํ”„๋กœ์ ํŠธ ์—ฌ๋ถ€ (false)
    • textCodingEnable: ์—”ํŠธ๋ฆฌ ํŒŒ์ด์„  ์‚ฌ์šฉ๊ฐ€๋Šฅ ์—ฌ๋ถ€ (true)
    • hardwareEnable: ํ•˜๋“œ์›จ์–ด ์‚ฌ์šฉ๊ฐ€๋Šฅ ์—ฌ๋ถ€ (true)
  • ์›นํฐํŠธ ์ •๋ณด ์—”ํŠธ๋ฆฌ ๊ธ€์ƒ์ž์™€ ๊ทธ๋ฆผํŒ์—์„œ ์‚ฌ์šฉํ•  ํฐํŠธ๋“ค์„ ํ•˜๋‚˜ ์ด์ƒ ๋ฐฐ์—ด๋กœ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    [
        {
            name: 'ํ™”๋ฉด์— ํ‘œ์‹œํ•  ํฐํŠธ ์ด๋ฆ„',
            family: 'font-family ์ด๋ฆ„',
            url: 'ํฐํŠธ ์ •์˜ํŒŒ์ผ ๊ฒฝ๋กœ',
        },
    ];
    // ์˜ˆ์‹œ
    [
        {
            name: '๋‚˜๋ˆ”๊ณ ๋”•',
            family: 'Nanum Gothic',
            url: '/css/nanumgothic.css',
        },
        {
            name: '๋‚˜๋ˆ”ํ•„๊ธฐ์ฒด',
            family: 'Nanum Pen Script',
            url: '/css/nanumpenscript.css',
        },
    ];

    ๋ฌด๋ฃŒ ํ•œ๊ธ€ ์›นํฐํŠธ๋Š” https://www.google.com/fonts/earlyaccess ์—์„œ ๋‹ค์šด๋กœ๋“œ ํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Entry.playground.setBlockMenu();

๋ธ”๋ก๋ฉ”๋‰ด ์ดˆ๊ธฐํ™”

Entry.loadProject(project);

ํ”„๋กœ์ ํŠธ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ. project ์ธ์ž๋ฅผ ์ƒ๋žตํ•  ๊ฒฝ์šฐ ๊ธฐ๋ณธ ํ”„๋กœ์ ํŠธ๋ฅผ ๋ฆฌํ„ดํ•ฉ๋‹ˆ๋‹ค.

์ด๋ฒคํŠธ. (Event description)

  • event listening
Entry.addEventListener(eventName, function);
  • eventName: ์บ์น˜ํ•˜๊ณ  ์‹ถ์€ ์ปค์Šคํ…€ ์ด๋ฒคํŠธ์˜ ์ด๋ฆ„
  • function: ํ•ด๋‹น ์ปค์Šคํ…€ ์ด๋ฒคํŠธ๊ฐ€ ๋ฐœ์ƒํ–ˆ์„ ๊ฒฝ์šฐ ์‹คํ–‰ ๋  ํ•จ์ˆ˜
  • event dispatch
Entry.dispatchEvent(eventName, params);
  • eventName: ๋ฐœ์ƒ ์‹œํ‚ค๊ณ  ์‹ถ์€ ์ด๋ฒคํŠธ์˜ ์ด๋ฆ„
  • params: ์ด๋ฒคํŠธ๋ฅผ ๋ฆฌ์Šค๋‹ ํ•˜๊ณ  ์žˆ๋Š” ์ฝœ๋ฐฑํ•จ์ˆ˜์— ๋„˜๊ฒจ์ค„ ํŒŒ๋ผ๋ฏธํ„ฐ
  • ๋Œ€ํ‘œ์ ์ธ ์ด๋ฒคํŠธ
  • run
  • stop
  • ์œ ์ € ์ธํ„ฐ๋ž™์…˜
  • keyPressed
  • keyUpped
  • canvasClick
  • canvasClickCanceled
  • entityClick
  • entityClickCanceled
  • stageMouseMove
  • stageMouseOut
  • ํ™”๋ฉด
  • windowResized

Entry.Toast

  • ์›Œํฌ์ŠคํŽ˜์ด์Šค ํ•˜๋‹จ์— ์•Œ๋ฆผ ๋ฉ”์‹œ์ง€ ํ‘œ์‹œ
  • Entry.Toast.warning(title, message, auto-dospose); // ์ฃผ์˜
  • Entry.Toast.success(title, message, auto-dospose); // ์„ฑ๊ณต
  • Entry.Toast.alert(title, message, auto-dospose); // ๊ฒฝ๊ณ 

๋ธ”๋ก ๋ชจ์–‘ ์ •์˜์™€ ์‹คํ–‰ ์Šคํฌ๋ฆฝํŠธ.

${entryjs}/src/blocks/**/*

๋ธ”๋ก ๋ชจ์–‘ ์ •์˜

EntryDocs - ๋ธ”๋ก ๋ช…์„ธ ์ž‘์„ฑ ์„ ์ฐธ๊ณ ํ•ด์ฃผ์„ธ์š”.

ํ”„๋กœ์ ํŠธ (Project Schema)

์ €์žฅ

: ์•„๋ž˜์˜ Entry ํ•จ์ˆ˜๋ฅผ ์ด์šฉํ•ด ํ•„์ˆ˜์ •๋ณด๋“ค์„ JSONํ˜•ํƒœ๋กœ ์ €์žฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ €์žฅ๋œ ํ”„๋กœ์ ํŠธ๋Š” Entry.loadProject(project) ๋ฅผ ์ด์šฉํ•ด ๋‹ค์‹œ ๋กœ๋“œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

var project = Entry.exportProject();

์ƒ์„ธ ์Šคํ‚ค๋งˆ

/**
 * MongoDB ์Šคํ‚ค๋งˆ ์˜ˆ์ œ.
 */
var ProjectSchema = new Schema({
    speed: { // ์ดˆ๋‹น ์‹คํ–‰ ํ”„๋ ˆ์ž„์ˆ˜
        type: Number,
        default: 60
    },
    objects: [ // ์˜ค๋ธŒ์ ํŠธ ๋ชฉ๋ก
        {
            id: String, // ์˜ค๋ธŒ์ ํŠธ ID. Unique.
            name: String, // ์˜ค๋ธŒ์ ํŠธ(๋˜๋Š” ๊ธ€์ƒ์ž ์ œ๋ชฉ) ์ด๋ฆ„.
            text: String, // ๊ธ€์ƒ์ž ๋‚ด์šฉ. (objectType์ด textBox์ผ ๊ฒฝ์šฐ)
            order: Number, // TODO
            objectType: String, // ์˜ค๋ธŒ์ ํŠธ ์œ ํ˜•. (sprite, textBox)
            scene: String, // ์žฅ๋ฉด ID. Unique.
            active: { // ์˜ค๋ธŒ์ ํŠธ ํ™œ์„ฑํ™” ์—ฌ๋ถ€
                type: Boolean,
                default: true
            },
            lock: { // ์˜ค๋ธŒ์ ํŠธ ์ž ๊ธˆ ์—ฌ๋ถ€
                type: Boolean,
                default: false
            },
            rotateMethod: String, // ํšŒ์ „๋ฐฉ์‹. (free, vertical, none)
            entity: { // ์—”ํ‹ฐํ‹ฐ ์ •๋ณด
                rotation: Number, // ํšŒ์ „
                direction: Number, // ๋ฐฉํ–ฅ
                x: Number, // x ์ขŒํ‘œ
                y: Number, // y ์ขŒํ‘œ
                regX: Number, // ๊ฐ€๋กœ ์ค‘์‹ฌ์ 
                regY: Number, // ์„ธ๋กœ ์ค‘์‹ฌ์ 
                scaleX: Number, // ๊ฐ€๋กœ ๋ฐฐ์œจ
                scaleY: Number, // ์„ธ๋กœ ๋ฐฐ์œจ
                width: Number, // ๋„“์ด
                height: Number, // ๋†’์ด
                imageIndex: Number, // TODO
                visible: Boolean, // ํ™”๋ฉดํ‘œ์‹œ ์—ฌ๋ถ€
                colour: String, // ๊ธ€์ƒ์ž ํฐํŠธ์ƒ‰๊น”
                font: String, // ๊ธ€์ƒ์ž ํฐํŠธ
                bgColor: String, // ๊ธ€์ƒ์ž ๋ฐฐ๊ฒฝ์ƒ‰๊น”
                textAlign: Number, // ๊ธ€์ƒ์ž ์ •๋ ฌ
                lineBreak: Boolean, // ๊ธ€์ƒ์ž ์ค„๋ฐ”๊ฟˆ ์—ฌ๋ถ€
                underLine: Boolean, // ๊ธ€์ƒ์ž
                strike: Boolean // ๊ธ€์ƒ์ž ๋ฐ‘์ค„
            },
            script: String, // ๋ธ”๋ก ์Šคํฌ๋ฆฝํŠธ
            sprite: { // ์Šคํ”„๋ผ์ดํŠธ ์ •๋ณด
                name: String, // ์Šคํ”„๋ผ์ดํŠธ ์ด๋ฆ„
                pictures: [{ // ๋ชจ์–‘ ๋ชฉ๋ก
                    id: String, // ๋ชจ์–‘ ID. Unique/
                    name: String, // ๋ชจ์–‘ ์ด๋ฆ„
                    fileurl: String, // ๋ชจ์–‘ ์ด๋ฏธ์ง€
                    dimension: { // ๋ชจ์–‘ ํฌ๊ธฐ
                        width: Number,
                        height: Number,
                        scaleX: Number,
                        scaleY: Number
                    },
                    scale: { // ํ™•๋Œ€, ์ถ•์†Œ ๋น„์œจ(100% ๊ธฐ์ค€)
                        type: Number,
                        default: 100
                    }
                }],
                sounds: [{ // ์†Œ๋ฆฌ ๋ชฉ๋ก
                    id: String, // ์†Œ๋ฆฌ ID. Unique.
                    name: String, // ์ด๋ฆ„
                    fileurl: String, // ์‚ฌ์šด๋“œ ํŒŒ์ผ URL
                    duration: Number // ์žฌ์ƒ์‹œ๊ฐ„. (์ดˆ๋‹จ์œ„)
                }]
            },
            selectedPictureId: String, // ํ˜„์žฌ ํ™œ์„ฑํ™”๋œ ๋ชจ์–‘์˜ ID
            selectedSoundId: String // ํ˜„์žฌ ํ™œ์„ฑํ™”๋œ ์†Œ๋ฆฌ์˜ ID

        }
    ],
    variables: [ // ํ”„๋กœ์ ํŠธ ๋ณ€์ˆ˜
        {
            name: String, // ๋ณ€์ˆ˜๋ช…
            variableType: String, // ๋ณ€์ˆ˜ํ˜•. (์ผ๋ฐ˜๋ณ€์ˆ˜: variable, ํƒ€์ด๋จธ: timer, ๋Œ€๋‹ต: answer, ์Šฌ๋ผ์ด๋“œ: slide, ๋ฆฌ์ŠคํŠธ: list)
            id: String, // ๋ณ€์ˆ˜ID. Unique.
            value: String, // ๋ณ€์ˆ˜ ๊ฐ’
            minValue: Number, // ์ตœ์†Œ๊ฐ’
            maxValue: Number, // ์ตœ๋Œ€๊ฐ’
            visible: Boolean, // ์บ”๋ฒ„์Šค์— ํ‘œ์‹œ์—ฌ๋ถ€
            x: Number, // ์ปจ๋ฒ„์Šค ์œ„์น˜ x์ขŒํ‘œ
            y: Number, // ์บ”๋ฒ„์Šค ์œ„์น˜ y์ขŒํ‘œ
            width: Number, // ๋„“์ด
            height: Number, // ๋†’์ด
            isCloud: { // ๊ณต์œ  ๋ณ€์ˆ˜ ์—ฌ๋ถ€
                type: Boolean,
                default: false
            },
            object: { // ์ง€์—ญ๋ณ€์ˆ˜์ผ ๊ฒฝ์šฐ ์ฐธ์กฐํ•˜๋Š” ์˜ค๋ธŒ์ ํŠธ ID
                type: String,
                default: null
            },
            array: [{ // ๋ณ€์ˆ˜ํ˜•์ด list์ผ ๊ฒฝ์šฐ ๊ฐ’ ๋ชฉ๋ก
                data: String // ๊ฐ’ ๋ฐ์ดํ„ฐ
            }]
        }
    ],
    messages: [ // ์‹ ํ˜ธ ๋ชฉ๋ก
        {
            name: String, // ์‹ ํ˜ธ๋ช…
            id: String // ์‹ ํ˜ธ ID. Unique.
        }
    ],
    functions: [ // ํ•จ์ˆ˜ ๋ชฉ๋ก
        {
            id: String, // ํ•จ์ˆ˜ ID. Unique.
            block: String, // ํ•จ์ˆ˜ ๋ธ”๋ก ์ •๋ณด
            content: String, // ํ•จ์ˆ˜ ์‹คํ–‰ ์ •๋ณด
                id: String,
                name: String
            }]
        }
    ],
    scenes: { // ์žฅ๋ฉด ์ •๋ณด
        type: [ // ์žฅ๋ฉด ๋ชฉ๋ก
            {
                name: String, // ์žฅ๋ฉด ์ด๋ฆ„
                id: String // ์žฅ๋ฉด ID. Unique.
            }
        ]
    },
});

Sprite, Picture, Sound schema

์Šคํ”„๋ผ์ดํŠธ

var SpriteSchema = new Schema({
    name: String, // ์Šคํ”„๋ผ์ดํŠธ ์ด๋ฆ„
    pictures: [
        {
            // ๋ชจ์–‘ ๋ชฉ๋ก
            name: String, // ๋ชจ์–‘ ์ด๋ฆ„
            fileurl: String, // ๋ชจ์–‘ ์ด๋ฏธ์ง€
            dimension: {
                // ๋ชจ์–‘ ํฌ๊ธฐ
                width: Number,
                height: Number,
            },
        },
    ],
    sounds: [
        {
            // ์†Œ๋ฆฌ ๋ชฉ๋ก
            name: String, // ์ด๋ฆ„
            fileurl: String, // ์‚ฌ์šด๋“œ ํŒŒ์ผ URL
            duration: Number, // ์žฌ์ƒ์‹œ๊ฐ„. (์ดˆ๋‹จ์œ„)
        },
    ],
});

๋ชจ์–‘

var PictureSchema = new Schema({
    name: String, // ๋ชจ์–‘ ์ด๋ฆ„
    fileurl: String, // ๋ชจ์–‘ ์ด๋ฏธ์ง€
    dimension: {
        // ๋ชจ์–‘ ํฌ๊ธฐ
        width: Number,
        height: Number,
    },
});

์†Œ๋ฆฌ

var SoundSchema = new Schema({
    name: String, // ์ด๋ฆ„
    fileurl: String, // ์‚ฌ์šด๋“œ ํŒŒ์ผ URL
    duration: Number, // ์žฌ์ƒ์‹œ๊ฐ„. (์ดˆ๋‹จ์œ„)
});

Copyright and License

EntryJS Copyright (c) 2015 Entry Labs.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.