Skip to content

Instantly share code, notes, and snippets.

@C4Code
C4Code / C4WorkSpace.m
Created March 18, 2013 19:01
C4Sample audio metering example
#import "C4WorkSpace.h"
@implementation C4WorkSpace {
C4Sample *s;
C4Timer *meterUpdateTimer;
C4Shape *peak, *avg;
}
-(void)setup {
s = [C4Sample sampleNamed:@"C4Loop.aif"];
@C4Code
C4Code / C4WorkSpace.m
Last active December 14, 2015 19:39
Overriding -(void)pressedLong:(id)sender;
//
// C4WorkSpace.m
//
// Created by Travis Kirton
//
#import "C4WorkSpace.h"
@implementation C4WorkSpace
@C4Code
C4Code / C4WorkSpace.m
Created March 9, 2013 19:47
Simple test of TAP gesture. All gestures are set, by default, to delay the touchesBegan method in the object to which they are attached. Uncomment lines 4 and 5 to see the difference.
@implementation C4WorkSpace
-(void)setup {
[self addGesture:TAP name:@"tap" action:@"tapped"];
//UIGestureRecognizer *g = [self gestureForName:@"tap"];
//g.delaysTouchesBegan = NO;
}
-(void)tapped {
C4Log(@"Called when the gesture recognizes a tap");
}
@C4Code
C4Code / C4WorkSpace.m
Created March 7, 2013 22:11
Basic initialization of 4 C4UIElements
#import "C4WorkSpace.h"
@implementation C4WorkSpace {
C4Button *button;
C4Slider *slider;
C4Stepper *stepper;
C4Switch *swich;
}
-(void)setup {
@C4Code
C4Code / C4WorkSpace.m
Created March 3, 2013 03:54
imageTransition
//
// C4WorkSpace.m
// imageTransition
//
// Created by moi on 13-03-02.
// Copyright (c) 2013 moi. All rights reserved.
//
#import "C4WorkSpace.h"
@C4Code
C4Code / C4WorkSpace.m
Created February 27, 2013 18:41
Animated Image
//
// C4WorkSpace.m
//
// Created by Travis Kirton
//
#import "C4WorkSpace.h"
@implementation C4WorkSpace {
C4Image *still;
@C4Code
C4Code / C4WorkSpace.m
Created February 26, 2013 21:31
Basic Shape Mask
//
// C4WorkSpace.m
//
// Created by Travis Kirton
//
#import "C4WorkSpace.h"
@implementation C4WorkSpace {
C4Image *image;
@C4Code
C4Code / C4WorkSpace.m
Created February 21, 2013 00:59
Working with Raw Pixels
//
// C4WorkSpace.m
//
// Created by Travis Kirton
//
#import "C4WorkSpace.h"
@implementation C4WorkSpace
@C4Code
C4Code / C4WorkSpace.m
Created February 15, 2013 14:31
Rotating a small rect that traces the strokeEnd point of a circle's path.
#import "C4WorkSpace.h"
@implementation C4WorkSpace {
C4Shape *s, *sq;
}
-(void)setup {
//create a shape and style it
s = [C4Shape ellipse:CGRectMake(0, 0, 200, 200)];
s.lineWidth = 10.0f;
s.center = self.canvas.center;
@C4Code
C4Code / gist:4734984
Created February 7, 2013 22:55
zPosition example, a bit wordy.
//
// C4WorkSpace.m
//
// Created by Travis Kirton and Greg Debicki.
//
#import "C4WorkSpace.h"
@implementation C4WorkSpace {
NSArray *shapes;