File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ < html >
2+ < head >
3+ < script src ="../aframe.js "> </ script >
4+ < script src ="../../index.js "> </ script >
5+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/rasterizehtml/1.2.2/rasterizeHTML.allinone.js "> </ script >
6+ </ head >
7+ < body >
8+ < a-scene >
9+ < a-sky color ="#6EBAA7 "> </ a-sky >
10+ < a-plane id ="screen " position ="0 1.25 -1 " color ="red " scale ="3 3 3 " canvas-2d ="width:500;height:500 "/>
11+ </ a-scene >
12+ < iframe id ="ui "> </ iframe >
13+ </ body >
14+ < script >
15+ var ctx = document . querySelector ( "#screen" ) . getContext ( "2d" )
16+ document . getElementById ( 'ui' ) . contentWindow . document . body . innerHTML = 'Hello Frame!<button style="position:absolute;left:100px;top:100px">Hey!</button>'
17+ rasterizeHTML . drawDocument ( document . getElementById ( 'ui' ) . contentWindow . document , ctx . canvas , { width : 500 } ) . then ( function success ( renderResult ) {
18+ ctx . update ( ) ;
19+ } , function error ( e ) {
20+ console . log ( e )
21+ } ) ;
22+ </ script >
23+ </ html >
You can’t perform that action at this time.
0 commit comments