This file contains hidden or 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
function styleDoubleFullscreen(element) { | |
// Get bazaar-ad children | |
var children = element.querySelectorAll("div,iframe"); | |
// Style bazaar-ad | |
element.style.setProperty("height", "calc(200vh + 30px)"); | |
// for desktop | |
if (window.innerWidth > 500) { | |
element.style.setProperty("width", "100vw"); | |
element.style.setProperty("left", "-50vw"); |
This file contains hidden or 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
/* | |
* Copyright (c) 2015 Pontus Armini | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is | |
* furnished to do so, subject to the following conditions: | |
* |
This file contains hidden or 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
// | |
// CCAnimationManager+ExposeSequences.h | |
// | |
// | |
// Created by Pontus Armini on 2015-06-22. | |
// Copyright © 2015 Pontus Armini. All rights reserved. | |
// | |
#import "CCAnimationManager.h" |
This file contains hidden or 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
// | |
// CCPhysicsCollisionPair+SwiftCollisionPair.h | |
// | |
// | |
// Created by pontus armini on 2015-06-15. | |
// Copyright © 2015 Pontus Armini. All rights reserved. | |
// | |
#import "CCPhysicsNode.h" |
This file contains hidden or 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
/* | |
Setting up custom texture parameters: | |
Firstly, add this to Bridging-Header.h-file: #import "libs/cocos2d-iphone/cocos2d/CCTexture_Private.h" | |
The ccTexParams struct is set up with GLuint's. The texParams needs to be a 'var' and not a 'let' constant. | |
*/ | |
var texture = ... | |
var texParams = ccTexParams(minFilter: GLuint(GL_LINEAR), magFilter: GLuint(GL_LINEAR), wrapS: GLuint(GL_REPEAT), wrapT: GLuint(GL_CLAMP_TO_EDGE)) | |
texture.setTexParameters(&texParams) | |
/* |
This file contains hidden or 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
import Darwin | |
public func arc4random <T: IntegerLiteralConvertible> (type: T.Type) -> T { | |
var r: T = 0 | |
arc4random_buf(&r, Int(sizeof(T))) | |
return r | |
} | |
public extension UInt { | |
public static func random(lower: UInt = min, upper: UInt = max) -> UInt { |
This file contains hidden or 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
import Foundation | |
import CoreGraphics | |
class SwiftBubble:CCSprite { | |
static let π = CGFloat(M_PI) | |
//Number of segments (the more the smoother circle) and segment radius | |
static let numSegments = 60 | |
let physicsBodyRadius:CGFloat = 2.0 |
This file contains hidden or 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
// | |
// SoftBubble.h | |
// | |
// | |
// Created by Pontus Armini on 2015-04-12. | |
// | |
// | |
#import "CCSprite.h" |