Added in new GLPaint with GameView example

This commit is contained in:
chrisntr 2011-07-24 23:14:44 +01:00
Родитель 8af46ff260
Коммит cca1ea6152
20 изменённых файлов: 1150 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GLPaint-GameView", "GLPaint-GameView\GLPaint-GameView.csproj", "{8887E326-58AC-441E-AA81-AFED78B32B1E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|iPhoneSimulator = Release|iPhoneSimulator
Debug|iPhone = Debug|iPhone
Release|iPhone = Release|iPhone
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8887E326-58AC-441E-AA81-AFED78B32B1E}.Debug|iPhone.ActiveCfg = Debug|iPhone
{8887E326-58AC-441E-AA81-AFED78B32B1E}.Debug|iPhone.Build.0 = Debug|iPhone
{8887E326-58AC-441E-AA81-AFED78B32B1E}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{8887E326-58AC-441E-AA81-AFED78B32B1E}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{8887E326-58AC-441E-AA81-AFED78B32B1E}.Release|iPhone.ActiveCfg = Release|iPhone
{8887E326-58AC-441E-AA81-AFED78B32B1E}.Release|iPhone.Build.0 = Release|iPhone
{8887E326-58AC-441E-AA81-AFED78B32B1E}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{8887E326-58AC-441E-AA81-AFED78B32B1E}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = GLPaint-GameView\GLPaint-GameView.csproj
EndGlobalSection
EndGlobal

Двоичные данные
GLPaint-GameView/GLPaint-GameView/Default.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Двоичные данные
GLPaint-GameView/GLPaint-GameView/Erase.caf Executable file

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8887E326-58AC-441E-AA81-AFED78B32B1E}</ProjectGuid>
<ProjectTypeGuids>{E613F3A2-FE9C-494F-B74E-F63BCB86FEA6};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>GLPaintGameView</RootNamespace>
<MainNibFile>MainWindow.xib</MainNibFile>
<AssemblyName>GLPaintGameView</AssemblyName>
<MtouchMinimumOS>3.0</MtouchMinimumOS>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchLink>None</MtouchLink>
<MtouchDebug>True</MtouchDebug>
<MtouchUseLlvm>false</MtouchUseLlvm>
<ConsolePause>false</ConsolePause>
<MtouchUseSGen>false</MtouchUseSGen>
<MtouchUseThumb>false</MtouchUseThumb>
<MtouchArch>ARMv6</MtouchArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchLink>None</MtouchLink>
<MtouchDebug>False</MtouchDebug>
<MtouchUseSGen>false</MtouchUseSGen>
<ConsolePause>false</ConsolePause>
<MtouchUseLlvm>false</MtouchUseLlvm>
<MtouchUseThumb>false</MtouchUseThumb>
<MtouchArch>ARMv6</MtouchArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchUseSGen>false</MtouchUseSGen>
<MtouchDebug>True</MtouchDebug>
<CodesignKey>iPhone Developer</CodesignKey>
<ConsolePause>false</ConsolePause>
<MtouchUseThumb>false</MtouchUseThumb>
<MtouchArch>ARMv6</MtouchArch>
<MtouchUseLlvm>false</MtouchUseLlvm>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchUseSGen>false</MtouchUseSGen>
<MtouchDebug>False</MtouchDebug>
<MtouchUseThumb>false</MtouchUseThumb>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchArch>ARMv6</MtouchArch>
<MtouchUseLlvm>false</MtouchUseLlvm>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="OpenTK" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
<None Include="Icon.png" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainWindow.xib.designer.cs">
<DependentUpon>MainWindow.xib</DependentUpon>
</Compile>
<Compile Include="Main.cs" />
<Compile Include="ShakeMe.cs" />
<Compile Include="PaintingView.cs" />
<Compile Include="SoundEffect.cs" />
</ItemGroup>
<ItemGroup>
<Page Include="MainWindow.xib" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Content Include="Default.png" />
<Content Include="Erase.caf" />
<Content Include="Particle.png" />
<Content Include="Select.caf" />
<Content Include="Images\Blue.png" />
<Content Include="Images\Green.png" />
<Content Include="Images\Purple.png" />
<Content Include="Images\Red.png" />
<Content Include="Images\Yellow.png" />
</ItemGroup>
</Project>

Двоичные данные
GLPaint-GameView/GLPaint-GameView/Icon.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.8 KiB

Двоичные данные
GLPaint-GameView/GLPaint-GameView/Images/Blue.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.2 KiB

