Skip to content

Commit 610642a

Browse files
committed
R12 commit
1 parent 41a3caa commit 610642a

34 files changed

+1201
-0
lines changed

Primitives2D.cs

+539
Large diffs are not rendered by default.

Primitives2D.csproj

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>9.0.21022</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{39AD1482-1881-4852-A05D-DC61B0D3446A}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>C3.XNA</RootNamespace>
12+
<AssemblyName>C3.XNA.Primitives2D</AssemblyName>
13+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<FileUpgradeFlags>
16+
</FileUpgradeFlags>
17+
<OldToolsVersion>3.5</OldToolsVersion>
18+
<UpgradeBackupLocation />
19+
<PublishUrl>publish\</PublishUrl>
20+
<Install>true</Install>
21+
<InstallFrom>Disk</InstallFrom>
22+
<UpdateEnabled>false</UpdateEnabled>
23+
<UpdateMode>Foreground</UpdateMode>
24+
<UpdateInterval>7</UpdateInterval>
25+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
26+
<UpdatePeriodically>false</UpdatePeriodically>
27+
<UpdateRequired>false</UpdateRequired>
28+
<MapFileExtensions>true</MapFileExtensions>
29+
<ApplicationRevision>0</ApplicationRevision>
30+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
31+
<IsWebBootstrapper>false</IsWebBootstrapper>
32+
<UseApplicationTrust>false</UseApplicationTrust>
33+
<BootstrapperEnabled>true</BootstrapperEnabled>
34+
</PropertyGroup>
35+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
36+
<DebugSymbols>true</DebugSymbols>
37+
<DebugType>full</DebugType>
38+
<Optimize>false</Optimize>
39+
<OutputPath>bin\Debug\</OutputPath>
40+
<DefineConstants>DEBUG;TRACE</DefineConstants>
41+
<ErrorReport>prompt</ErrorReport>
42+
<WarningLevel>4</WarningLevel>
43+
</PropertyGroup>
44+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
45+
<DebugType>pdbonly</DebugType>
46+
<Optimize>true</Optimize>
47+
<OutputPath>bin\Release\</OutputPath>
48+
<DefineConstants>TRACE</DefineConstants>
49+
<ErrorReport>prompt</ErrorReport>
50+
<WarningLevel>4</WarningLevel>
51+
</PropertyGroup>
52+
<ItemGroup>
53+
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
54+
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
55+
<Reference Include="System" />
56+
<Reference Include="System.Core">
57+
<RequiredTargetFramework>3.5</RequiredTargetFramework>
58+
</Reference>
59+
<Reference Include="System.Data.DataSetExtensions">
60+
<RequiredTargetFramework>3.5</RequiredTargetFramework>
61+
</Reference>
62+
<Reference Include="System.Data" />
63+
<Reference Include="System.Xml" />
64+
</ItemGroup>
65+
<ItemGroup>
66+
<Compile Include="Primitives2D.cs" />
67+
<Compile Include="Properties\AssemblyInfo.cs" />
68+
</ItemGroup>
69+
<ItemGroup>
70+
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
71+
<Visible>False</Visible>
72+
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
73+
<Install>true</Install>
74+
</BootstrapperPackage>
75+
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
76+
<Visible>False</Visible>
77+
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
78+
<Install>false</Install>
79+
</BootstrapperPackage>
80+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
81+
<Visible>False</Visible>
82+
<ProductName>.NET Framework 3.5 SP1</ProductName>
83+
<Install>false</Install>
84+
</BootstrapperPackage>
85+
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
86+
<Visible>False</Visible>
87+
<ProductName>Windows Installer 3.1</ProductName>
88+
<Install>true</Install>
89+
</BootstrapperPackage>
90+
</ItemGroup>
91+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
92+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
93+
Other similar extension points exist, see Microsoft.Common.targets.
94+
<Target Name="BeforeBuild">
95+
</Target>
96+
<Target Name="AfterBuild">
97+
</Target>
98+
-->
99+
</Project>

