font-family:Geneva;font-size:12px;color:#ffffff;text-align:left;text-decoration:none;text-decoration-color:#ffffff;
screentodepth( mouse.x, mouse.y, hit);
pylons.editmode = true;
if(hit.y == scene[*xml.scene].floorheight,
copy(ppf, pylons.prefix);
ppcount = arr[pylon].item.count;
inc(ppcount);
global.npn = ppf + ppcount;
copy(ppf, pylons.prefix);
arr.createarrayitem(*npn);
arr[pylon].item[*npn].scene = xml.scene;
arr[pylon].item[*npn].style = 'pylon_ground2';
arr[pylon].item[*npn].tx = hit.x;
arr[pylon].item[*npn].ty = hit.y;
arr[pylon].item[*npn].tz = hit.z;
arr[pylon].item[*npn].mastheight = *pylons.mastheight;
arr[pylon].item[*npn].html = 'text';
MakePylons();
MakePylonEditor(*npn,hit.x,hit.y,hit.z,*pylons.mastheight,'text');
);
copy(startx, mouse.stagex);
copy(starty, mouse.stagey);
callwith(caller,scope(global,getvar()));
copy(startv, pvar);
asyncloop(caller.pressed,
calc(dx, (mouse.stagex - startx) / stagewidth );
calc(dy, (mouse.stagey - starty) / stageheight );
if(dx*dx GT dy*dy,
calc(pvar,startv + dx * caller.vardragrange);
,
calc(pvar,startv + dy * caller.vardragrange);
);
callwith(caller,scope(global,setvar()));
);
addlayer(pebg,pbg);
pbg.loadstyle(pyeditor_bg);
addlayer(petit,pti);
pti.loadstyle(pyeditor_tit);
pti.html = 'Name: %1 [br][br] Click the hotspot to open and edit' ;
addlayer(pemh,pm);
pm.loadstyle(pyeditor_mast);
pm.getvar = "copy(pvar, hotspot[mast_%1].height);";
pm.setvar = "copy(hotspot[mast_%1].height, pvar);calc(hotspot[top_%1].ty, hotspot[*npn].ty - pvar/2.5); updatescreen(); roundval(rmh,pvar,0); txtadd(html,'Mastheight: ',calc(rmh/2.5));";
addlayer(petxt,pt);
pt.loadstyle(pyeditor_text);
addlayer(pedone,pd);
pd.loadstyle(pyeditor_done);
tn = 'top_' + npn;
hotspot[*tn].text = layer[petxt].text;
trace('COPY TO THE PYLON ARRAY');
copy(ch, hotspot[*npn]);
cmh = rmh/2.5;
if(pylons.custommastheight,
pylonprint = data[pyopen].content + ' name="' + npn + '" scene="' + xml.scene + '" style="YOUR PYLON STYLE" tx="' + ch.tx + '" ty="' + ch.ty + '" tz="' + ch.tz + '" mastheight="' + cmh + '" html="' + layer[petxt].html + '" ' + data[pyclose].content;
,
pylonprint = data[pyopen].content + ' name="' + npn + '" scene="' + xml.scene + '" style="YOUR PYLON STYLE" tx="' + ch.tx + '" ty="' + ch.ty + '" tz="' + ch.tz + '" mastheight="'+pylons.mastheight+'" html="' + layer[petxt].html + '" ' + data[pyclose].content;
);
trace(pylonprint);
screentodepth( mouse.x, mouse.y, hit);
roundval(hit.y, 1);
showlog();
trace('tx="', hit.x,'" ty="', hit.y,'" tz="', hit.z,'"');
]]>