Unity Interface
HTML/JS style ui coding for Unity.
Still working in seperated repositories.
I'll merge it into one asset in the future.
<body>
<div class"header">
<img class="thumbnail" src="thumbnail.jpg" />
<div>
<text class="title">SuperMania2</text>
<text class="developer">Junchul Park</text>
<button class="install-btn">INSTALL</button>
</div>
</div>
<div class="dev-specs">
<img src="csharp.jpg />
<img src="unity.jpg />
<img src="android.jpg />
</div>
<scroll class="previews">
<img src="1.jpg" />
<img src="2.jpg" />
<img src="3.jpg" />
</scroll>
</body>
#title {
font-size: 50;
}
img {
width: 100;
height: 100;
}
[UtmlElementName("ctext")]
class CustomText : UtmlElement {
// This is a utml constructor.
public static void Construct(GameObject go, UtmlConstructionData cd) {
var text = go.AddComponent<Text>();
text.text = cd.innerText;
if (cd.HasAttribute("bold"))
text.style = TextStyle.Bold;
}
}
<ctext bold>Hello World!</ctext>
<utml>
<vertical>
<text>Hello</text>
<text>World</text>
</vertical>
<style>
text {
color: red;
}
</style>
</html>