hUI/README.md

148 lines
4 KiB
Markdown
Raw Normal View History

2024-02-17 15:49:45 -06:00
<p></p><p></p>
2024-03-25 08:26:20 -05:00
<img src="https://raw.githubusercontent.com/griffi-gh/hui/master/.assets/hui.svg" width="120" align="left" alt="logo">
<h1>hUI</h1>
2024-02-17 15:48:48 -06:00
<div>
2024-02-19 10:10:30 -06:00
<span>
Simple UI library for games and other interactive applications
</span><a href="https://crates.io/crates/hui" float="right">
2024-02-19 10:35:12 -06:00
<img alt="crates.io" src="https://img.shields.io/crates/v/hui.svg?style=flat-square" align="right" height="20">
2024-02-19 10:10:30 -06:00
</a><br><a href="./LICENSE.txt" align="right" float="right">
2024-02-19 10:35:12 -06: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 10:10:30 -06:00
</a><span>
(Formerly <code>kubi-ui</code>)
2024-02-19 10:10:30 -06:00
</span>
</div>
2024-02-17 15:48:48 -06:00
<p></p>
2024-02-17 15:33:09 -06:00
<br clear="all">
2024-02-17 15:53:39 -06:00
<table align="center">
2024-02-17 15:33:09 -06:00
<td>
2024-03-25 08:26:20 -05:00
<img src="https://raw.githubusercontent.com/griffi-gh/hui/master/.assets/demo0.gif" width="300" alt="example: mom_downloader">
2024-02-17 15:33:09 -06:00
</td>
<td>
2024-03-25 08:26:20 -05:00
<img src="https://raw.githubusercontent.com/griffi-gh/hui/master/.assets/demo1.gif" width="300" alt="example: align_test">
2024-02-17 15:33:09 -06:00
</td>
</table>
2024-02-19 10:10:30 -06:00
2024-02-28 09:54:14 -06:00
<h2>Example</h2>
2024-03-25 08:26:20 -05:00
<img src="https://raw.githubusercontent.com/griffi-gh/hui/master/.assets/exemplaris.png"
height="175" align="right" float="right" alt="code result">
2024-02-28 09:54:14 -06:00
<pre lang="rust">Container::default()
.with_size(size!(100%, 50%))
.with_align(Alignment::Center)
.with_padding(5.)
.with_gap(10.)
2024-03-25 08:26:20 -05:00
.with_background(frame_rect! {
color: (0.5, 0.5, 0.5, 1.),
corner_radius: 10.,
})
2024-02-28 09:54:14 -06:00
.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.))
2024-03-25 08:26:20 -05:00
.with_background(frame_rect! {
color: color::DARK_RED,
corner_radius: (2.5, 30., 2.5, 2.5),
})
2024-02-28 09:54:14 -06:00
.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-03-25 08:26:20 -05:00
.add_root(ui, size);</pre>
2024-02-28 09:54:14 -06:00
2024-02-19 10:10:30 -06:00
<h2>Backends</h2>
2024-02-19 10:35:12 -06: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 10:10:30 -06:00
<table>
<tr>
<th align="center">
<code>hui</code>
</th>
<th align="center">
2024-02-19 10:47:43 -06:00
<code>glium</code> (render)
2024-02-19 10:10:30 -06:00
</th>
<th align="center">
2024-02-19 10:47:43 -06:00
<code>winit</code> (platform)
2024-02-19 10:10:30 -06:00
</th>
<th align="center">
2024-02-19 10:47:43 -06:00
<code>wgpu</code> (render)
2024-02-19 10:10:30 -06:00
</th>
</tr>
2024-02-19 10:24:31 -06:00
<tr>
<td align="center">
2024-02-19 10:25:12 -06:00
<code>master</code>
2024-02-19 10:24:31 -06:00
</th>
<td>
2024-02-19 10:25:12 -06:00
<code>hui-glium = &lt;master&gt;</code><br>
2024-02-19 10:24:31 -06: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 10:27:16 -06:00
<td align="center">(support planned)</td>
2024-02-19 10:24:31 -06:00
</tr>
2024-02-20 14:21:58 -06: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 10:10:30 -06: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>