-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SplashKit Interface Functionality #176
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- panels - popups - labels - buttons
- no more global font/font size - now the font/font size can be changed for portions of the interface
…tion - add sk_set_bitmap_pixel - sets a pixel on the bitmap's surface - add sk_refresh_bitmap - updates the textures from the surface - make get_ui_atlas use these - takes atlas initialization from 55ms to 1ms
- adds insets, treenodes, columns and headers - functions for adjusting layout (row widths, heights, etc) - more sensible initial layout - documentation for all existing functions
- provides warnings to the user when the API is misused - also rationalises layouting further
- adds paragraphs, checkboxes, sliders, number boxes, text boxes, and 'with label' variants - adds functions to test if last element was changed/confirmed - updates demo to show all widgets + multi-lingual support
- atlas based (see explanation in comment) - when called, generates an atlas for that sized blur - caches the last 20 of these for re-use
- reduces duplication of logic - system font now has a name, '__system_font__'
- and also _compute_bitmap_data
- previously would just segmentation fault
- rather than simply adjusting the brightness, increase saturation and adjust brightness to keep things perceptually sensible.
- compiler is a bit stricter
…ashkit-core into WhyPenguins-interface-styles
macite
approved these changes
Jul 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is dependent/related to a couple of others, please make sure they get merged together! See bottom for details
Overview
This PR adds the ability to easily create and style user interfaces with SplashKit programmatically, with an immediate mode GUI (IMGUI) style API. It uses the MicroUI library to handle widget logic, and SplashKit's in-built routines to handle input/rendering.
It is hoped that this will allow students to begin visualizing variables using the interface functions, and develop more interactive graphical programs with ease.
The API has been designed such that only a basic understanding of calling functions with parameters, and storing the returned values in variables is required - unlike most IMGUI APIs, pointers and so on are avoided.
Demo
See below for a demo of the interfaces that can be created:

Simple usage example
Main Changes
interface_driver
backend for abstracting out MicroUI to a degree.With some miscellaneous additions:
get_system_font()
functionsk_draw_blurred_rect(...)
functionFeature overview
Dependencies
Add MicroUI External - splashkit/splashkit-external#6
Related PRs
Tutorials on SplashKit's interface functionality - thoth-tech/splashkit.io-starlight#26