Двоичные данные
GLPaint-GameView/GLPaint-GameView/Images/Green.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Двоичные данные
GLPaint-GameView/GLPaint-GameView/Images/Purple.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Двоичные данные
GLPaint-GameView/GLPaint-GameView/Images/Red.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Двоичные данные
GLPaint-GameView/GLPaint-GameView/Images/Yellow.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Просмотреть файл

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,193 @@
#define LINQ
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.Drawing;
using OpenTK.Graphics.ES11;
namespace GLPaintGameView
{
public class Application
{
static void Main (string[] args)
{
UIApplication.Main (args);
}
}
// The name AppDelegate is referenced in the MainWindow.xib file.
public partial class AppDelegate : UIApplicationDelegate
{
const int PaletteHeight = 30;
const int PaletteSize = 5;
const int AccelerometerFrequency = 25;
const float FilteringFactor = 0.1f;
const float EraseAccelerationThreshold = 2.0f;
static readonly TimeSpan MinEraseInterval = TimeSpan.FromSeconds (0.5);
const float LeftMarginPadding = 10.0f;
const float TopMarginPadding = 10.0f;
const float RightMarginPadding = 10.0f;
double[] myAccelerometer = new double [3];
SoundEffect erasingSound = new SoundEffect (NSBundle.MainBundle.PathForResource ("Erase", "caf"));
SoundEffect selectSound = new SoundEffect (NSBundle.MainBundle.PathForResource ("Select", "caf"));
DateTime lastTime;
PaintingView drawingView;
// This method is invoked when the application has loaded its UI and its ready to run
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
RectangleF rect = UIScreen.MainScreen.ApplicationFrame;
window.BackgroundColor = UIColor.Black;
//Create the OpenGL drawing view and add it to the window
drawingView = new PaintingView (new RectangleF (rect.Location, rect.Size));
window.AddSubview (drawingView);
// Create a segmented control so that the user can choose the brush color.
UISegmentedControl segmentedControl = new UISegmentedControl (new[]{
UIImage.FromFile ("Images/Red.png"),
UIImage.FromFile ("Images/Yellow.png"),
UIImage.FromFile ("Images/Green.png"),
UIImage.FromFile ("Images/Blue.png"),
UIImage.FromFile ("Images/Purple.png"),
});
// Compute a rectangle that is positioned correctly for the segmented control you'll use as a brush color palette
RectangleF frame = new RectangleF (rect.X + LeftMarginPadding, rect.Height - PaletteHeight - TopMarginPadding,
rect.Width - (LeftMarginPadding + RightMarginPadding), PaletteHeight);
segmentedControl.Frame = frame;
// When the user chooses a color, the method changeBrushColor: is called.
segmentedControl.ValueChanged += ChangeBrushColor;
segmentedControl.ControlStyle = UISegmentedControlStyle.Bar;
// Make sure the color of the color complements the black background
segmentedControl.TintColor = UIColor.DarkGray;
// Set the third color (index values start at 0)
segmentedControl.SelectedSegment = 2;
// Add the control to the window
window.AddSubview (segmentedControl);
// Now that the control is added, you can release it
// [segmentedControl release];
float r, g, b;
// Define a starting color
HslToRgb (2.0f / PaletteSize, PaintingView.Saturation, PaintingView.Luminosity, out r, out g, out b);
// Set the color using OpenGL
GL.Color4 (r, g, b, PaintingView.BrushOpacity);
// Look in the Info.plist file and you'll see the status bar is hidden
// Set the style to black so it matches the background of the application
app.SetStatusBarStyle (UIStatusBarStyle.BlackTranslucent, false);
// Now show the status bar, but animate to the style.
app.SetStatusBarHidden (false, true);
//Configure and enable the accelerometer
UIAccelerometer.SharedAccelerometer.UpdateInterval = 1.0f / AccelerometerFrequency;
UIAccelerometer.SharedAccelerometer.Acceleration += OnAccelerated;
//Show the window
window.MakeKeyAndVisible ();
return true;
}
// This method is required in iPhoneOS 3.0
public override void OnActivated (UIApplication application)
{
}
static void HslToRgb (float h, float s, float l, out float r, out float g, out float b)
{
// Check for saturation. If there isn't any just return the luminance value for each, which results in gray.
if (s == 0.0) {
r = l;
g = l;
b = l;
return;
}
// Test for luminance and compute temporary values based on luminance and saturation
float temp2;
if (l < 0.5)
temp2 = l * (1.0f + s);
else
temp2 = l + s - l * s;
float temp1 = 2.0f * l - temp2;
// Compute intermediate values based on hue
float[] temp = {
h + 1.0f / 3.0f,
h,
h - 1.0f / 3.0f,
};
for (int i = 0; i < temp.Length; ++i) {
if (temp [i] < 0.0f)
temp [i] += 1.0f;
if (temp [i] > 1.0f)
temp [i] -= 1.0f;
if (6.0f * temp [i] < 1.0f)
temp [i] = temp1 + (temp2 - temp1) * 6.0f * temp [i];
else {
if (2.0f * temp [i] < 1.0f)
temp [i] = temp2;
else {
if (3.0f * temp [i] < 2.0f)
temp [i] = temp1 + (temp2 - temp1) * ((2.0f / 3.0f) - temp [i]) * 6.0f;
else
temp [i] = temp1;
}
}
}
r = temp [0];
g = temp [1];
b = temp [2];
}
private void ChangeBrushColor (object sender, EventArgs e)
{
selectSound.Play ();
float r, g, b;
HslToRgb (((UISegmentedControl) sender).SelectedSegment / (float) PaletteSize,
PaintingView.Saturation, PaintingView.Luminosity,
out r, out g, out b);
GL.Color4 (r, g, b, PaintingView.BrushOpacity);
}
private void OnAccelerated (object sender, UIAccelerometerEventArgs e)
{
#if LINQ
myAccelerometer = new[]{e.Acceleration.X, e.Acceleration.Y, e.Acceleration.Z}
.Select((v, i) => v * FilteringFactor + myAccelerometer [i] * (1.0f - FilteringFactor))
.ToArray ();
#else
myAccelerometer [0] = e.Acceleration.X * FilteringFactor + myAccelerometer [0] * (1.0 - FilteringFactor);
myAccelerometer [1] = e.Acceleration.Y * FilteringFactor + myAccelerometer [1] * (1.0 - FilteringFactor);
myAccelerometer [2] = e.Acceleration.Z * FilteringFactor + myAccelerometer [2] * (1.0 - FilteringFactor);
#endif
// Odd; ObjC always uses myAccelerometer[0], while
// I'd expect myAccelerometer[0 .. 2]
var x = e.Acceleration.X - myAccelerometer [0];
var y = e.Acceleration.Y - myAccelerometer [0];
var z = e.Acceleration.Z - myAccelerometer [0];
var length = Math.Sqrt (x * x + y * y + z * z);
if (length >= EraseAccelerationThreshold && DateTime.Now > lastTime + MinEraseInterval) {
erasingSound.Play ();
drawingView.Erase ();
lastTime = DateTime.Now;
}
}
}
}

