This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:tutorials:imgui [2019/03/10 04:01 (5 years ago)] – sausage | en:tutorials:ui:imgui [2020/08/31 05:28 (4 years ago)] (current) – ↷ Links adapted because of a move operation sausage | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Creating your own ImGui based project ====== | ====== Creating your own ImGui based project ====== | ||
- | <WRAP center round box info 90%>Huge thanks go to the // | + | <WRAP center round box info 90%>Huge thanks go to the // |
- | <WRAP center round box info 90%> | + | You can easily generate a Dear ImGui project |
- | Start by working through the [[https:// | + | This article assumes that you have [[en:tutorials: |
- | Once those are done, head back here. | ||
- | Start by [[en: | + | ===== How to Create your own Dear ImGui project |
- | Your new project | + | There are two ways to create a Dear ImGui project. Firstly, using Interactive Mode: |
- | | + | |
- | - Add '' | + | |
- | - Add '' | + | |
- | Important: Ensure that your library order is: '' | + | Then follow all the prompts and choose |
- | Otherwise | + | |
- | Remove all code your main .cpp file. | + | [Extension] imgui: Dear ImGui support (https:// |
+ | |||
+ | The second way is to specify everything on the commandline: | ||
- | Add the following includes | + | init myGameFolder/ |
- | # | ||
- | # | ||
- | # | ||
+ | ===== Working with your project ===== | ||
- | + | Load your new Dear ImGui project | |
- | Copy the Viewport and Camera declarations from the ImGuiOrx test project (main.cpp) to your .cpp file. | + | |
- | Copy all the functions from the ImGuiOrx test project | + | |
- | + | ||
- | Change your '' | + | |
- | + | ||
- | | + | |
- | + | ||
- | Compiling will be fine but you' | + | |
- | + | ||
- | Add the following Post Build command to your project configuration: | + | |
- | + | ||
- | cmd /c copy /Y ..\..\..\..\ImGuiOrx\test\\*.ini ..\..\..\data\config | + | |
- | + | ||
- | Change | + | |
- | + | ||
- | Add the following to the bottom of your main project .ini file to load the ini files required from imgui: | + | |
- | + | ||
- | | + | |
Compile and run. You should get a nice screen with demo gui controls. | Compile and run. You should get a nice screen with demo gui controls. | ||
- | {{ : | + | {{ : |
- | Feel free to add the Orx logo back into the project by adding: | + | And just for some extra flair, add a little up/down movement to the logo in your main config file: |
- | + | ||
- | | + | |
- | + | ||
- | ... into the bottom of the '' | + | |
- | + | ||
- | And just for some extra flair, add a little up/down movement to the logo: | + | |
<code ini> | <code ini> | ||
[Object] | [Object] | ||
Graphic | Graphic | ||
- | SoundList | ||
- | Sound = appear.ogg | ||
Texture | Texture | ||
Pivot = center | Pivot = center | ||
- | Scale = 0.5 | ||
- | Position | ||
AngularVelocity = 18 | AngularVelocity = 18 | ||
FXList | FXList | ||
Line 84: | Line 52: | ||
</ | </ | ||
- | Now you can drag your windows over moving Orx objects. | + | ===== orx/Scroll based projects ===== |
- | {{ : | + | You can also create an orx/Scroll-based Dear ImGui project. |
===== Learning ImGui ===== | ===== Learning ImGui ===== | ||
Line 92: | Line 60: | ||
To get started learning how to use the UI Library, check the official repo page: https:// | To get started learning how to use the UI Library, check the official repo page: https:// | ||
- | Many examples are in the '' | + | You can also find the previous guide for Orx and Dear ImGui here: [[https:// |