├── ASHUD-Example ├── ASHUD-Example.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── AntScript.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── AntScript.xcuserdatad │ │ └── xcschemes │ │ ├── ASHUD-Example.xcscheme │ │ └── xcschememanagement.plist └── ASHUD-Example │ ├── ASHUD.swift │ ├── ASTimeUtils.swift │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ └── MainMenu.xib │ └── Info.plist ├── ASHUD.swift ├── ASTimeUtils.swift ├── README.md └── example.png /ASHUD-Example/ASHUD-Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8F0C21AC1D06D0CF004C5E19 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F0C21AB1D06D0CF004C5E19 /* AppDelegate.swift */; }; 11 | 8F0C21AE1D06D0CF004C5E19 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8F0C21AD1D06D0CF004C5E19 /* Assets.xcassets */; }; 12 | 8F0C21B11D06D0CF004C5E19 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8F0C21AF1D06D0CF004C5E19 /* MainMenu.xib */; }; 13 | 8F0C21B91D06D129004C5E19 /* ASHUD.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F0C21B81D06D129004C5E19 /* ASHUD.swift */; }; 14 | 8F0C21BB1D06D180004C5E19 /* ASTimeUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F0C21BA1D06D180004C5E19 /* ASTimeUtils.swift */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXFileReference section */ 18 | 8F0C21A81D06D0CF004C5E19 /* ASHUD-Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ASHUD-Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 19 | 8F0C21AB1D06D0CF004C5E19 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 20 | 8F0C21AD1D06D0CF004C5E19 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 21 | 8F0C21B01D06D0CF004C5E19 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 22 | 8F0C21B21D06D0CF004C5E19 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 23 | 8F0C21B81D06D129004C5E19 /* ASHUD.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ASHUD.swift; sourceTree = ""; }; 24 | 8F0C21BA1D06D180004C5E19 /* ASTimeUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ASTimeUtils.swift; sourceTree = ""; }; 25 | /* End PBXFileReference section */ 26 | 27 | /* Begin PBXFrameworksBuildPhase section */ 28 | 8F0C21A51D06D0CF004C5E19 /* Frameworks */ = { 29 | isa = PBXFrameworksBuildPhase; 30 | buildActionMask = 2147483647; 31 | files = ( 32 | ); 33 | runOnlyForDeploymentPostprocessing = 0; 34 | }; 35 | /* End PBXFrameworksBuildPhase section */ 36 | 37 | /* Begin PBXGroup section */ 38 | 8F0C219F1D06D0CF004C5E19 = { 39 | isa = PBXGroup; 40 | children = ( 41 | 8F0C21AA1D06D0CF004C5E19 /* ASHUD-Example */, 42 | 8F0C21A91D06D0CF004C5E19 /* Products */, 43 | ); 44 | sourceTree = ""; 45 | }; 46 | 8F0C21A91D06D0CF004C5E19 /* Products */ = { 47 | isa = PBXGroup; 48 | children = ( 49 | 8F0C21A81D06D0CF004C5E19 /* ASHUD-Example.app */, 50 | ); 51 | name = Products; 52 | sourceTree = ""; 53 | }; 54 | 8F0C21AA1D06D0CF004C5E19 /* ASHUD-Example */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 8F0C21BA1D06D180004C5E19 /* ASTimeUtils.swift */, 58 | 8F0C21B81D06D129004C5E19 /* ASHUD.swift */, 59 | 8F0C21AB1D06D0CF004C5E19 /* AppDelegate.swift */, 60 | 8F0C21AD1D06D0CF004C5E19 /* Assets.xcassets */, 61 | 8F0C21AF1D06D0CF004C5E19 /* MainMenu.xib */, 62 | 8F0C21B21D06D0CF004C5E19 /* Info.plist */, 63 | ); 64 | path = "ASHUD-Example"; 65 | sourceTree = ""; 66 | }; 67 | /* End PBXGroup section */ 68 | 69 | /* Begin PBXNativeTarget section */ 70 | 8F0C21A71D06D0CF004C5E19 /* ASHUD-Example */ = { 71 | isa = PBXNativeTarget; 72 | buildConfigurationList = 8F0C21B51D06D0CF004C5E19 /* Build configuration list for PBXNativeTarget "ASHUD-Example" */; 73 | buildPhases = ( 74 | 8F0C21A41D06D0CF004C5E19 /* Sources */, 75 | 8F0C21A51D06D0CF004C5E19 /* Frameworks */, 76 | 8F0C21A61D06D0CF004C5E19 /* Resources */, 77 | ); 78 | buildRules = ( 79 | ); 80 | dependencies = ( 81 | ); 82 | name = "ASHUD-Example"; 83 | productName = "ASHUD-Example"; 84 | productReference = 8F0C21A81D06D0CF004C5E19 /* ASHUD-Example.app */; 85 | productType = "com.apple.product-type.application"; 86 | }; 87 | /* End PBXNativeTarget section */ 88 | 89 | /* Begin PBXProject section */ 90 | 8F0C21A01D06D0CF004C5E19 /* Project object */ = { 91 | isa = PBXProject; 92 | attributes = { 93 | LastSwiftUpdateCheck = 0730; 94 | LastUpgradeCheck = 0730; 95 | ORGANIZATIONNAME = antscript; 96 | TargetAttributes = { 97 | 8F0C21A71D06D0CF004C5E19 = { 98 | CreatedOnToolsVersion = 7.3.1; 99 | }; 100 | }; 101 | }; 102 | buildConfigurationList = 8F0C21A31D06D0CF004C5E19 /* Build configuration list for PBXProject "ASHUD-Example" */; 103 | compatibilityVersion = "Xcode 3.2"; 104 | developmentRegion = English; 105 | hasScannedForEncodings = 0; 106 | knownRegions = ( 107 | en, 108 | Base, 109 | ); 110 | mainGroup = 8F0C219F1D06D0CF004C5E19; 111 | productRefGroup = 8F0C21A91D06D0CF004C5E19 /* Products */; 112 | projectDirPath = ""; 113 | projectRoot = ""; 114 | targets = ( 115 | 8F0C21A71D06D0CF004C5E19 /* ASHUD-Example */, 116 | ); 117 | }; 118 | /* End PBXProject section */ 119 | 120 | /* Begin PBXResourcesBuildPhase section */ 121 | 8F0C21A61D06D0CF004C5E19 /* Resources */ = { 122 | isa = PBXResourcesBuildPhase; 123 | buildActionMask = 2147483647; 124 | files = ( 125 | 8F0C21AE1D06D0CF004C5E19 /* Assets.xcassets in Resources */, 126 | 8F0C21B11D06D0CF004C5E19 /* MainMenu.xib in Resources */, 127 | ); 128 | runOnlyForDeploymentPostprocessing = 0; 129 | }; 130 | /* End PBXResourcesBuildPhase section */ 131 | 132 | /* Begin PBXSourcesBuildPhase section */ 133 | 8F0C21A41D06D0CF004C5E19 /* Sources */ = { 134 | isa = PBXSourcesBuildPhase; 135 | buildActionMask = 2147483647; 136 | files = ( 137 | 8F0C21AC1D06D0CF004C5E19 /* AppDelegate.swift in Sources */, 138 | 8F0C21B91D06D129004C5E19 /* ASHUD.swift in Sources */, 139 | 8F0C21BB1D06D180004C5E19 /* ASTimeUtils.swift in Sources */, 140 | ); 141 | runOnlyForDeploymentPostprocessing = 0; 142 | }; 143 | /* End PBXSourcesBuildPhase section */ 144 | 145 | /* Begin PBXVariantGroup section */ 146 | 8F0C21AF1D06D0CF004C5E19 /* MainMenu.xib */ = { 147 | isa = PBXVariantGroup; 148 | children = ( 149 | 8F0C21B01D06D0CF004C5E19 /* Base */, 150 | ); 151 | name = MainMenu.xib; 152 | sourceTree = ""; 153 | }; 154 | /* End PBXVariantGroup section */ 155 | 156 | /* Begin XCBuildConfiguration section */ 157 | 8F0C21B31D06D0CF004C5E19 /* Debug */ = { 158 | isa = XCBuildConfiguration; 159 | buildSettings = { 160 | ALWAYS_SEARCH_USER_PATHS = NO; 161 | CLANG_ANALYZER_NONNULL = YES; 162 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 163 | CLANG_CXX_LIBRARY = "libc++"; 164 | CLANG_ENABLE_MODULES = YES; 165 | CLANG_ENABLE_OBJC_ARC = YES; 166 | CLANG_WARN_BOOL_CONVERSION = YES; 167 | CLANG_WARN_CONSTANT_CONVERSION = YES; 168 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 169 | CLANG_WARN_EMPTY_BODY = YES; 170 | CLANG_WARN_ENUM_CONVERSION = YES; 171 | CLANG_WARN_INT_CONVERSION = YES; 172 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 173 | CLANG_WARN_UNREACHABLE_CODE = YES; 174 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 175 | CODE_SIGN_IDENTITY = "-"; 176 | COPY_PHASE_STRIP = NO; 177 | DEBUG_INFORMATION_FORMAT = dwarf; 178 | ENABLE_STRICT_OBJC_MSGSEND = YES; 179 | ENABLE_TESTABILITY = YES; 180 | GCC_C_LANGUAGE_STANDARD = gnu99; 181 | GCC_DYNAMIC_NO_PIC = NO; 182 | GCC_NO_COMMON_BLOCKS = YES; 183 | GCC_OPTIMIZATION_LEVEL = 0; 184 | GCC_PREPROCESSOR_DEFINITIONS = ( 185 | "DEBUG=1", 186 | "$(inherited)", 187 | ); 188 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 189 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 190 | GCC_WARN_UNDECLARED_SELECTOR = YES; 191 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 192 | GCC_WARN_UNUSED_FUNCTION = YES; 193 | GCC_WARN_UNUSED_VARIABLE = YES; 194 | MACOSX_DEPLOYMENT_TARGET = 10.11; 195 | MTL_ENABLE_DEBUG_INFO = YES; 196 | ONLY_ACTIVE_ARCH = YES; 197 | SDKROOT = macosx; 198 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 199 | }; 200 | name = Debug; 201 | }; 202 | 8F0C21B41D06D0CF004C5E19 /* Release */ = { 203 | isa = XCBuildConfiguration; 204 | buildSettings = { 205 | ALWAYS_SEARCH_USER_PATHS = NO; 206 | CLANG_ANALYZER_NONNULL = YES; 207 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 208 | CLANG_CXX_LIBRARY = "libc++"; 209 | CLANG_ENABLE_MODULES = YES; 210 | CLANG_ENABLE_OBJC_ARC = YES; 211 | CLANG_WARN_BOOL_CONVERSION = YES; 212 | CLANG_WARN_CONSTANT_CONVERSION = YES; 213 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 214 | CLANG_WARN_EMPTY_BODY = YES; 215 | CLANG_WARN_ENUM_CONVERSION = YES; 216 | CLANG_WARN_INT_CONVERSION = YES; 217 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 218 | CLANG_WARN_UNREACHABLE_CODE = YES; 219 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 220 | CODE_SIGN_IDENTITY = "-"; 221 | COPY_PHASE_STRIP = NO; 222 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 223 | ENABLE_NS_ASSERTIONS = NO; 224 | ENABLE_STRICT_OBJC_MSGSEND = YES; 225 | GCC_C_LANGUAGE_STANDARD = gnu99; 226 | GCC_NO_COMMON_BLOCKS = YES; 227 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 228 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 229 | GCC_WARN_UNDECLARED_SELECTOR = YES; 230 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 231 | GCC_WARN_UNUSED_FUNCTION = YES; 232 | GCC_WARN_UNUSED_VARIABLE = YES; 233 | MACOSX_DEPLOYMENT_TARGET = 10.11; 234 | MTL_ENABLE_DEBUG_INFO = NO; 235 | SDKROOT = macosx; 236 | }; 237 | name = Release; 238 | }; 239 | 8F0C21B61D06D0CF004C5E19 /* Debug */ = { 240 | isa = XCBuildConfiguration; 241 | buildSettings = { 242 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 243 | COMBINE_HIDPI_IMAGES = YES; 244 | INFOPLIST_FILE = "ASHUD-Example/Info.plist"; 245 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 246 | PRODUCT_BUNDLE_IDENTIFIER = "com.antscript.ASHUD-Example"; 247 | PRODUCT_NAME = "$(TARGET_NAME)"; 248 | }; 249 | name = Debug; 250 | }; 251 | 8F0C21B71D06D0CF004C5E19 /* Release */ = { 252 | isa = XCBuildConfiguration; 253 | buildSettings = { 254 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 255 | COMBINE_HIDPI_IMAGES = YES; 256 | INFOPLIST_FILE = "ASHUD-Example/Info.plist"; 257 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 258 | PRODUCT_BUNDLE_IDENTIFIER = "com.antscript.ASHUD-Example"; 259 | PRODUCT_NAME = "$(TARGET_NAME)"; 260 | }; 261 | name = Release; 262 | }; 263 | /* End XCBuildConfiguration section */ 264 | 265 | /* Begin XCConfigurationList section */ 266 | 8F0C21A31D06D0CF004C5E19 /* Build configuration list for PBXProject "ASHUD-Example" */ = { 267 | isa = XCConfigurationList; 268 | buildConfigurations = ( 269 | 8F0C21B31D06D0CF004C5E19 /* Debug */, 270 | 8F0C21B41D06D0CF004C5E19 /* Release */, 271 | ); 272 | defaultConfigurationIsVisible = 0; 273 | defaultConfigurationName = Release; 274 | }; 275 | 8F0C21B51D06D0CF004C5E19 /* Build configuration list for PBXNativeTarget "ASHUD-Example" */ = { 276 | isa = XCConfigurationList; 277 | buildConfigurations = ( 278 | 8F0C21B61D06D0CF004C5E19 /* Debug */, 279 | 8F0C21B71D06D0CF004C5E19 /* Release */, 280 | ); 281 | defaultConfigurationIsVisible = 0; 282 | defaultConfigurationName = Release; 283 | }; 284 | /* End XCConfigurationList section */ 285 | }; 286 | rootObject = 8F0C21A01D06D0CF004C5E19 /* Project object */; 287 | } 288 | -------------------------------------------------------------------------------- /ASHUD-Example/ASHUD-Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ASHUD-Example/ASHUD-Example.xcodeproj/project.xcworkspace/xcuserdata/AntScript.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antscript/ASHUD/224e26d86d520b4dde192c77d6b5d2a1dc5a5d22/ASHUD-Example/ASHUD-Example.xcodeproj/project.xcworkspace/xcuserdata/AntScript.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ASHUD-Example/ASHUD-Example.xcodeproj/xcuserdata/AntScript.xcuserdatad/xcschemes/ASHUD-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ASHUD-Example/ASHUD-Example.xcodeproj/xcuserdata/AntScript.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ASHUD-Example.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8F0C21A71D06D0CF004C5E19 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ASHUD-Example/ASHUD-Example/ASHUD.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ASHUD.swift 3 | // UPer 4 | // 5 | // Created by AntScript on 5/18/16. 6 | // Copyright © 2016 AApp.Space. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Cocoa 11 | 12 | class ASHUD { 13 | 14 | static let sharedHUD = ASHUD() 15 | var window: NSWindow 16 | var hudView: NSView 17 | var hudTextField: NSTextField 18 | 19 | var delayTask:ASTimeUtils.Task? 20 | 21 | private init() { 22 | window = NSWindow(contentRect: NSMakeRect(0, 0, 500, 160), styleMask: NSBorderlessWindowMask, backing: .Buffered, defer: false) 23 | window.level = Int(CGWindowLevelForKey(CGWindowLevelKey.AssistiveTechHighWindowLevelKey)) 24 | window.opaque = false 25 | window.backgroundColor = NSColor.clearColor() 26 | window.ignoresMouseEvents = true 27 | 28 | hudView = NSView() 29 | 30 | 31 | hudTextField = NSTextField() 32 | hudTextField.preferredMaxLayoutWidth = (NSScreen.mainScreen()?.visibleFrame.size.width)! - 50 33 | hudTextField.bordered = false 34 | hudTextField.editable = false 35 | hudTextField.drawsBackground = false 36 | hudTextField.alignment = .Center 37 | hudTextField.usesSingleLineMode = true 38 | hudTextField.cell?.wraps = false 39 | hudView.addSubview(hudTextField) 40 | 41 | hudTextField.translatesAutoresizingMaskIntoConstraints = false 42 | hudView.addConstraint(NSLayoutConstraint(item: hudTextField, attribute: .CenterY, relatedBy: .Equal , toItem: hudView, attribute: .CenterY, multiplier: 1, constant: 0)) 43 | hudView.addConstraint(NSLayoutConstraint(item: hudTextField, attribute: .CenterX, relatedBy: .Equal , toItem: hudView, attribute: .CenterX, multiplier: 1, constant: 0)) 44 | hudView.addConstraint(NSLayoutConstraint(item: hudTextField, attribute: .Width, relatedBy: .Equal , toItem: hudTextField, attribute: .Width, multiplier: 1, constant: 0)) 45 | hudView.addConstraint(NSLayoutConstraint(item: hudTextField, attribute: .Height, relatedBy: .Equal , toItem: hudTextField, attribute: .Height, multiplier: 1, constant: 0)) 46 | 47 | 48 | window.contentView? = hudView 49 | window.contentView?.wantsLayer = true 50 | window.contentView?.layer?.masksToBounds = true 51 | window.contentView?.layer?.cornerRadius = 10 52 | 53 | 54 | 55 | 56 | 57 | 58 | window.makeKeyWindow() 59 | } 60 | 61 | 62 | func showHUD(msg: String , 63 | delayTime: NSTimeInterval = 3, 64 | position: ASHUDPosition = .Center, 65 | size: ASHUDSize = .Medium, 66 | style: ASHUDStyle = .Dark, 67 | bordered: Bool = false 68 | ) { 69 | 70 | guard let screenRect = NSScreen.mainScreen()?.visibleFrame else { 71 | 72 | return 73 | } 74 | 75 | ASTimeUtils.cancel(delayTask) 76 | 77 | hudTextField.stringValue = msg 78 | 79 | var borderWidth = 0 80 | switch size { 81 | case .Large: 82 | hudTextField.font = NSFont(name: (hudTextField.font?.fontName)!, size: 100) 83 | borderWidth = 5 84 | case .Medium: 85 | hudTextField.font = NSFont(name: (hudTextField.font?.fontName)!, size: 60) 86 | borderWidth = 3 87 | case .Small: 88 | hudTextField.font = NSFont(name: (hudTextField.font?.fontName)!, size: 20) 89 | borderWidth = 1 90 | } 91 | 92 | switch style { 93 | case .Dark: 94 | hudTextField.textColor = NSColor.whiteColor() 95 | hudView.layer?.backgroundColor = NSColor.blackColor().colorWithAlphaComponent(0.9).CGColor 96 | if bordered { 97 | hudView.layer?.borderWidth = CGFloat(borderWidth) 98 | hudView.layer?.borderColor = NSColor.whiteColor().CGColor 99 | } else { 100 | hudView.layer?.borderWidth = 0 101 | } 102 | case .Light: 103 | hudTextField.textColor = NSColor(red:0.15, green:0.16, blue:0.17, alpha:1.00) 104 | hudView.layer?.backgroundColor = NSColor.whiteColor().colorWithAlphaComponent(0.9).CGColor 105 | if bordered { 106 | hudView.layer?.borderWidth = CGFloat(borderWidth) 107 | hudView.layer?.borderColor = NSColor(red:0.15, green:0.16, blue:0.17, alpha:1.00).CGColor 108 | } else { 109 | hudView.layer?.borderWidth = 0 110 | } 111 | } 112 | 113 | 114 | hudTextField.sizeToFit() 115 | 116 | var displayBounds = NSMakeRect((screenRect.size.width - hudTextField.frame.size.width - 40) * 0.5, 0, hudTextField.frame.size.width + 40, hudTextField.frame.size.height + 40 ) 117 | switch position { 118 | case .Bottom: 119 | displayBounds.origin.y = 50 120 | case .Center: 121 | displayBounds.origin.y = (screenRect.size.height - hudTextField.frame.size.height - 40) * 0.5 122 | case .Top: 123 | displayBounds.origin.y = (screenRect.size.height - hudTextField.frame.size.height - 40 - 50) 124 | } 125 | 126 | window.setFrame(displayBounds, display: true) 127 | window.makeKeyAndOrderFront(self) 128 | 129 | delayTask = ASTimeUtils.delay(delayTime) { 130 | self.hideHUD() 131 | }! 132 | 133 | self.window.contentView?.alphaValue = 0 134 | NSAnimationContext.runAnimationGroup({ context in 135 | context.duration = 0.1 136 | self.window.contentView?.animator().alphaValue = 1 137 | }) { 138 | 139 | } 140 | } 141 | 142 | func hideHUD(fade: Bool = true) { 143 | 144 | guard fade else { 145 | window.orderOut(self) 146 | return 147 | } 148 | 149 | NSAnimationContext.runAnimationGroup({ context in 150 | context.duration = 0.2 151 | self.window.contentView?.animator().alphaValue = 0 152 | }) { 153 | self.window.orderOut(self) 154 | self.window.contentView?.alphaValue = 0 155 | } 156 | 157 | } 158 | 159 | } 160 | 161 | enum ASHUDPosition:Int { 162 | case Top,Bottom,Center 163 | } 164 | 165 | enum ASHUDSize:Int { 166 | case Small,Medium,Large 167 | } 168 | 169 | enum ASHUDStyle:Int { 170 | case Dark,Light 171 | } -------------------------------------------------------------------------------- /ASHUD-Example/ASHUD-Example/ASTimeUtils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ASTimeUtils.swift 3 | // 4 | // 5 | // Created by AntScript on 15/8/26. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | public class ASTimeUtils { 12 | 13 | public typealias Task = (cancel : Bool) -> () 14 | 15 | static public func delay(time:NSTimeInterval, task:()->()) -> Task? { 16 | 17 | func dispatch_later(block:()->()) { 18 | dispatch_after( 19 | dispatch_time( 20 | DISPATCH_TIME_NOW, 21 | Int64(time * Double(NSEC_PER_SEC))), 22 | dispatch_get_main_queue(), 23 | block) 24 | } 25 | 26 | var closure: dispatch_block_t? = task 27 | var result: Task? 28 | 29 | let delayedClosure: Task = { 30 | cancel in 31 | if let internalClosure = closure { 32 | if (cancel == false) { 33 | dispatch_async(dispatch_get_main_queue(), internalClosure); 34 | } 35 | } 36 | closure = nil 37 | result = nil 38 | } 39 | 40 | result = delayedClosure 41 | 42 | dispatch_later { 43 | if let delayedClosure = result { 44 | delayedClosure(cancel: false) 45 | } 46 | } 47 | 48 | return result; 49 | } 50 | 51 | static public func cancel(task:Task?) { 52 | task?(cancel: true) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /ASHUD-Example/ASHUD-Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ASHUD-Example 4 | // 5 | // Created by AntScript on 6/7/16. 6 | // Copyright © 2016 antscript. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | @IBOutlet weak var window: NSWindow! 15 | 16 | 17 | func applicationDidFinishLaunching(aNotification: NSNotification) { 18 | // Insert code here to initialize your application 19 | 20 | 21 | ASTimeUtils.delay(1){ 22 | self.showHUD() 23 | } 24 | } 25 | 26 | func applicationWillTerminate(aNotification: NSNotification) { 27 | // Insert code here to tear down your application 28 | } 29 | 30 | 31 | func showHUD() { 32 | // a Large HUD with Dark style in the Center of screen 33 | ASHUD.sharedHUD.showHUD("Center Large Dark",delayTime:3,position:.Center,size:.Large,style:.Dark,bordered:false) 34 | 35 | // a Medium HUD with Border and Dark style in the Bottom of screen 36 | // ASHUD.sharedHUD.showHUD("Bottom Medium Dark Border",delayTime:3,position:.Bottom,size:.Medium,style:.Dark,bordered:true) 37 | 38 | // a Small HUD with Light style in the Bottom of screen 39 | // ASHUD.sharedHUD.showHUD("Top Small Light , Top Small Light , Top Small Light Top Small Light , Top Small Light , Top Small Light ",delayTime:3,position:.Bottom,size:.Small,style:.Light,bordered:false) 40 | 41 | // a Large HUD with Border and Light style in the Center of screen 42 | // ASHUD.sharedHUD.showHUD("BIG HUD",delayTime:3,position:.Center,size:.Large,style:.Light,bordered:true) 43 | 44 | } 45 | 46 | 47 | } 48 | 49 | -------------------------------------------------------------------------------- /ASHUD-Example/ASHUD-Example/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /ASHUD-Example/ASHUD-Example/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | Default 540 | 541 | 542 | 543 | 544 | 545 | 546 | Left to Right 547 | 548 | 549 | 550 | 551 | 552 | 553 | Right to Left 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | Default 565 | 566 | 567 | 568 | 569 | 570 | 571 | Left to Right 572 | 573 | 574 | 575 | 576 | 577 | 578 | Right to Left 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | -------------------------------------------------------------------------------- /ASHUD-Example/ASHUD-Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2016 antscript. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /ASHUD.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ASHUD.swift 3 | // UPer 4 | // 5 | // Created by AntScript on 5/18/16. 6 | // Copyright © 2016 AApp.Space. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Cocoa 11 | 12 | class ASHUD { 13 | 14 | static let sharedHUD = ASHUD() 15 | var window: NSWindow 16 | var hudView: NSView 17 | var hudTextField: NSTextField 18 | 19 | var delayTask:ASTimeUtils.Task? 20 | 21 | private init() { 22 | window = NSWindow(contentRect: NSMakeRect(0, 0, 500, 160), styleMask: NSBorderlessWindowMask, backing: .Buffered, defer: false) 23 | window.level = Int(CGWindowLevelForKey(CGWindowLevelKey.AssistiveTechHighWindowLevelKey)) 24 | window.opaque = false 25 | window.backgroundColor = NSColor.clearColor() 26 | window.ignoresMouseEvents = true 27 | 28 | hudView = NSView() 29 | 30 | 31 | hudTextField = NSTextField() 32 | hudTextField.preferredMaxLayoutWidth = (NSScreen.mainScreen()?.visibleFrame.size.width)! - 50 33 | hudTextField.bordered = false 34 | hudTextField.editable = false 35 | hudTextField.drawsBackground = false 36 | hudTextField.alignment = .Center 37 | hudTextField.usesSingleLineMode = true 38 | hudTextField.cell?.wraps = false 39 | hudView.addSubview(hudTextField) 40 | 41 | hudTextField.translatesAutoresizingMaskIntoConstraints = false 42 | hudView.addConstraint(NSLayoutConstraint(item: hudTextField, attribute: .CenterY, relatedBy: .Equal , toItem: hudView, attribute: .CenterY, multiplier: 1, constant: 0)) 43 | hudView.addConstraint(NSLayoutConstraint(item: hudTextField, attribute: .CenterX, relatedBy: .Equal , toItem: hudView, attribute: .CenterX, multiplier: 1, constant: 0)) 44 | hudView.addConstraint(NSLayoutConstraint(item: hudTextField, attribute: .Width, relatedBy: .Equal , toItem: hudTextField, attribute: .Width, multiplier: 1, constant: 0)) 45 | hudView.addConstraint(NSLayoutConstraint(item: hudTextField, attribute: .Height, relatedBy: .Equal , toItem: hudTextField, attribute: .Height, multiplier: 1, constant: 0)) 46 | 47 | 48 | window.contentView? = hudView 49 | window.contentView?.wantsLayer = true 50 | window.contentView?.layer?.masksToBounds = true 51 | window.contentView?.layer?.cornerRadius = 10 52 | 53 | 54 | 55 | 56 | 57 | 58 | window.makeKeyWindow() 59 | } 60 | 61 | 62 | func showHUD(msg: String , 63 | delayTime: NSTimeInterval = 3, 64 | position: ASHUDPosition = .Center, 65 | size: ASHUDSize = .Medium, 66 | style: ASHUDStyle = .Dark, 67 | bordered: Bool = false 68 | ) { 69 | 70 | guard let screenRect = NSScreen.mainScreen()?.visibleFrame else { 71 | 72 | return 73 | } 74 | 75 | ASTimeUtils.cancel(delayTask) 76 | 77 | hudTextField.stringValue = msg 78 | 79 | var borderWidth = 0 80 | switch size { 81 | case .Large: 82 | hudTextField.font = NSFont(name: (hudTextField.font?.fontName)!, size: 100) 83 | borderWidth = 5 84 | case .Medium: 85 | hudTextField.font = NSFont(name: (hudTextField.font?.fontName)!, size: 60) 86 | borderWidth = 3 87 | case .Small: 88 | hudTextField.font = NSFont(name: (hudTextField.font?.fontName)!, size: 20) 89 | borderWidth = 1 90 | } 91 | 92 | switch style { 93 | case .Dark: 94 | hudTextField.textColor = NSColor.whiteColor() 95 | hudView.layer?.backgroundColor = NSColor.blackColor().colorWithAlphaComponent(0.9).CGColor 96 | if bordered { 97 | hudView.layer?.borderWidth = CGFloat(borderWidth) 98 | hudView.layer?.borderColor = NSColor.whiteColor().CGColor 99 | } else { 100 | hudView.layer?.borderWidth = 0 101 | } 102 | case .Light: 103 | hudTextField.textColor = NSColor(red:0.15, green:0.16, blue:0.17, alpha:1.00) 104 | hudView.layer?.backgroundColor = NSColor.whiteColor().colorWithAlphaComponent(0.9).CGColor 105 | if bordered { 106 | hudView.layer?.borderWidth = CGFloat(borderWidth) 107 | hudView.layer?.borderColor = NSColor(red:0.15, green:0.16, blue:0.17, alpha:1.00).CGColor 108 | } else { 109 | hudView.layer?.borderWidth = 0 110 | } 111 | } 112 | 113 | 114 | hudTextField.sizeToFit() 115 | 116 | var displayBounds = NSMakeRect((screenRect.size.width - hudTextField.frame.size.width - 40) * 0.5, 0, hudTextField.frame.size.width + 40, hudTextField.frame.size.height + 40 ) 117 | switch position { 118 | case .Bottom: 119 | displayBounds.origin.y = 50 120 | case .Center: 121 | displayBounds.origin.y = (screenRect.size.height - hudTextField.frame.size.height - 40) * 0.5 122 | case .Top: 123 | displayBounds.origin.y = (screenRect.size.height - hudTextField.frame.size.height - 40 - 50) 124 | } 125 | 126 | window.setFrame(displayBounds, display: true) 127 | window.makeKeyAndOrderFront(self) 128 | 129 | delayTask = ASTimeUtils.delay(delayTime) { 130 | self.hideHUD() 131 | }! 132 | 133 | self.window.contentView?.alphaValue = 0 134 | NSAnimationContext.runAnimationGroup({ context in 135 | context.duration = 0.1 136 | self.window.contentView?.animator().alphaValue = 1 137 | }) { 138 | 139 | } 140 | } 141 | 142 | func hideHUD(fade: Bool = true) { 143 | 144 | guard fade else { 145 | window.orderOut(self) 146 | return 147 | } 148 | 149 | NSAnimationContext.runAnimationGroup({ context in 150 | context.duration = 0.2 151 | self.window.contentView?.animator().alphaValue = 0 152 | }) { 153 | self.window.orderOut(self) 154 | self.window.contentView?.alphaValue = 0 155 | } 156 | 157 | } 158 | 159 | } 160 | 161 | enum ASHUDPosition:Int { 162 | case Top,Bottom,Center 163 | } 164 | 165 | enum ASHUDSize:Int { 166 | case Small,Medium,Large 167 | } 168 | 169 | enum ASHUDStyle:Int { 170 | case Dark,Light 171 | } -------------------------------------------------------------------------------- /ASTimeUtils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ASTimeUtils.swift 3 | // 4 | // 5 | // Created by AntScript on 15/8/26. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | public class ASTimeUtils { 12 | 13 | public typealias Task = (cancel : Bool) -> () 14 | 15 | static public func delay(time:NSTimeInterval, task:()->()) -> Task? { 16 | 17 | func dispatch_later(block:()->()) { 18 | dispatch_after( 19 | dispatch_time( 20 | DISPATCH_TIME_NOW, 21 | Int64(time * Double(NSEC_PER_SEC))), 22 | dispatch_get_main_queue(), 23 | block) 24 | } 25 | 26 | var closure: dispatch_block_t? = task 27 | var result: Task? 28 | 29 | let delayedClosure: Task = { 30 | cancel in 31 | if let internalClosure = closure { 32 | if (cancel == false) { 33 | dispatch_async(dispatch_get_main_queue(), internalClosure); 34 | } 35 | } 36 | closure = nil 37 | result = nil 38 | } 39 | 40 | result = delayedClosure 41 | 42 | dispatch_later { 43 | if let delayedClosure = result { 44 | delayedClosure(cancel: false) 45 | } 46 | } 47 | 48 | return result; 49 | } 50 | 51 | static public func cancel(task:Task?) { 52 | task?(cancel: true) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ASHUD 2 | ## A HUD utils for OS X wrote in Swift ([中文](https://antscript.com/post/2016-06-06-ASHUD/)) 3 | 4 | ![example image](example.png) 5 | 6 | # Installation 7 | Clone and copy ASHUD.swift and ASTimeUtils.swift to your project. 8 | 9 | 10 | # Usage 11 | ``` 12 | ASHUD.sharedHUD.showHUD(msg: String , 13 | delayTime: NSTimeInterval = 3, 14 | position: ASHUDPosition = .Center, 15 | size: ASHUDSize = .Medium, 16 | style: ASHUDStyle = .Dark, 17 | bordered: Bool = false 18 | ) 19 | 20 | example: 21 | 22 | // a Large HUD with Dark style in the Center of screen 23 | ASHUD.sharedHUD.showHUD("Center Large Dark",delayTime:3,position:.Center,size:.Large,style:.Dark,bordered:false) 24 | 25 | // a Medium HUD with Border and Dark style in the Bottom of screen 26 | ASHUD.sharedHUD.showHUD("Bottom Medium Dark Border",delayTime:3,position:.Bottom,size:.Medium,style:.Dark,bordered:true) 27 | 28 | // a Small HUD with Light style in the Bottom of screen 29 | ASHUD.sharedHUD.showHUD("Top Small Light , Top Small Light , Top Small Light Top Small Light , Top Small Light , Top Small Light ",delayTime:3,position:.Bottom,size:.Small,style:.Light,bordered:false) 30 | 31 | // a Large HUD with Border and Light style in the Center of screen 32 | ASHUD.sharedHUD.showHUD("BIG HUD",delayTime:3,position:.Center,size:.Large,style:.Light,bordered:true) 33 | 34 | ``` 35 | 36 | 37 | # License 38 | MIT license. See LICENSE for details. -------------------------------------------------------------------------------- /example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antscript/ASHUD/224e26d86d520b4dde192c77d6b5d2a1dc5a5d22/example.png --------------------------------------------------------------------------------