Primitives2D.sln

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual Studio 2010
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Primitives2D", "Primitives2D.csproj", "{39AD1482-1881-4852-A05D-DC61B0D3446A}"
5+
EndProject
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Primitives2DWP7", "Primitives2DWP7.csproj", "{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Primitives2DSample", "Primitives2DSample\Primitives2DSample\Primitives2DSample.csproj", "{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}"
9+
EndProject
10+
Project("{96E2B04D-8817-42C6-938A-82C39BA4D311}") = "Primitives2DSampleContent", "Primitives2DSample\Primitives2DSampleContent\Primitives2DSampleContent.contentproj", "{F0CD1611-687D-4D13-BF8D-B67C33B15110}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Debug|Mixed Platforms = Debug|Mixed Platforms
16+
Debug|Windows Phone = Debug|Windows Phone
17+
Debug|x86 = Debug|x86
18+
Release|Any CPU = Release|Any CPU
19+
Release|Mixed Platforms = Release|Mixed Platforms
20+
Release|Windows Phone = Release|Windows Phone
21+
Release|x86 = Release|x86
22+
EndGlobalSection
23+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
24+
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
27+
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
28+
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Debug|Windows Phone.ActiveCfg = Debug|Any CPU
29+
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Debug|x86.ActiveCfg = Debug|Any CPU
30+
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
33+
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
34+
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Release|Windows Phone.ActiveCfg = Release|Any CPU
35+
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Release|x86.ActiveCfg = Release|Any CPU
36+
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Debug|Any CPU.ActiveCfg = Debug|Windows Phone
37+
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows Phone
38+
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Debug|Mixed Platforms.Build.0 = Debug|Windows Phone
39+
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Debug|Windows Phone.ActiveCfg = Debug|Windows Phone
40+
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Debug|Windows Phone.Build.0 = Debug|Windows Phone
41+
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Debug|x86.ActiveCfg = Debug|Windows Phone
42+
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Debug|x86.Build.0 = Debug|Windows Phone
43+
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Release|Any CPU.ActiveCfg = Release|Windows Phone
44+
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Release|Mixed Platforms.ActiveCfg = Release|Windows Phone
45+
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Release|Mixed Platforms.Build.0 = Release|Windows Phone
46+
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Release|Windows Phone.ActiveCfg = Release|Windows Phone
47+
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Release|Windows Phone.Build.0 = Release|Windows Phone
48+
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Release|x86.ActiveCfg = Release|Windows Phone
49+
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Release|x86.Build.0 = Release|Windows Phone
50+
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Debug|Any CPU.ActiveCfg = Debug|x86
51+
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
52+
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Debug|Mixed Platforms.Build.0 = Debug|x86
53+
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Debug|Windows Phone.ActiveCfg = Debug|x86
54+
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Debug|x86.ActiveCfg = Debug|x86
55+
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Debug|x86.Build.0 = Debug|x86
56+
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Release|Any CPU.ActiveCfg = Release|x86
57+
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Release|Mixed Platforms.ActiveCfg = Release|x86
58+
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Release|Mixed Platforms.Build.0 = Release|x86
59+
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Release|Windows Phone.ActiveCfg = Release|x86
60+
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Release|x86.ActiveCfg = Release|x86
61+
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Release|x86.Build.0 = Release|x86
62+
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Debug|Any CPU.ActiveCfg = Debug|x86
63+
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
64+
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Debug|Windows Phone.ActiveCfg = Debug|x86
65+
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Debug|x86.ActiveCfg = Debug|x86
66+
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Release|Any CPU.ActiveCfg = Release|x86
67+
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Release|Mixed Platforms.ActiveCfg = Release|x86
68+
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Release|Windows Phone.ActiveCfg = Release|x86
69+
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Release|x86.ActiveCfg = Release|x86
70+
EndGlobalSection
71+
GlobalSection(SolutionProperties) = preSolution
72+
HideSolutionNode = FALSE
73+
EndGlobalSection
74+
EndGlobal
4.19 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using C3.XNA;
5+
using Microsoft.Xna.Framework;
6+
using Microsoft.Xna.Framework.Audio;
7+
using Microsoft.Xna.Framework.Content;
8+
using Microsoft.Xna.Framework.GamerServices;
9+
using Microsoft.Xna.Framework.Graphics;
10+
using Microsoft.Xna.Framework.Input;
11+
using Microsoft.Xna.Framework.Media;
12+
13+
namespace Primitives2DSample
14+
{
15+
/// <summary>
16+
/// This is the main type for your game
17+
/// </summary>
18+
public class Game1 : Microsoft.Xna.Framework.Game
19+
{
20+
GraphicsDeviceManager graphics;
21+
SpriteBatch spriteBatch;
22+
23+
public Game1()
24+
{
25+
graphics = new GraphicsDeviceManager(this);
26+
Content.RootDirectory = "Content";
27+
}
28+
29+
/// <summary>
30+
/// Allows the game to perform any initialization it needs to before starting to run.
31+
/// This is where it can query for any required services and load any non-graphic
32+
/// related content. Calling base.Initialize will enumerate through any components
33+
/// and initialize them as well.
34+
/// </summary>
35+
protected override void Initialize()
36+
{
37+
// TODO: Add your initialization logic here
38+
39+
base.Initialize();
40+
}
41+
42+
/// <summary>
43+
/// LoadContent will be called once per game and is the place to load
44+
/// all of your content.
45+
/// </summary>
46+
protected override void LoadContent()
47+
{
48+
// Create a new SpriteBatch, which can be used to draw textures.
49+
spriteBatch = new SpriteBatch(GraphicsDevice);
50+
51+
// TODO: use this.Content to load your game content here
52+
}
53+
54+
/// <summary>
55+
/// UnloadContent will be called once per game and is the place to unload
56+
/// all content.
57+
/// </summary>
58+
protected override void UnloadContent()
59+
{
60+
// TODO: Unload any non ContentManager content here
61+
}
62+
63+
/// <summary>
64+
/// Allows the game to run logic such as updating the world,
65+
/// checking for collisions, gathering input, and playing audio.
66+
/// </summary>
67+
/// <param name="gameTime">Provides a snapshot of timing values.</param>
68+
protected override void Update(GameTime gameTime)
69+
{
70+
// Allows the game to exit
71+
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
72+
this.Exit();
73+
74+
// TODO: Add your update logic here
75+
76+
base.Update(gameTime);
77+
}
78+
79+
/// <summary>
80+
/// This is called when the game should draw itself.
81+
/// </summary>
82+
/// <param name="gameTime">Provides a snapshot of timing values.</param>
83+
protected override void Draw(GameTime gameTime)
84+
{
85+
GraphicsDevice.Clear(Color.CornflowerBlue);
86+
spriteBatch.Begin();
87+
88+
spriteBatch.DrawRectangle(new Rectangle(100, 100, 100, 200), Color.Purple, 20);
89+
90+
spriteBatch.DrawRectangle(new Rectangle(10, 10, 100, 200), Color.Yellow, 2);
91+
spriteBatch.DrawRectangle(new Rectangle(20, 20, 100, 200), Color.Yellow, 1);
92+
spriteBatch.DrawRectangle(new Vector2(30, 30), new Vector2(100, 200), Color.Yellow);
93+
spriteBatch.DrawRectangle(new Vector2(40, 40), new Vector2(100, 200), Color.Yellow, 5);
94+
95+
spriteBatch.DrawCircle(400, 100, 90, 3, Color.White * 0.2f);
96+
spriteBatch.DrawCircle(400, 100, 90, 4, Color.White * 0.3f);
97+
spriteBatch.DrawCircle(400, 100, 90, 5, Color.White * 0.4f);
98+
spriteBatch.DrawCircle(400, 100, 90, 6, Color.White * 0.5f);
99+
spriteBatch.DrawCircle(400, 100, 90, 7, Color.White * 0.6f);
100+
spriteBatch.DrawCircle(400, 100, 90, 8, Color.White * 0.7f);
101+
spriteBatch.DrawCircle(400, 100, 90, 9, Color.White * 0.8f);
102+
spriteBatch.DrawCircle(400, 100, 90, 10, Color.White * 0.9f);
103+
spriteBatch.DrawCircle(400, 100, 90, 20, Color.Red);
104+
105+
spriteBatch.DrawCircle(600, 100, 100, 50, Color.Green, 10);
106+
spriteBatch.DrawCircle(new Vector2(600, 100), 40, 30, Color.Green, 30);
107+
108+
spriteBatch.FillRectangle(350, 340, 100, 100, Color.Red * 0.4f);
109+
spriteBatch.FillRectangle(new Rectangle(350, 340, 100, 100), Color.Red * 0.3f, (float)Math.PI / 4f);
110+
spriteBatch.FillRectangle(new Vector2(350, 340), new Vector2(100, 100), Color.Red * 0.2f, (float)Math.PI / 3f);
111+
spriteBatch.FillRectangle(350, 340, 100, 100, Color.Red * 0.5f, (float)Math.PI);
112+
113+
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(180), Color.Navy, 1);
114+
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(160), Color.Navy * 0.9f, 2);
115+
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(140), Color.Navy * 0.8f, 4);
116+
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(120), Color.Navy * 0.7f, 6);
117+
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(90), Color.Navy * 0.6f, 8);
118+
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(80), Color.Navy * 0.5f, 10);
119+
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(65), Color.Navy * 0.4f, 12);
120+
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(45), Color.Navy * 0.3f, 14);
121+
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(12), Color.Navy * 0.2f, 16);
122+
123+
spriteBatch.DrawArc(new Vector2(600, 400), 80, 90, MathHelper.ToRadians(90), MathHelper.ToRadians(220), Color.Navy, 10);
124+
125+
base.Draw(gameTime);
126+
spriteBatch.End();
127+
}
128+
}
129+
}
Loading

0 commit comments

Comments
 (0)