Просмотреть файл

@ -0,0 +1,184 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.03">
<data>
<int key="IBDocument.SystemTarget">768</int>
<string key="IBDocument.SystemVersion">9J61</string>
<string key="IBDocument.InterfaceBuilderVersion">677</string>
<string key="IBDocument.AppKitVersion">949.46</string>
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="2"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="841351856">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
</object>
<object class="IBProxyObject" id="587066532">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
</object>
<object class="IBUICustomObject" id="987256611"/>
<object class="IBUIWindow" id="380026005">
<reference key="NSNextResponder"/>
<int key="NSvFlags">1316</int>
<object class="NSPSMatrix" key="NSFrameMatrix"/>
<string key="NSFrameSize">{320, 480}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="987256611"/>
</object>
<int key="connectionID">5</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="987256611"/>
<reference key="destination" ref="380026005"/>
</object>
<int key="connectionID">7</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<object class="NSArray" key="object" id="600044258">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2</int>
<reference key="object" ref="380026005"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="parent" ref="600044258"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="841351856"/>
<reference key="parent" ref="600044258"/>
<string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="987256611"/>
<reference key="parent" ref="600044258"/>
<string key="objectName">App Delegate</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="587066532"/>
<reference key="parent" ref="600044258"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>2.IBAttributePlaceholdersKey</string>
<string>2.IBEditorWindowLastContentRect</string>
<string>2.IBPluginDependency</string>
<string>2.UIWindow.visibleAtLaunch</string>
<string>4.CustomClassName</string>
<string>4.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIApplication</string>
<string>UIResponder</string>
<object class="NSMutableDictionary">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<string>{{593, 276}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<integer value="1"/>
<string>AppDelegate</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">7</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">AppDelegate</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">window</string>
<string key="NS.object.0">id</string>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<nil key="IBDocument.LastKnownRelativeProjectPath"/>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">3.0</string>
</data>
</archive>

33
GLPaint-GameView/GLPaint-GameView/MainWindow.xib.designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,33 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 4.0.30319.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
namespace GLPaintGameView {
// Base type probably should be MonoTouch.Foundation.NSObject or subclass
[MonoTouch.Foundation.Register("AppDelegate")]
public partial class AppDelegate {
private MonoTouch.UIKit.UIWindow __mt_window;
#pragma warning disable 0169
[MonoTouch.Foundation.Connect("window")]
private MonoTouch.UIKit.UIWindow window {
get {
this.__mt_window = ((MonoTouch.UIKit.UIWindow)(this.GetNativeField("window")));
return this.__mt_window;
}
set {
this.__mt_window = value;
this.SetNativeField("window", value);
}
}
}
}

Просмотреть файл

@ -0,0 +1,184 @@
using System;
using OpenTK.Platform.iPhoneOS;
using OpenTK.Graphics.ES11;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using System.Drawing;
using MonoTouch.ObjCRuntime;
using MonoTouch.OpenGLES;
using System.Runtime.InteropServices;
using MonoTouch.CoreGraphics;
namespace GLPaintGameView
{
public class PaintingView : iPhoneOSGameView {
public const float BrushOpacity = 1.0f / 3.0f;
public const int BrushPixelStep = 3;
public const int BrushScale = 2;
public const float Luminosity = 0.75f;
public const float Saturation = 1.0f;
uint brushTexture, drawingTexture, drawingFramebuffer;
bool firstTouch;
PointF Location;
PointF PreviousLocation;
[Export ("layerClass")]
public static Class LayerClass ()
{
return iPhoneOSGameView.GetLayerClass ();
}
public PaintingView (RectangleF frame)
: base (frame)
{
LayerRetainsBacking = true;
LayerColorFormat = EAGLColorFormat.RGBA8;
ContextRenderingApi = EAGLRenderingAPI.OpenGLES1;
CreateFrameBuffer();
MakeCurrent();
var brushImage = UIImage.FromFile ("Particle.png").CGImage;
var width = brushImage.Width;
var height = brushImage.Height;
if (brushImage != null) {
IntPtr brushData = Marshal.AllocHGlobal (width * height * 4);
if (brushData == IntPtr.Zero)
throw new OutOfMemoryException ();
try {
using (var brushContext = new CGBitmapContext (brushData,
width, width, 8, width * 4, brushImage.ColorSpace, CGImageAlphaInfo.PremultipliedLast)) {
brushContext.DrawImage (new RectangleF (0.0f, 0.0f, (float) width, (float) height), brushImage);
}
GL.GenTextures (1, ref brushTexture);
GL.BindTexture (All.Texture2D, brushTexture);
GL.TexImage2D (All.Texture2D, 0, (int) All.Rgba, width, height, 0, All.Rgba, All.UnsignedByte, brushData);
}
finally {
Marshal.FreeHGlobal (brushData);
}
GL.TexParameter (All.Texture2D, All.TextureMinFilter, (int) All.Linear);
GL.Enable (All.Texture2D);
GL.BlendFunc (All.SrcAlpha, All.One);
GL.Enable (All.Blend);
}
GL.Disable (All.Dither);
GL.MatrixMode (All.Projection);
GL.Ortho (0, frame.Width, 0, frame.Height, -1, 1);
GL.MatrixMode (All.Modelview);
GL.Enable (All.Texture2D);
GL.EnableClientState (All.VertexArray);
GL.Enable (All.Blend);
GL.BlendFunc (All.SrcAlpha, All.One);
GL.Enable (All.PointSpriteOes);
GL.TexEnv (All.PointSpriteOes, All.CoordReplaceOes, (float) All.True);
GL.PointSize (width / BrushScale);
Erase ();
PerformSelector (new Selector ("playback"), null, 0.2f);
}
protected override void Dispose (bool disposing)
{
base.Dispose (disposing);
GL.DeleteTextures (1, ref drawingTexture);
}
public void Erase ()
{
GL.Clear ((uint) All.ColorBufferBit);
SwapBuffers ();
}
float[] vertexBuffer;
int vertexMax = 64;
private void RenderLineFromPoint (PointF start, PointF end)
{
int vertexCount = 0;
if (vertexBuffer == null) {
vertexBuffer = new float [vertexMax * 2];
}
var count = Math.Max (Math.Ceiling (Math.Sqrt ((end.X - start.X) * (end.X - start.X) + (end.Y - start.Y) * (end.Y - start.Y)) / BrushPixelStep),
1);
for (int i = 0; i < count; ++i, ++vertexCount) {
if (vertexCount == vertexMax) {
vertexMax *= 2;
Array.Resize (ref vertexBuffer, vertexMax * 2);
}
vertexBuffer [2 * vertexCount + 0] = start.X + (end.X - start.X) * (float) i / (float) count;
vertexBuffer [2 * vertexCount + 1] = start.Y + (end.Y - start.Y) * (float) i / (float) count;
}
GL.VertexPointer (2, All.Float, 0, vertexBuffer);
GL.DrawArrays (All.Points, 0, vertexCount);
SwapBuffers ();
}
int dataofs = 0;
[Export ("playback")]
void Playback ()
{
PointF [] points = ShakeMe.Data [dataofs];
for (int i = 0; i < points.Length - 1; i++)
RenderLineFromPoint (points [i], points [i + 1]);
if (dataofs < ShakeMe.Data.Count - 1) {
dataofs ++;
PerformSelector (new Selector ("playback"), null, 0.01f);
}
}
public override void TouchesBegan (MonoTouch.Foundation.NSSet touches, MonoTouch.UIKit.UIEvent e)
{
var bounds = Bounds;
var touch = (UITouch) e.TouchesForView (this).AnyObject;
firstTouch = true;
Location = touch.LocationInView (this);
Location.Y = bounds.Height - Location.Y;
}
public override void TouchesMoved (MonoTouch.Foundation.NSSet touches, MonoTouch.UIKit.UIEvent e)
{
var bounds = Bounds;
var touch = (UITouch) e.TouchesForView (this).AnyObject;
if (firstTouch) {
firstTouch = false;
PreviousLocation = touch.PreviousLocationInView (this);
PreviousLocation.Y = bounds.Height - PreviousLocation.Y;
}
else {
Location = touch.LocationInView (this);
Location.Y = bounds.Height - Location.Y;
PreviousLocation = touch.PreviousLocationInView (this);
PreviousLocation.Y = bounds.Height - PreviousLocation.Y;
}
RenderLineFromPoint (PreviousLocation, Location);
}
public override void TouchesEnded (MonoTouch.Foundation.NSSet touches, MonoTouch.UIKit.UIEvent e)
{
var bounds = Bounds;
var touch = (UITouch) e.TouchesForView (this).AnyObject;
if (firstTouch) {
firstTouch = false;
PreviousLocation = touch.PreviousLocationInView (this);
PreviousLocation.Y = bounds.Height - PreviousLocation.Y;
RenderLineFromPoint (PreviousLocation, Location);
}
}
public override void TouchesCancelled (MonoTouch.Foundation.NSSet touches, MonoTouch.UIKit.UIEvent e)
{
}
}
}

Двоичные данные
GLPaint-GameView/GLPaint-GameView/Particle.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Просмотреть файл

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<data>
AAB4QgAAt0MAAFBCAIC1QwAAMEIAgLRDAAAUQgAAskMAAOhBAACvQwAAwEEAgKxDAAC4
QQCAqkMAALhBAICnQwAAPEIAAKRDAABsQgCAokMAAIxCAIChQwAAlEIAgJ9DAACWQgCA
nkMAAI5CAICbQwAAbEIAAJhDAAAkQgAAlEMAAKBBAACOQwAAgEEAgIxDAABwQQAAjEMA
AGBBAICLQwAAYEEAgItD
</data>
<data>
AAC8QgAAsEMAAMJCAICoQwAAwkIAAKRDAADCQgCAnUMAAMJCAACYQwAAwEIAgJRDAADA
QgCAkkMAAMBCAACRQwAAwEIAgJBDAADAQgCAkEM=
</data>
<data>
AACoQgAAnEMAALpCAACdQwAAxEIAAJ1DAADQQgAAnUMAANpCAICdQwAA4kIAgJ5DAADs
QgCAn0MAAOxCAICfQw==
</data>
<data>
AAACQwAAsEMAAANDAACpQwAAA0MAAKVDAAADQwAAn0MAAANDAICZQwAAA0MAAJVDAAAD
QwAAkkMAAANDAACSQw==
</data>
<data>
AAAVQwCAiUMAABdDAICMQwAAF0MAAJBDAAAYQwCAlUMAABtDAACcQwAAI0MAAKRDAAAr
QwAArEMAADFDAICxQwAANkMAgLRDAAA6QwAAtkMAAD1DAIC2QwAAP0MAgLVDAABAQwAA
skMAAEFDAACuQwAAQkMAgKhDAABCQwAApEMAAEJDAACeQwAAQkMAgJhDAABCQwCAlkMA
AD5DAICTQwAAPkMAgJND
</data>
<data>
AAAhQwCAoEMAADRDAIChQwAAO0MAAKJDAABAQwCAokMAAEZDAICiQwAARkMAgKJD
</data>
<data>
AABbQwAAs0MAAFtDAICsQwAAW0MAAKhDAABbQwAAokMAAFpDAICaQwAAWEMAgJVDAABX
QwAAkkMAAFdDAACQQwAAV0MAAI9DAABXQwAAjkMAAFdDAACQQwAAWUMAAJRDAABfQwAA
mUMAAGVDAACfQwAAa0MAAKNDAABxQwCApkMAAHZDAACpQwAAeUMAAKtDAAB9QwCArEMA
AH9DAICtQwCAgEMAgK5DAACBQwAAr0MAgIFDAACvQwCAgUMAAK9D
</data>
<data>
AABlQwAAn0MAAG5DAICbQwAAckMAgJtDAAB3QwAAm0MAAHtDAACaQwAAf0MAAJlDAICA
QwCAmEMAgIFDAACYQwCAgkMAAJdDAACEQwCAlUMAAIRDAICVQw==
</data>
<data>
AACOQwAAsUMAAI1DAACtQwAAjUMAgKlDAACMQwAApkMAgIpDAAChQwAAiUMAAJxDAICI
QwAAmUMAgIhDAICWQwCAiEMAgJRDAICIQwAAk0MAAIlDAACSQwAAi0MAgJFDAICNQwCA
kUMAgJJDAICRQwCAlEMAgJJDAICWQwCAk0MAAJlDAICUQwAAmkMAAJVDAICaQwAAlUMA
gJpDAACVQw==
</data>
<data>
AICJQwCAoUMAgI1DAACiQwCAj0MAAKJDAACSQwAAokMAgJNDAICiQwAAlUMAgKJDAACV
QwCAokM=
</data>
<data>
AICNQwCAr0MAgJNDAACyQwAAl0MAgLJDAACaQwAAtEMAAJxDAIC0QwAAnEMAgLRD
</data>
<data>
AABcQgAAJUMAAFRCAAAeQwAAVEIAABNDAABUQgAACEMAAFRCAAD+QgAAVEIAAPBCAABU
QgAA5EIAAFRCAADcQgAAVEIAANpCAABUQgAA2EIAAFRCAADaQgAAVEIAAOZCAABYQgAA
A0MAAGRCAAAfQwAAaEIAADFDAABsQgAAPUMAAGxCAABEQwAAdEIAAElDAACAQgAASEMA
AI5CAABCQwAAoEIAAD1DAAC0QgAAOUMAAMZCAAA4QwAA3EIAADhDAADsQgAAPUMAAPRC
AABBQwAA/kIAAEZDAAAAQwAARkMAAABDAAA/QwAAAEMAADNDAAAAQwAAIUMAAP5CAAAP
QwAA/kIAAP5CAAD+QgAA5EIAAP5CAADUQgAA/kIAAMhCAAAAQwAAxkIAAABDAADGQg==
</data>
<data>
AAAvQwAATEMAACxDAABDQwAALEMAADpDAAArQwAALUMAACpDAAAgQwAAKUMAABFDAAAo
QwAABkMAACZDAAD8QgAAJUMAAOpCAAAlQwAA3kIAACVDAADWQgAAKkMAANJCAAAzQwAA
0kIAADxDAADcQgAARkMAAOZCAABQQwAA7kIAAFhDAAD0QgAAXUMAAPZCAABjQwAA+kIA
AGNDAAD6Qg==
</data>
<data>
AAA0QwAAFUMAAEFDAAAYQwAATUMAABpDAABaQwAAHkMAAGZDAAAkQwAAcEMAACpDAAB0
QwAAL0MAAHRDAAAvQw==
</data>
<data>
AAAxQwAAPUMAAD9DAABAQwAATUMAAEFDAABbQwAARUMAAGhDAABKQwAAcUMAAE1DAAB5
QwAAUEMAAHlDAABQQw==
</data>
<data>
AICEQwAAb0MAAIZDAABjQwCAhkMAAFdDAACHQwAARkMAgIdDAAAyQwCAiEMAACBDAACJ
QwAAFkMAgIlDAAAOQwCAikMAAAVDAICKQwAABUM=
</data>
<data>
AICNQwAAukIAgI1DAAC6Qg==
</data>
<data>
AACTQwAArkIAgI5DAACiQgAAjkMAAKJCAACOQwAAoEIAAI5DAACeQgCAjkMAAKBCAICO
QwAApEIAgI5DAACmQgCAjkMAAKhCAACOQwAAqEIAAI1DAACoQgAAjUMAAKZCAACNQwAA
pEIAAI1DAACkQg==
</data>
</array>
</plist>

Двоичные данные
GLPaint-GameView/GLPaint-GameView/Select.caf Executable file

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,287 @@
using System.Drawing;
using System.Collections.Generic;
namespace GLPaintGameView {
public class ShakeMe {
public static List <PointF []> Data = new List <PointF []> () {
new PointF [] {
new PointF (62.000000f, 366.000000f),
new PointF (52.000000f, 363.000000f),
new PointF (44.000000f, 361.000000f),
new PointF (37.000000f, 356.000000f),
new PointF (29.000000f, 350.000000f),
new PointF (24.000000f, 345.000000f),
new PointF (23.000000f, 341.000000f),
new PointF (23.000000f, 335.000000f),
new PointF (47.000000f, 328.000000f),
new PointF (59.000000f, 325.000000f),
new PointF (70.000000f, 323.000000f),
new PointF (74.000000f, 319.000000f),
new PointF (75.000000f, 317.000000f),
new PointF (71.000000f, 311.000000f),
new PointF (59.000000f, 304.000000f),
new PointF (41.000000f, 296.000000f),
new PointF (20.000000f, 284.000000f),
new PointF (16.000000f, 281.000000f),
new PointF (15.000000f, 280.000000f),
new PointF (14.000000f, 279.000000f),
new PointF (14.000000f, 279.000000f),
},
new PointF [] {
new PointF (94.000000f, 352.000000f),
new PointF (97.000000f, 337.000000f),
new PointF (97.000000f, 328.000000f),
new PointF (97.000000f, 315.000000f),
new PointF (97.000000f, 304.000000f),
new PointF (96.000000f, 297.000000f),
new PointF (96.000000f, 293.000000f),
new PointF (96.000000f, 290.000000f),
new PointF (96.000000f, 289.000000f),
new PointF (96.000000f, 289.000000f),
},
new PointF [] {
new PointF (84.000000f, 312.000000f),
new PointF (93.000000f, 314.000000f),
new PointF (98.000000f, 314.000000f),
new PointF (104.000000f, 314.000000f),
new PointF (109.000000f, 315.000000f),
new PointF (113.000000f, 317.000000f),
new PointF (118.000000f, 319.000000f),
new PointF (118.000000f, 319.000000f),
},
new PointF [] {
new PointF (130.000000f, 352.000000f),
new PointF (131.000000f, 338.000000f),
new PointF (131.000000f, 330.000000f),
new PointF (131.000000f, 318.000000f),
new PointF (131.000000f, 307.000000f),
new PointF (131.000000f, 298.000000f),
new PointF (131.000000f, 292.000000f),
new PointF (131.000000f, 292.000000f),
},
new PointF [] {
new PointF (149.000000f, 275.000000f),
new PointF (151.000000f, 281.000000f),
new PointF (151.000000f, 288.000000f),
new PointF (152.000000f, 299.000000f),
new PointF (155.000000f, 312.000000f),
new PointF (163.000000f, 328.000000f),
new PointF (171.000000f, 344.000000f),
new PointF (177.000000f, 355.000000f),
new PointF (182.000000f, 361.000000f),
new PointF (186.000000f, 364.000000f),
new PointF (189.000000f, 365.000000f),
new PointF (191.000000f, 363.000000f),
new PointF (192.000000f, 356.000000f),
new PointF (193.000000f, 348.000000f),
new PointF (194.000000f, 337.000000f),
new PointF (194.000000f, 328.000000f),
new PointF (194.000000f, 316.000000f),
new PointF (194.000000f, 305.000000f),
new PointF (194.000000f, 301.000000f),
new PointF (190.000000f, 295.000000f),
new PointF (190.000000f, 295.000000f),
},
new PointF [] {
new PointF (161.000000f, 321.000000f),
new PointF (180.000000f, 323.000000f),
new PointF (187.000000f, 324.000000f),
new PointF (192.000000f, 325.000000f),
new PointF (198.000000f, 325.000000f),
new PointF (198.000000f, 325.000000f),
},
new PointF [] {
new PointF (219.000000f, 358.000000f),
new PointF (219.000000f, 345.000000f),
new PointF (219.000000f, 336.000000f),
new PointF (219.000000f, 324.000000f),
new PointF (218.000000f, 309.000000f),
new PointF (216.000000f, 299.000000f),
new PointF (215.000000f, 292.000000f),
new PointF (215.000000f, 288.000000f),
new PointF (215.000000f, 286.000000f),
new PointF (215.000000f, 284.000000f),
new PointF (215.000000f, 288.000000f),
new PointF (217.000000f, 296.000000f),
new PointF (223.000000f, 306.000000f),
new PointF (229.000000f, 318.000000f),
new PointF (235.000000f, 326.000000f),
new PointF (241.000000f, 333.000000f),
new PointF (246.000000f, 338.000000f),
new PointF (249.000000f, 342.000000f),
new PointF (253.000000f, 345.000000f),
new PointF (255.000000f, 347.000000f),
new PointF (257.000000f, 349.000000f),
new PointF (258.000000f, 350.000000f),
new PointF (259.000000f, 350.000000f),
new PointF (259.000000f, 350.000000f),
},
new PointF [] {
new PointF (229.000000f, 318.000000f),
new PointF (238.000000f, 311.000000f),
new PointF (242.000000f, 311.000000f),
new PointF (247.000000f, 310.000000f),
new PointF (251.000000f, 308.000000f),
new PointF (255.000000f, 306.000000f),
new PointF (257.000000f, 305.000000f),
new PointF (259.000000f, 304.000000f),
new PointF (261.000000f, 302.000000f),
new PointF (264.000000f, 299.000000f),
new PointF (264.000000f, 299.000000f),
},
new PointF [] {
new PointF (284.000000f, 354.000000f),
new PointF (282.000000f, 346.000000f),
new PointF (282.000000f, 339.000000f),
new PointF (280.000000f, 332.000000f),
new PointF (277.000000f, 322.000000f),
new PointF (274.000000f, 312.000000f),
new PointF (273.000000f, 306.000000f),
new PointF (273.000000f, 301.000000f),
new PointF (273.000000f, 297.000000f),
new PointF (273.000000f, 294.000000f),
new PointF (274.000000f, 292.000000f),
new PointF (278.000000f, 291.000000f),
new PointF (283.000000f, 291.000000f),
new PointF (293.000000f, 291.000000f),
new PointF (297.000000f, 293.000000f),
new PointF (301.000000f, 295.000000f),
new PointF (306.000000f, 297.000000f),
new PointF (308.000000f, 298.000000f),
new PointF (309.000000f, 298.000000f),
new PointF (309.000000f, 298.000000f),
},
new PointF [] {
new PointF (275.000000f, 323.000000f),
new PointF (283.000000f, 324.000000f),
new PointF (287.000000f, 324.000000f),
new PointF (292.000000f, 324.000000f),
new PointF (295.000000f, 325.000000f),
new PointF (298.000000f, 325.000000f),
new PointF (298.000000f, 325.000000f),
},
new PointF [] {
new PointF (283.000000f, 351.000000f),
new PointF (295.000000f, 356.000000f),
new PointF (302.000000f, 357.000000f),
new PointF (308.000000f, 360.000000f),
new PointF (312.000000f, 361.000000f),
new PointF (312.000000f, 361.000000f),
},
new PointF [] {
new PointF (55.000000f, 165.000000f),
new PointF (53.000000f, 158.000000f),
new PointF (53.000000f, 147.000000f),
new PointF (53.000000f, 136.000000f),
new PointF (53.000000f, 127.000000f),
new PointF (53.000000f, 120.000000f),
new PointF (53.000000f, 114.000000f),
new PointF (53.000000f, 110.000000f),
new PointF (53.000000f, 109.000000f),
new PointF (53.000000f, 108.000000f),
new PointF (53.000000f, 109.000000f),
new PointF (53.000000f, 115.000000f),
new PointF (54.000000f, 131.000000f),
new PointF (57.000000f, 159.000000f),
new PointF (58.000000f, 177.000000f),
new PointF (59.000000f, 189.000000f),
new PointF (59.000000f, 196.000000f),
new PointF (61.000000f, 201.000000f),
new PointF (64.000000f, 200.000000f),
new PointF (71.000000f, 194.000000f),
new PointF (80.000000f, 189.000000f),
new PointF (90.000000f, 185.000000f),
new PointF (99.000000f, 184.000000f),
new PointF (110.000000f, 184.000000f),
new PointF (118.000000f, 189.000000f),
new PointF (122.000000f, 193.000000f),
new PointF (127.000000f, 198.000000f),
new PointF (128.000000f, 198.000000f),
new PointF (128.000000f, 191.000000f),
new PointF (128.000000f, 179.000000f),
new PointF (128.000000f, 161.000000f),
new PointF (127.000000f, 143.000000f),
new PointF (127.000000f, 127.000000f),
new PointF (127.000000f, 114.000000f),
new PointF (127.000000f, 106.000000f),
new PointF (127.000000f, 100.000000f),
new PointF (128.000000f, 99.000000f),
new PointF (128.000000f, 99.000000f),
},
new PointF [] {
new PointF (175.000000f, 204.000000f),
new PointF (172.000000f, 195.000000f),
new PointF (172.000000f, 186.000000f),
new PointF (171.000000f, 173.000000f),
new PointF (170.000000f, 160.000000f),
new PointF (169.000000f, 145.000000f),
new PointF (168.000000f, 134.000000f),
new PointF (166.000000f, 126.000000f),
new PointF (165.000000f, 117.000000f),
new PointF (165.000000f, 111.000000f),
new PointF (165.000000f, 107.000000f),
new PointF (170.000000f, 105.000000f),
new PointF (179.000000f, 105.000000f),
new PointF (188.000000f, 110.000000f),
new PointF (198.000000f, 115.000000f),
new PointF (208.000000f, 119.000000f),
new PointF (216.000000f, 122.000000f),
new PointF (221.000000f, 123.000000f),
new PointF (227.000000f, 125.000000f),
new PointF (227.000000f, 125.000000f),
},
new PointF [] {
new PointF (180.000000f, 149.000000f),
new PointF (193.000000f, 152.000000f),
new PointF (205.000000f, 154.000000f),
new PointF (218.000000f, 158.000000f),
new PointF (230.000000f, 164.000000f),
new PointF (240.000000f, 170.000000f),
new PointF (244.000000f, 175.000000f),
new PointF (244.000000f, 175.000000f),
},
new PointF [] {
new PointF (177.000000f, 189.000000f),
new PointF (191.000000f, 192.000000f),
new PointF (205.000000f, 193.000000f),
new PointF (219.000000f, 197.000000f),
new PointF (232.000000f, 202.000000f),
new PointF (241.000000f, 205.000000f),
new PointF (249.000000f, 208.000000f),
new PointF (249.000000f, 208.000000f),
},
new PointF [] {
new PointF (265.000000f, 239.000000f),
new PointF (268.000000f, 227.000000f),
new PointF (269.000000f, 215.000000f),
new PointF (270.000000f, 198.000000f),
new PointF (271.000000f, 178.000000f),
new PointF (273.000000f, 160.000000f),
new PointF (274.000000f, 150.000000f),
new PointF (275.000000f, 142.000000f),
new PointF (277.000000f, 133.000000f),
new PointF (277.000000f, 133.000000f),
},
new PointF [] {
new PointF (283.000000f, 93.000000f),
new PointF (283.000000f, 93.000000f),
},
new PointF [] {
new PointF (294.000000f, 87.000000f),
new PointF (285.000000f, 81.000000f),
new PointF (284.000000f, 81.000000f),
new PointF (284.000000f, 80.000000f),
new PointF (284.000000f, 79.000000f),
new PointF (285.000000f, 80.000000f),
new PointF (285.000000f, 82.000000f),
new PointF (285.000000f, 83.000000f),
new PointF (285.000000f, 84.000000f),
new PointF (284.000000f, 84.000000f),
new PointF (282.000000f, 84.000000f),
new PointF (282.000000f, 83.000000f),
new PointF (282.000000f, 82.000000f),
new PointF (282.000000f, 82.000000f),
}
};
}
}

Просмотреть файл

@ -0,0 +1,28 @@
using System;
using MonoTouch.Foundation;
using MonoTouch.AudioToolbox;
namespace GLPaintGameView
{
public class SoundEffect : NSObject
{
SystemSound sound;
public SoundEffect (string path)
{
sound = SystemSound.FromFile (new NSUrl (path, false));
}
protected override void Dispose (bool disposing)
{
((IDisposable) sound).Dispose ();
sound = null;
}
public void Play ()
{
sound.PlaySystemSound ();
}
}
}