(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
import Cocoa | |
import MASShortcut | |
func pow() { | |
let rect = NSScreen.mainScreen()?.frame | |
let window = NSWindow(contentRect: rect!, styleMask: NSBorderlessWindowMask, backing: .Buffered, `defer`: false) | |
window.backgroundColor = NSColor.clearColor() | |
window.opaque = false | |
window.alphaValue = 1 | |
window.makeKeyAndOrderFront(NSApplication.sharedApplication()) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Throughout, let
return_type
be the type of object/primitive/etc. you'd like to return (commonly void
)blockName
be the variable name of the block you're creatingvar_type
be the type object/primitive/etc. you'd like to pass as an argument (leave blank for no parameters)varName
be the variable name of the given parameter And remember that you can create as many parameters as you'd like.Possibly the most common for of declaration.
#include "Mercator.h" | |
#include "cinder/app/AppBasic.h" | |
#include "cinder/Vector.h" | |
using namespace ci; | |
using namespace std; | |
/* static method to map latitude and longitude to mercator 2d coords */ | |
Vec2f Mercator::mapLatLon( const Vec2f lat_lon ) { | |
/* mercator projection center was screen centered */ | |
Vec2f offset = Vec2f( app::getWindowWidth() / 2, app::getWindowHeight() / 2 ); |