try to draw 1000*1000 svg grig

This commit is contained in:
Gnieark 2016-06-29 12:55:45 +02:00
parent 50f1686af2
commit 64f9faf277
2 changed files with 11 additions and 8 deletions

View File

@ -13,10 +13,14 @@ function createElemNS(type,attributes){
function tron(bot1,bot2,xdcheck){ function tron(bot1,bot2,xdcheck){
//empty
while (document.getElementById('fightResult').firstChild) {
document.getElementById('fightResult').removeChild(document.getElementById('fightResult').firstChild);
}
// draw border;
var svg = createElem('svg',{'id':'map','width':'1000','height':'1000'});
var rect=createElemNS('rect',{'x':'0','y':'0','width':'1000','height':'1000','style':'stroke:#000000; fill:none;'});
svg.appendChild(rect);
//var svgDoc = svg.contentDocument; document.getElementById("fightResult").appendChild(svg);
var rect=createElemNS('rect',{'x':'10','y':'10','width':'50','height':'80','style':'stroke:#000000; fill:none;'});
document.getElementById("map").appendChild(rect);
} }

View File

@ -34,7 +34,6 @@ $bots=get_Bots_Array('tron');
</p> </p>
<p><input type="checkbox" id="fullLogs"/><label for="fullLogs">view the full logs</label></p> <p><input type="checkbox" id="fullLogs"/><label for="fullLogs">view the full logs</label></p>
<p><input id="fightButton" type="button" value="<?php echo $lang['FIGHT']; ?>" onclick="tron(document.getElementById('bot1').value,document.getElementById('bot2').value,'<?php echo xd_check_input(2); ?>',0);"></p> <p><input id="fightButton" type="button" value="<?php echo $lang['FIGHT']; ?>" onclick="tron(document.getElementById('bot1').value,document.getElementById('bot2').value,'<?php echo xd_check_input(2); ?>',0);"></p>
<svg id="map" width="1000" height="1000"> <div id="fightResult"></div>
</svg>
</article> </article>