Raygui: An Immediate-Mode C UI for Wasm Tools Development

Rate this content
Bookmark
Slides

raygui is a very lightweight immediate-mode UI intended for tools development, combined with raylib, it allows the creation of small high-performant wasm web tools. In this talk we will analyze this specific use case for tools development.

Ramon Santamaria
Ramon Santamaria
19 min
28 Sep, 2023

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Welcome to the presentation of RightGui, an immediate mode CUI library for tools development. RightGui is a high-performance library that is stateless and uses small self-contained functions to process inputs and draw controls. It provides a variety of controls, customizable styles, and support tools for live style configuration. Additionally, there are tools like the icons editor and layout creator that allow for customizations and code generation. Reiki offers a variety of tools, including a sound editor, image manipulation canvas, and resource packer.

1. Introduction to RightGui Library

Short description:

Welcome to the presentation of RightGui, an immediate mode CUI library for tools development. RightGui is a high-performance library that is stateless and uses small self-contained functions to process inputs and draw controls. It can be used across multiple platforms and has a low memory footprint. The library is compiled through mscript to web assembly, allowing it to run efficiently on web platforms. It also provides a variety of icons and customizable styles.

Welcome, everybody. My name is Roman Santamaria. I'm an electronic engineer, a professor, entrepreneur, and for the last few years I've been developing tools and technology for the video games industry.

Today I'm going to present one of those technologies that is RightGui, that is an immediate mode CUI library intended for tools development. Actually, this same presentation is a web application, as you can see. It's running on web. And the that's the tool. And the presentation itself has been created with RightGui to demonstrate the possibilities and the versatility of this tool.

Okay, so let's start. What can you do with RightGui? What is exactly RightGui? Well, RightGui actually is an immediate mode library. It means that it does not store information internally. It is stateless. So actually all the UI system is based on small functions that are self-contained that can not only process all the inputs, but also draw all the control in immediate mode. Here is an example. This piece of code in C actually defines a button at the same time that draws the button and receives back the state of the button. If the button has been pressed, it enables a variable that is on the user side. And if that variable is enabled, it actually shows another immediate mode UI control that is a message box with some information. You can see that that code generate the button and when you press the button, you see it generates a key message box. That's all the code needed for the button and the message box, including in itself all the logic. That's an immediate mode library.

Also, the library is really high performance. At the back end, it uses another of my technologies that is Riley, that it's a popular C library, a very high performance in itself. It's code in C. And that code is compiled through mscript to web assembly, allowing to run in a very performant web, in a very performant way, all that code on, on a web platform, on a browser. Also, thanks to being a C library, it is multi platform. As I said, you can see it can run on web, but, on a browser, but it can also run the same, exactly the same code can be compiled for Windows, Linux, MacOS, FreeBSD, and even embedded systems, Android, Raspberry Pi, more esoteric operating systems like haiku, or even other operating systems that are supported by, by Riley, by the backend. In that regards the library, RI-D, being animated mode library, has a very, very low memory footprint. Actually the library only requires about 145 kilobytes of memory, of RAM memory, that's the total requirement for the library, and that considers the styles provided. It's a global variable containing 348 properties for the styles that actually you can change. The icons, the library provides, as you can see here, those icons are provided by the library, there are up to 250 icons defined but you can add more if you want.

2. Font, Support Tools, and Controls

Short description:

The font is the most memory expensive element in the library, with a total memory footprint of 145 kilobytes. ReiG includes a set of support tools for editing styles, creating icons, and defining layouts. The library, tools, and support tools are all free and open source. You can find them in this link. ReiG provides a wide range of controls, including labels, drop-down buttons, checkboxes, spinners, text boxes, combo boxes, color pickers, sliders, progress bars, scroll panels, grids, and rich text boxes.

And also the font, the font actually is the most memory expensive element because it includes several fonts for multiple languages. But on all the styles defined, actually you can see here several styles that can be changing in real time. You see all those styles are up to 136 kilobytes including the font texture atlas and all the properties of the atlas for proper rendering of the font. So total memory for Footprint is 145 kilobytes.

Also the library includes a set of support tools that allows to edit styles as you have seen right now. There is a styles editor. All the styles you have seen have been created with that styles editor. The styles editor also runs online and it has been also created using ReiG. We will see more about that. There is also another tool that is an icons editor that has been used to create all the icons that you can see in the buttons and all around. And finally, there is a third tool that is a layout editor. I have to mention that ReiG has not an auto layout mechanism. It's only the layout must be defined by the user. So the user has full control over all the layout or how everything is placed around. We'll see a bit more about those tools later on.

