Skip to content

Instantly share code, notes, and snippets.

@pixelrevision
pixelrevision / SXFPSMeter
Created March 30, 2011 04:30
Quick and dirty frames per second meter for sparrow
#import <Foundation/Foundation.h>
#import "Sparrow.h"
@interface SXFPSMeter : SPTextField{
}
- (void)update:(SPEnterFrameEvent*)event;
@end
@pixelrevision
pixelrevision / SXCompiledTileMap.h
Created March 31, 2011 17:52
A tilemap setup for the sparrow framework
#import <Foundation/Foundation.h>
#import "Sparrow.h"
#import "SPCompiledSprite.h"
#import "SXTilemap.h"
#define SX_COMPILED_TILEMAP_RENDER_COMPLETE_EVENT @"renderComplete"
@interface SXCompiledTileMap : SXTilemap {
int quadrantsX;
int quadrantsY;
@pixelrevision
pixelrevision / Example usage
Created April 1, 2011 21:31
Will check the time of method execution
- (void)someMethod{
StartTimeLog
// do some stuff
EndTimeLog
}
@pixelrevision
pixelrevision / SXPointSpriteGroup.m
Created April 10, 2011 07:09
SXPointSpriteGroup.h
#import "SXPointSpriteGroup.h"
@implementation SXPointSpriteGroup
@synthesize texture;
- (id)initWithTexture:(SPTexture*)t andNumSprites:(int)amount{
self = [super init];
numPointSprites = amount;
self.texture = t;
[self reset];
#import "SXJoypad.h"
@implementation SXJoypad
@synthesize centerPoint;
@synthesize verticalDirection;
@synthesize horizontalDirection;
@synthesize projection;
@synthesize angle;
@synthesize projectionModifier;
#import "SXSlider.h"
@implementation SXSlider
@synthesize handle;
@synthesize track;
@synthesize value;
@synthesize min;
@synthesize max;
@synthesize percentage;
#import "SXSwitch.h"
@implementation SXSwitch
@synthesize on;
@synthesize onGraphic;
@synthesize offGraphic;
- (id)init{
self = [super init];
on = YES;
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <CoreVideo/CoreVideo.h>
#import <CoreMedia/CoreMedia.h>
@class PXRCamView;
@protocol PXRCamViewDelegate
- (void)camView:(PXRCamView*)cv didCaptureImage:(UIImage*)img;
@pixelrevision
pixelrevision / WritableDirectory.h
Created May 15, 2012 23:22
ios writable directory
#import <Foundation/Foundation.h>
@interface WritableDirectory : NSObject
+ (NSString*)getDir;
@end
@pixelrevision
pixelrevision / PixelPerfectCam.cs
Last active January 26, 2024 05:23
Script for unity to create a pixel locked orthogonal camera
using UnityEngine;
/**
* A camera to help with Orthagonal mode when you need it to lock to pixels. Desiged to be used on android and retina devices.
*/
public class PixelPerfectCam : MonoBehaviour {
/**
* The target size of the view port.
*/
public Vector2 targetViewportSizeInPixels = new Vector2(480.0f, 320.0f);
/**