HUDMakerKit
HUDMakerKit is customized Head-Up Display Maker written in Swift
HUDMakerKit has ProcessingKit engine. You can develop custom HUD with Processing draw functions.
Examples
| HUD | Code |
|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Requirements
- Swift 4.0 or later
- iOS 10.0 or later
Usage
- Create custom class that inherits from
HUDMaker
class SampleHUD: HUDMaker {
func draw(frameCount: Int) {
// the draw() function continuously executes the lines of code contained inside its block until the program is stopped or noLoop() is called.
}
}- Implement HUD animation in
draw()func
class SampleHUD: HUDMaker {
func draw(frameCount: Int) {
// MARK: Examples
fill(255, 0, 0) // Sets the color used to fill shapes
ellipse(50, 50, 100, 100) // Draws an ellipse (oval) to the screen
}
}- Create a CustomHUD instance & set CustomHUD to
HUDRunner
let customHUD = SampleHUD(frame: CGRect(x: 0, y: 0, width: 150, height: 150)) // Create a new instance
customHUD.backgroundColor = UIColor(red: 0.1, green: 0.1, blue: 0.1, alpha: 0.3)
customHUD.layer.cornerRadius = 10
HUDRunner.shared.customHUD = customHUD // Set a customHUD
HUDRunner.shared.show() // Show HUDWhat's Processing
- Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts.
- It provides drawing functions with simple syntax
- References
Draw Oval in Processing
// Draws an ellipse (oval) to the screen
// ellipse(center.x, center.y, width, height)
ellipse(100, 100, 100, 100);Fill an oval
// Sets the color used to fill shapes
// fill(R, G, B)
fill(255, 0, 0);
ellipse(100, 100, 100, 100);Set the stroke color
// Sets the color used to draw lines and borders around shapes
// stroke(R, G, B)
// Sets the width of the stroke used for lines, points, and the border around shapes.
// strokeWeight(weight)
stroke(255, 0, 0);
strokeWeight(5);
ellipse(100, 100, 100, 100);Installation
CocoaPods
Add the following to your Podfile:
pod "HUDMakerKit"
Carthage
Add the following to your Cartfile:
github "natmark/HUDMakerKit"
- Link your app with
HUDMakerKit.frameworkandProcessingKit.frameworkin Carthage/Build
Dependency
License
HUDMakerKit is available under the MIT license. See the LICENSE file for more info.









