当前位置: 动力学知识库 > 问答 > 编程问答 >

objective c - MultiTouch Scaling for iOS

问题描述:

I'm working on an app that will take four touches, scale them appropriately, and then send those values to control an embedded synthesizer.

What I have so far is:

//Assign seperate touches to scaling values

_firstTouch=[[OneTouch alloc] initWithFrame:frame1

scalingValue:PITCH_SCALING

withColor:[UIColor redColor]

delegate:self

uniqueID:1];

_secondTouch=[[OneTouch alloc] initWithFrame:frame2

scalingValue:OFFSET_SCALING

withColor:[UIColor blackColor]

delegate:self

uniqueID:2];

_thirdTouch=[[OneTouch alloc] initWithFrame:frame3

scalingValue:DENSITY_SCALING

withColor:[UIColor cyanColor]

delegate:self

uniqueID:3];

_fourthTouch=[[OneTouch alloc] initWithFrame:frame4

scalingValue:DURATION_SCALING

withColor:[UIColor orangeColor]

delegate:self

uniqueID:4];

The "scaling" values are macros I set up in the corresponding .h file. They are:

#define PITCH_SCALING 1000.0

#define OFFSET_SCALING 20000.0

#define DENSITY_SCALING 100.0

#define DURATION_SCALING 1.0

What I can't figure out how to do is program each touch to go between the maximum (scaled) value and a minimum value (for example, pitch would scale between 100 and 1000).

Any ideas?

Thanks!

分享给朋友:
您可能感兴趣的文章:
随机阅读: