미디어위키:Gadget-xash3d.js: 두 판 사이의 차이

리버티게임(개발), 모두가 만들어가는 자유로운 게임
둘러보기로 이동 검색으로 이동
imported>Senouis
(1차 생성)
 
imported>Senouis
편집 요약 없음
1번째 줄: 1번째 줄:
// Game canvas
var canvas = document.createElement("canvas");
var canvas = document.createElement("canvas");
canvas.style = "display:none;";
canvas.style = "display:none;";
6번째 줄: 7번째 줄:
var canvasparent = document.getElementsByClassName("emscripten_border")[0]; // first element of emscripten-border
var canvasparent = document.getElementsByClassName("emscripten_border")[0]; // first element of emscripten-border
canvasparent.appendChild(canvas);
canvasparent.appendChild(canvas);
// screen option
var gamecontrol = document.getElementById('xash-controls');
var a1 = document.createElement("a");
a1.class = "xash-glow";
a1.innerHTML = "<span><input type=\"checkbox\" id=\"resize\">Resize canvas</span>";
gamecontrol.appendChild(a1);
var a2 = document.createElement("a");
a2.class = "xash-glow";
a2.innerHTML = "<span><input type=\"checkbox\" id=\"pointerLock\" checked>Lock/hide mouse pointer &nbsp;&nbsp;&nbsp;</span>";
gamecontrol.appendChild(a2);
var controlinputspan = document.createElement("span");
controlinputspan.innerHTML = "<input type=\"button\" value=\"Fullscreen\" onclick=\"Module.requestFullscreen(document.getElementById('pointerLock').checked, document.getElementById('resize').checked)\">";
gamecontrol.appendChild(controlinputspan);
var outputcontainer = document.getElementById("xash-output-container");
outputcontainer.innerHTML = "<textarea id=\"xash-output\" rows=\"8\"></textarea>";
// game option
var gameoptionsTitle = document.getElementById("optionsTitle");
gameoptionsTitle.innerHTML = "<a class=\"glow\"><u><h1>Game Options</h1></u></a>";

2023년 3월 26일 (일) 23:49 판

// Game canvas
var canvas = document.createElement("canvas");
canvas.style = "display:none;";
canvas.class = "emscripten";
canvas.id = "canvas";
canvas.oncontextmenu = "event.preventDefault()";
var canvasparent = document.getElementsByClassName("emscripten_border")[0]; // first element of emscripten-border
canvasparent.appendChild(canvas);
// screen option
var gamecontrol = document.getElementById('xash-controls');
var a1 = document.createElement("a");
a1.class = "xash-glow";
a1.innerHTML = "<span><input type=\"checkbox\" id=\"resize\">Resize canvas</span>";
gamecontrol.appendChild(a1);
var a2 = document.createElement("a");
a2.class = "xash-glow";
a2.innerHTML = "<span><input type=\"checkbox\" id=\"pointerLock\" checked>Lock/hide mouse pointer &nbsp;&nbsp;&nbsp;</span>";
gamecontrol.appendChild(a2);
var controlinputspan = document.createElement("span");
controlinputspan.innerHTML = "<input type=\"button\" value=\"Fullscreen\" onclick=\"Module.requestFullscreen(document.getElementById('pointerLock').checked, document.getElementById('resize').checked)\">";
gamecontrol.appendChild(controlinputspan);
var outputcontainer = document.getElementById("xash-output-container");
outputcontainer.innerHTML = "<textarea id=\"xash-output\" rows=\"8\"></textarea>";
// game option
var gameoptionsTitle = document.getElementById("optionsTitle");
gameoptionsTitle.innerHTML = "<a class=\"glow\"><u><h1>Game Options</h1></u></a>";