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
- (void)addDistortionTo:(SPDisplayObject *)target | |
{ | |
float scale = Sparrow.contentScaleFactor; | |
NSURL *url = scale == 1.0f ? | |
[NSURL URLWithString:@"http://i.imgur.com/n95LSGb.jpg"] : | |
[NSURL URLWithString:@"http://i.imgur.com/QRXLvws.jpg"]; | |
[SPTexture loadFromURL:url generateMipmaps:NO scale:scale | |
onComplete:^(SPTexture *texture, NSError *outError) | |
{ |
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
Pod::Spec.new do |s| | |
s.name = "Sparrow" | |
s.version = "2.1" | |
s.summary = "The Open Source Game Engine for iOS" | |
s.description = | |
<<-DESC | |
Sparrow is a pure Objective-C library for game developers, built from ground up | |
for iOS. If you have already worked with Adobe™ Flash or Starling, you will feel | |
right at home: Sparrow uses the same concepts and naming schemes. |
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 "Sparrow.h" | |
/// An SXGauge displays a texture, trimmed to its left side, depending on a ratio. | |
/// This can be used to display a progress bar or a time gauge. | |
@interface SXGauge : SPSprite | |
/// Indicates how much of the texture is displayed. Range: 0.0f - 1.0f | |
@property (nonatomic, assign) float ratio; |
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 tab:String = " "; | |
for each (var tinted:Boolean in [true, false]) | |
{ | |
trace(tinted ? "if (tinted)" : "else"); | |
trace("{"); | |
for each (var mipMap:Boolean in [true, false]) | |
{ | |
trace(tab, mipMap ? "if (mipMap)" : "else"); | |
trace(tab, "{"); | |
for each (var repeat:Boolean in [true, false]) |
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
#!/usr/bin/ruby | |
if ARGV.count < 1 | |
puts "Usage: #{script_name} source_path" | |
puts " (e.g. ../src/starling/)" | |
exit | |
end | |
search_path = ARGV[0] |
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 "SPDisplayObject.h" | |
@interface Polygon : SPDisplayObject | |
- (id)initWithRadius:(float)radius numEdges:(int)numEdges color:(uint)color; | |
- (id)initWithRadius:(float)radius numEdges:(int)numEdges; | |
@property (nonatomic, assign) int numEdges; | |
@property (nonatomic, assign) float radius; | |
@property (nonatomic, assign) uint color; |
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 "SPDisplayObject.h" | |
@interface TexturedPolygon : SPDisplayObject | |
- (id)initWithRadius:(float)radius numEdges:(int)numEdges texture:(SPTexture *)texture; | |
@property (nonatomic, assign) int numEdges; | |
@property (nonatomic, assign) float radius; | |
@property (nonatomic, strong) SPTexture *texture; | |
@property (nonatomic, assign) uint color; |
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 <QuartzCore/QuartzCore.h> // for CACurrentMediaTime() | |
- (void)runPoolBenchmark | |
{ | |
double startTime, endTime; | |
const int NumObjects = 1000000; | |
typedef SPMatrix SPObject; | |
[SPObject purgePool]; | |
NSMutableArray *array = [NSMutableArray arrayWithCapacity:NumObjects]; |
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
#!/bin/bash | |
air_sdk="/path/to/air_sdk" | |
adb="$air_sdk/lib/android/bin/adb" | |
adt="$air_sdk/bin/adt" | |
if [ ${1: -4} == ".ipa" ] | |
then | |
"$adt" -installApp -platform ios -package $1 | |
else |
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
// ================================================================================================= | |
// | |
// Starling Framework | |
// Copyright Gamua. All Rights Reserved. | |
// | |
// This program is free software. You can redistribute and/or modify it | |
// in accordance with the terms of the accompanying license agreement. | |
// | |
// ================================================================================================= |
OlderNewer