And finally, everything you have seen, ReiLib, ReiG and all the tools that interact with ReiG and all the support tools, everything is free and open source. And you can find it here in this link. That's about the features. What about the controls? Okay, here you have a live example of some or most of the controls available in ReiG. You got labels. Actually those things are labels. You got drop-down buttons, checkboxes. You also have spinners. You got a text box. Actually, you can place the quotes or everything. You have got a text box. You got combo boxes, different states, a guillies view, a toggle groups. Also you've got a color picker selector with alpha bars and a few bars, a sliders, progress bar, scroll panels, grids. You even have a bit more rich text box. Those are the controls available.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Optimizing HTML5 Games: 10 Years of Learnings
JS GameDev Summit 2022JS GameDev Summit 2022
33 min
Optimizing HTML5 Games: 10 Years of Learnings
Top Content
The open source PlayCanvas game engine is built specifically for the browser, incorporating 10 years of learnings about optimization. In this talk, you will discover the secret sauce that enables PlayCanvas to generate games with lightning fast load times and rock solid frame rates.
Building Fun Experiments with WebXR & Babylon.js
JS GameDev Summit 2022JS GameDev Summit 2022
33 min
Building Fun Experiments with WebXR & Babylon.js
Top Content
During this session, we’ll see a couple of demos of what you can do using WebXR, with Babylon.js. From VR audio experiments, to casual gaming in VR on an arcade machine up to more serious usage to create new ways of collaboration using either AR or VR, you should have a pretty good understanding of what you can do today.
Check the article as well to see the full content including code samples: article. 
Making Awesome Games with LittleJS
JS GameDev Summit 2022JS GameDev Summit 2022
34 min
Making Awesome Games with LittleJS
LittleJS is a super lightweight game engine that is easy to use and powerfully fast. The developer will talk about why he made it, what it does, and how you can use it to create your own games. The talk will include a demonstration of how to build a small game from scratch with LittleJS.
How Not to Build a Video Game
React Summit 2023React Summit 2023
32 min
How Not to Build a Video Game
In this talk we'll delve into the art of creating something meaningful and fulfilling. Through the lens of my own journey of rediscovering my passion for coding and building a video game from the ground up with JavaScript and React, we will explore the trade-offs between easy solutions and fast performance. You will gain valuable insights into rapid prototyping, test infrastructure, and a range of CSS tricks that can be applied to both game development and your day-to-day work.
Boost the Performance of Your WebGL Unity Games!
JS GameDev Summit 2023JS GameDev Summit 2023
7 min
Boost the Performance of Your WebGL Unity Games!
Unity, when deployed on the web, faces three critical challenges: build size, memory usage, and overall performance. This lecture delves deep into advanced optimization techniques to help you address each of these issues. Attendees will gain insights into:
- Effective strategies for optimizing textures, audio, and models.- A detailed analysis of our ASTC experimentation with Unity, shedding light on the unexpected results despite Unity's claims.- A comprehensive guide to Unity's memory profiling tool and its implications.- An exploration of lesser-known Unity settings that remain underutilized by many developers.
Additionally, we'll introduce our proprietary tool designed specifically for Unity optimization. We will also showcase CrazyGames' developer dashboard, our platform that enables developers to monitor and enhance the performance of their web-based games seamlessly. 
Join us to equip yourself with the latest strategies and tools to elevate your Unity web gaming projects.

Workshops on related topic

Make a Game With PlayCanvas in 2 Hours
JSNation 2023JSNation 2023
116 min
Make a Game With PlayCanvas in 2 Hours
Top Content
Featured WorkshopFree
Steven Yau
Steven Yau
In this workshop, we’ll build a game using the PlayCanvas WebGL engine from start to finish. From development to publishing, we’ll cover the most crucial features such as scripting, UI creation and much more.
Table of the content:- Introduction- Intro to PlayCanvas- What we will be building- Adding a character model and animation- Making the character move with scripts- 'Fake' running- Adding obstacles- Detecting collisions- Adding a score counter- Game over and restarting- Wrap up!- Questions
Workshop levelFamiliarity with game engines and game development aspects is recommended, but not required.
PlayCanvas End-to-End : the quick version
JS GameDev Summit 2022JS GameDev Summit 2022
121 min
PlayCanvas End-to-End : the quick version
Top Content
WorkshopFree
João Ruschel
João Ruschel
In this workshop, we’ll build a complete game using the PlayCanvas engine while learning the best practices for project management. From development to publishing, we’ll cover the most crucial features such as asset management, scripting, audio, debugging, and much more.
Should we have business logic in the UI?
JSNation 2022JSNation 2022
148 min
Should we have business logic in the UI?
WorkshopFree
Samuel Pinto
Samuel Pinto
How many times did you say or hear “this is business logic, it should not be here”?In this workshop, we will create a modern frontend application using old patterns and you will learn how to build apps that have decoupled UI and services.We will start with a React application that has its whole logic in the UI. Then step by step we will extract the rules and operations to hit that sweet spot of independence.
Introduction to WebXR with Babylon.js
JS GameDev Summit 2022JS GameDev Summit 2022
86 min
Introduction to WebXR with Babylon.js
Workshop
Gustavo Cordido
Gustavo Cordido
In this workshop, we'll introduce you to the core concepts of building Mixed Reality experiences with WebXR and Balon.js.
You'll learn the following:- How to add 3D mesh objects and buttons to a scene- How to use procedural textures- How to add actions to objects- How to take advantage of the default Cross Reality (XR) experience- How to add physics to a scene
For the first project in this workshop, you'll create an interactive Mixed Reality experience that'll display basketball player stats to fans and coaches. For the second project in this workshop, you'll create a voice activated WebXR app using Balon.js and Azure Speech-to-Text. You'll then deploy the web app using Static Website Hosting provided Azure Blob Storage.