hUI/README.md

145 lines
4 KiB
Markdown
Raw Normal View History

2024-02-17 21:49:45 +00:00
<p></p><p></p>
<img src="https://raw.githubusercontent.com/griffi-gh/hui/master/.assets/hui.svg" width="120" align="left">
2024-02-20 21:45:10 +00:00
<h1>hui</h1>
2024-02-17 21:48:48 +00:00
<div>
2024-02-19 16:10:30 +00:00
<span>
Simple UI library for games and other interactive applications
</span><a href="https://crates.io/crates/hui" float="right">
2024-02-19 16:35:12 +00:00
<img alt="crates.io" src="https://img.shields.io/crates/v/hui.svg?style=flat-square" align="right" height="20">
2024-02-19 16:10:30 +00:00
</a><br><a href="./LICENSE.txt" align="right" float="right">
2024-02-19 16:35:12 +00:00
<img alt="license" src="https://img.shields.io/github/license/griffi-gh/hui?style=flat-square" align="right" width="102" height="20">
2024-02-19 16:10:30 +00:00
</a><span>
2024-02-17 21:48:48 +00:00
Formerly kubi-ui
2024-02-19 16:10:30 +00:00
</span>
</div>
2024-02-17 21:48:48 +00:00
<p></p>
2024-02-17 21:33:09 +00:00
<br clear="all">
2024-02-17 21:53:39 +00:00
<table align="center">
2024-02-17 21:33:09 +00:00
<td>
<img src="https://raw.githubusercontent.com/griffi-gh/hui/master/.assets/demo0.gif" width="300">
2024-02-17 21:33:09 +00:00
</td>
<td>
<img src="https://raw.githubusercontent.com/griffi-gh/hui/master/.assets/demo1.gif" width="300">
2024-02-17 21:33:09 +00:00
</td>
</table>
2024-02-19 16:10:30 +00:00
2024-02-28 15:54:14 +00:00
<h2>Example</h2>
2024-02-28 16:01:43 +00:00
<img src="https://raw.githubusercontent.com/griffi-gh/hui/master/.assets/exemplaris.png" height="200" align="right">
<div>
<img src="https://raw.githubusercontent.com/griffi-gh/hui/master/.assets/000000.png" width="300" height="0" align="left">
2024-02-28 15:54:14 +00:00
<pre lang="rust">Container::default()
.with_size(size!(100%, 50%))
.with_align(Alignment::Center)
.with_padding(5.)
.with_gap(10.)
.with_corner_radius(10.)
.with_background(color::WHITE)
.with_children(|ui| {
Text::default()
.with_text("Hello, world")
.with_text_size(100)
.with_color(color::BLACK)
.add_child(ui);
Container::default()
.with_padding((10., 20.))
.with_corner_radius((2.5, 30., 2.5, 2.5))
.with_background(color::DARK_RED)
.with_children(|ui| {
Text::default()
.with_text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.")
.with_text_size(24)
.add_child(ui);
})
.add_child(ui);
})
2024-02-28 16:01:43 +00:00
.add_root(&mut hui, resolution);</pre></div>
2024-02-28 15:54:14 +00:00
2024-02-19 16:10:30 +00:00
<h2>Backends</h2>
2024-02-19 16:35:12 +00:00
<p>
Latest stable release:&nbsp;
<a href="https://crates.io/crates/hui" float="right">
<img alt="crates.io" src="https://img.shields.io/crates/v/hui.svg?style=flat-square&label=&color=0d1117" height="20">
</a>
</p>
2024-02-19 16:10:30 +00:00
<table>
<tr>
<th align="center">
<code>hui</code>
</th>
<th align="center">
2024-02-19 16:47:43 +00:00
<code>glium</code> (render)
2024-02-19 16:10:30 +00:00
</th>
<th align="center">
2024-02-19 16:47:43 +00:00
<code>winit</code> (platform)
2024-02-19 16:10:30 +00:00
</th>
<th align="center">
2024-02-19 16:47:43 +00:00
<code>wgpu</code> (render)
2024-02-19 16:10:30 +00:00
</th>
</tr>
2024-02-19 16:24:31 +00:00
<tr>
<td align="center">
2024-02-19 16:25:12 +00:00
<code>master</code>
2024-02-19 16:24:31 +00:00
</th>
<td>
2024-02-19 16:25:12 +00:00
<code>hui-glium = &lt;master&gt;</code><br>
2024-02-19 16:24:31 +00:00
<code>glium = "0.34"</code>
</td>
<td>
<code>hui-winit = &lt;master&gt;</code><br>
<code>winit = "0.29"</code>
</td>
2024-02-19 16:27:16 +00:00
<td align="center">(support planned)</td>
2024-02-19 16:24:31 +00:00
</tr>
2024-02-20 20:21:58 +00:00
<tr>
<td align="center">
<code>0.1.0-alpha.3</code>
</th>
<td>
<code>hui-glium = "0.1.0-alpha.3"</code><br>
<code>glium = "0.34"</code>
</td>
<td align="center" colspan="2">N/A</td>
</tr>
2024-02-19 16:10:30 +00:00
<tr>
<td align="center">
<code>0.1.0-alpha.2</code>
</th>
<td>
<code>hui-glium = "0.1.0-alpha.2"</code><br>
<code>glium = "0.34"</code>
</td>
<td align="center" colspan="2">N/A</td>
</tr>
<tr>
<td align="center">
<code>0.1.0-alpha.1</code>
</th>
<td>
<code>hui-glium = "0.1.0-alpha.1"</code><br>
<code>glium = "0.34"</code>
</td>
<td align="center" colspan="2">N/A</td>
</tr>
<!-- <tr>
<td align="center">
<code>0.0.2</code>
</th>
<td>
<code>hui-glium = "0.0.2"</code><br>
<code>glium = "0.34"</code>
</td>
<td align="center">-</td>
</tr>
<tr>
<td align="center">
<code>0.0.1</code>
</th>
<td>
<code>hui-glium = "0.0.1"</code><br>
<code>glium = "0.34"</code>
</td>
<td align="center">-</td>
</tr> -->
</table>