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
#import <Foundation/Foundation.h> | |
#import "cocos2d.h" | |
@interface CCTMXMapCharacter : CCNode { | |
CCTMXTiledMap *_map; | |
CCTMXLayer *_collidersLayer; | |
CGRect _collisionRect; | |
CGSize _mapSize; | |
CGSize _tileSize; |
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
$(document).ready(function(){ | |
var dpr = 1; | |
if(window.devicePixelRatio !== undefined) dpr = window.devicePixelRatio; | |
if(dpr >= 2){ | |
// convert image links to @2x images | |
$("img").each(function(){ | |
var newSrc = $(this).attr("src").replace(".png", "@2x.png"); | |
newSrc = $(this).attr("src").replace(".jpg", "@2x.jpg"); | |
newSrc = $(this).attr("src").replace(".jpeg", "@2x.jpeg"); | |
$(this).attr("src", newSrc); |
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
var UniqueRandom = function(min, max, increments){ | |
this.min = min; | |
this.max = max; | |
if(increments === undefined){ | |
this.increments = 1; | |
}else{ | |
this.increments = increments; | |
} | |
this.reset(); | |
}; |
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
var BitField = function(){}; | |
BitField.isSet = function(i, flag){ | |
return (i & flag) === flag; | |
} | |
BitField.setFlag = function(i, flag){ | |
return i | flag; | |
} | |
BitField.removeFlag = function(i, flag){ | |
return i & ~flag; | |
} |
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
$(document).ready(function(){ | |
$(document).find("[data-autoclear]").each(function(){ | |
$(this).data("clearValue", $(this).val()); | |
$(this).focus(function(){ | |
var cv = $(this).data("clearValue"); | |
if($(this).val() === cv){ | |
$(this).val(""); | |
} | |
}); | |
$(this).focusout(function(){ |
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
var Delegate = function(){} | |
Delegate.create = function(object, method){ | |
return (function() { return method.apply(object, arguments);}); | |
} |
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
#import <Foundation/Foundation.h> | |
typedef enum { | |
PXRImageSizeUtilVerticalAlignTop, | |
PXRImageSizeUtilVerticalAlignBottom, | |
PXRImageSizeUtilVerticalAlignMiddle | |
}PXRImageSizeUtilVerticalAlign; | |
typedef enum { | |
PXRImageSizeUtilHorizontalAlignLeft, |
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
NSArray *familyNames = [UIFont familyNames]; | |
for(NSString *family in familyNames){ | |
NSLog(@"-%@", family); | |
NSArray *fontNames = [UIFont fontNamesForFamilyName:family]; | |
for(NSString *font in fontNames){ | |
NSLog(@"----%@", font); | |
} | |
} |
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
var a = dateString.split(/[^0-9]/); | |
var date = new Date (a[0],a[1]-1,a[2],a[3],a[4],a[5]); |
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
var PXRWebViewMessenger = function(){ | |
this.prefixTrigger = "pxr"; | |
this.queue = []; | |
this.timer = null; | |
}; | |
PXRWebViewMessenger.prototype.callMethod = function(methodName, params){ | |
var self = this; | |
var message = {}; | |
message.method = methodName; |