在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:mayognaise/aframe-html-shader开源软件地址:https://github.com/mayognaise/aframe-html-shader开源编程语言:JavaScript 99.1%开源软件介绍:A-Frame HTML ShaderA shader to render 2D HTML and CSS to a texture for A-Frame. Inspired by: The screenshot of the HTML element is done via Properties
For reference, check out the following links: Available options by LimitationsWe will often see that the rendered looks different from how the source HTML in 2D. The process takes trial-and-error and can also depend on the device. To check what is actually rendered by MethodThe following method is coming soon:
EventsThe following events are coming soon:
VisibilityFor the conversion to canvas to work, we need to make the target HTML element technically visible and within the viewport, but we also don't want it to get in the way of our scene. We usually want to give the HTML element a fixed position and z-index it under everything: <div id="targetHTML" style="width: 100%; height: 100%; position: fixed; left: 0; top: 0; z-index: -1; overflow: hidden"></div> UsageBrowser InstallationInstall and use by directly including the browser files: <head>
<title>My A-Frame Scene</title>
<script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-html-shader.min.js"></script>
</head>
<body>
<a-scene>
<a-entity geometry="primitive: box" material="shader: html; target: #htmlElement"></a-entity>
</a-scene>
<div style="width: 100%; height: 100%; position: fixed; left: 0; top: 0; z-index: -1; overflow: hidden">
<div id="htmlElement" style="background: #F8F8F8; color: #333; font-size: 48px">Hello, HTML!</div>
</div>
</body> NPM InstallationInstall via NPM: npm install --save aframe-html-shader Then register and use. import 'aframe'
import 'aframe-html-shader' |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论