-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
1,201 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>9.0.21022</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{39AD1482-1881-4852-A05D-DC61B0D3446A}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>C3.XNA</RootNamespace> | ||
<AssemblyName>C3.XNA.Primitives2D</AssemblyName> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<FileUpgradeFlags> | ||
</FileUpgradeFlags> | ||
<OldToolsVersion>3.5</OldToolsVersion> | ||
<UpgradeBackupLocation /> | ||
<PublishUrl>publish\</PublishUrl> | ||
<Install>true</Install> | ||
<InstallFrom>Disk</InstallFrom> | ||
<UpdateEnabled>false</UpdateEnabled> | ||
<UpdateMode>Foreground</UpdateMode> | ||
<UpdateInterval>7</UpdateInterval> | ||
<UpdateIntervalUnits>Days</UpdateIntervalUnits> | ||
<UpdatePeriodically>false</UpdatePeriodically> | ||
<UpdateRequired>false</UpdateRequired> | ||
<MapFileExtensions>true</MapFileExtensions> | ||
<ApplicationRevision>0</ApplicationRevision> | ||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> | ||
<IsWebBootstrapper>false</IsWebBootstrapper> | ||
<UseApplicationTrust>false</UseApplicationTrust> | ||
<BootstrapperEnabled>true</BootstrapperEnabled> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" /> | ||
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" /> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core"> | ||
<RequiredTargetFramework>3.5</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="System.Data.DataSetExtensions"> | ||
<RequiredTargetFramework>3.5</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Primitives2D.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<BootstrapperPackage Include=".NETFramework,Version=v4.0"> | ||
<Visible>False</Visible> | ||
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName> | ||
<Install>true</Install> | ||
</BootstrapperPackage> | ||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5"> | ||
<Visible>False</Visible> | ||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> | ||
<Install>false</Install> | ||
</BootstrapperPackage> | ||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> | ||
<Visible>False</Visible> | ||
<ProductName>.NET Framework 3.5 SP1</ProductName> | ||
<Install>false</Install> | ||
</BootstrapperPackage> | ||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> | ||
<Visible>False</Visible> | ||
<ProductName>Windows Installer 3.1</ProductName> | ||
<Install>true</Install> | ||
</BootstrapperPackage> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 11.00 | ||
# Visual Studio 2010 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Primitives2D", "Primitives2D.csproj", "{39AD1482-1881-4852-A05D-DC61B0D3446A}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Primitives2DWP7", "Primitives2DWP7.csproj", "{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Primitives2DSample", "Primitives2DSample\Primitives2DSample\Primitives2DSample.csproj", "{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}" | ||
EndProject | ||
Project("{96E2B04D-8817-42C6-938A-82C39BA4D311}") = "Primitives2DSampleContent", "Primitives2DSample\Primitives2DSampleContent\Primitives2DSampleContent.contentproj", "{F0CD1611-687D-4D13-BF8D-B67C33B15110}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Debug|Mixed Platforms = Debug|Mixed Platforms | ||
Debug|Windows Phone = Debug|Windows Phone | ||
Debug|x86 = Debug|x86 | ||
Release|Any CPU = Release|Any CPU | ||
Release|Mixed Platforms = Release|Mixed Platforms | ||
Release|Windows Phone = Release|Windows Phone | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU | ||
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU | ||
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Debug|Windows Phone.ActiveCfg = Debug|Any CPU | ||
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU | ||
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Release|Mixed Platforms.Build.0 = Release|Any CPU | ||
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Release|Windows Phone.ActiveCfg = Release|Any CPU | ||
{39AD1482-1881-4852-A05D-DC61B0D3446A}.Release|x86.ActiveCfg = Release|Any CPU | ||
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Debug|Any CPU.ActiveCfg = Debug|Windows Phone | ||
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows Phone | ||
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Debug|Mixed Platforms.Build.0 = Debug|Windows Phone | ||
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Debug|Windows Phone.ActiveCfg = Debug|Windows Phone | ||
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Debug|Windows Phone.Build.0 = Debug|Windows Phone | ||
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Debug|x86.ActiveCfg = Debug|Windows Phone | ||
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Debug|x86.Build.0 = Debug|Windows Phone | ||
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Release|Any CPU.ActiveCfg = Release|Windows Phone | ||
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Release|Mixed Platforms.ActiveCfg = Release|Windows Phone | ||
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Release|Mixed Platforms.Build.0 = Release|Windows Phone | ||
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Release|Windows Phone.ActiveCfg = Release|Windows Phone | ||
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Release|Windows Phone.Build.0 = Release|Windows Phone | ||
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Release|x86.ActiveCfg = Release|Windows Phone | ||
{3D2A19A1-D632-4AC0-8B49-0E5C0BDBBB8B}.Release|x86.Build.0 = Release|Windows Phone | ||
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Debug|Any CPU.ActiveCfg = Debug|x86 | ||
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 | ||
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Debug|Mixed Platforms.Build.0 = Debug|x86 | ||
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Debug|Windows Phone.ActiveCfg = Debug|x86 | ||
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Debug|x86.ActiveCfg = Debug|x86 | ||
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Debug|x86.Build.0 = Debug|x86 | ||
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Release|Any CPU.ActiveCfg = Release|x86 | ||
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Release|Mixed Platforms.ActiveCfg = Release|x86 | ||
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Release|Mixed Platforms.Build.0 = Release|x86 | ||
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Release|Windows Phone.ActiveCfg = Release|x86 | ||
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Release|x86.ActiveCfg = Release|x86 | ||
{CE103FD7-F4A5-4B3C-8ADD-04096E1D941D}.Release|x86.Build.0 = Release|x86 | ||
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Debug|Any CPU.ActiveCfg = Debug|x86 | ||
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 | ||
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Debug|Windows Phone.ActiveCfg = Debug|x86 | ||
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Debug|x86.ActiveCfg = Debug|x86 | ||
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Release|Any CPU.ActiveCfg = Release|x86 | ||
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Release|Mixed Platforms.ActiveCfg = Release|x86 | ||
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Release|Windows Phone.ActiveCfg = Release|x86 | ||
{F0CD1611-687D-4D13-BF8D-B67C33B15110}.Release|x86.ActiveCfg = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using C3.XNA; | ||
using Microsoft.Xna.Framework; | ||
using Microsoft.Xna.Framework.Audio; | ||
using Microsoft.Xna.Framework.Content; | ||
using Microsoft.Xna.Framework.GamerServices; | ||
using Microsoft.Xna.Framework.Graphics; | ||
using Microsoft.Xna.Framework.Input; | ||
using Microsoft.Xna.Framework.Media; | ||
|
||
namespace Primitives2DSample | ||
{ | ||
/// <summary> | ||
/// This is the main type for your game | ||
/// </summary> | ||
public class Game1 : Microsoft.Xna.Framework.Game | ||
{ | ||
GraphicsDeviceManager graphics; | ||
SpriteBatch spriteBatch; | ||
|
||
public Game1() | ||
{ | ||
graphics = new GraphicsDeviceManager(this); | ||
Content.RootDirectory = "Content"; | ||
} | ||
|
||
/// <summary> | ||
/// Allows the game to perform any initialization it needs to before starting to run. | ||
/// This is where it can query for any required services and load any non-graphic | ||
/// related content. Calling base.Initialize will enumerate through any components | ||
/// and initialize them as well. | ||
/// </summary> | ||
protected override void Initialize() | ||
{ | ||
// TODO: Add your initialization logic here | ||
|
||
base.Initialize(); | ||
} | ||
|
||
/// <summary> | ||
/// LoadContent will be called once per game and is the place to load | ||
/// all of your content. | ||
/// </summary> | ||
protected override void LoadContent() | ||
{ | ||
// Create a new SpriteBatch, which can be used to draw textures. | ||
spriteBatch = new SpriteBatch(GraphicsDevice); | ||
|
||
// TODO: use this.Content to load your game content here | ||
} | ||
|
||
/// <summary> | ||
/// UnloadContent will be called once per game and is the place to unload | ||
/// all content. | ||
/// </summary> | ||
protected override void UnloadContent() | ||
{ | ||
// TODO: Unload any non ContentManager content here | ||
} | ||
|
||
/// <summary> | ||
/// Allows the game to run logic such as updating the world, | ||
/// checking for collisions, gathering input, and playing audio. | ||
/// </summary> | ||
/// <param name="gameTime">Provides a snapshot of timing values.</param> | ||
protected override void Update(GameTime gameTime) | ||
{ | ||
// Allows the game to exit | ||
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) | ||
this.Exit(); | ||
|
||
// TODO: Add your update logic here | ||
|
||
base.Update(gameTime); | ||
} | ||
|
||
/// <summary> | ||
/// This is called when the game should draw itself. | ||
/// </summary> | ||
/// <param name="gameTime">Provides a snapshot of timing values.</param> | ||
protected override void Draw(GameTime gameTime) | ||
{ | ||
GraphicsDevice.Clear(Color.CornflowerBlue); | ||
spriteBatch.Begin(); | ||
|
||
spriteBatch.DrawRectangle(new Rectangle(100, 100, 100, 200), Color.Purple, 20); | ||
|
||
spriteBatch.DrawRectangle(new Rectangle(10, 10, 100, 200), Color.Yellow, 2); | ||
spriteBatch.DrawRectangle(new Rectangle(20, 20, 100, 200), Color.Yellow, 1); | ||
spriteBatch.DrawRectangle(new Vector2(30, 30), new Vector2(100, 200), Color.Yellow); | ||
spriteBatch.DrawRectangle(new Vector2(40, 40), new Vector2(100, 200), Color.Yellow, 5); | ||
|
||
spriteBatch.DrawCircle(400, 100, 90, 3, Color.White * 0.2f); | ||
spriteBatch.DrawCircle(400, 100, 90, 4, Color.White * 0.3f); | ||
spriteBatch.DrawCircle(400, 100, 90, 5, Color.White * 0.4f); | ||
spriteBatch.DrawCircle(400, 100, 90, 6, Color.White * 0.5f); | ||
spriteBatch.DrawCircle(400, 100, 90, 7, Color.White * 0.6f); | ||
spriteBatch.DrawCircle(400, 100, 90, 8, Color.White * 0.7f); | ||
spriteBatch.DrawCircle(400, 100, 90, 9, Color.White * 0.8f); | ||
spriteBatch.DrawCircle(400, 100, 90, 10, Color.White * 0.9f); | ||
spriteBatch.DrawCircle(400, 100, 90, 20, Color.Red); | ||
|
||
spriteBatch.DrawCircle(600, 100, 100, 50, Color.Green, 10); | ||
spriteBatch.DrawCircle(new Vector2(600, 100), 40, 30, Color.Green, 30); | ||
|
||
spriteBatch.FillRectangle(350, 340, 100, 100, Color.Red * 0.4f); | ||
spriteBatch.FillRectangle(new Rectangle(350, 340, 100, 100), Color.Red * 0.3f, (float)Math.PI / 4f); | ||
spriteBatch.FillRectangle(new Vector2(350, 340), new Vector2(100, 100), Color.Red * 0.2f, (float)Math.PI / 3f); | ||
spriteBatch.FillRectangle(350, 340, 100, 100, Color.Red * 0.5f, (float)Math.PI); | ||
|
||
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(180), Color.Navy, 1); | ||
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(160), Color.Navy * 0.9f, 2); | ||
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(140), Color.Navy * 0.8f, 4); | ||
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(120), Color.Navy * 0.7f, 6); | ||
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(90), Color.Navy * 0.6f, 8); | ||
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(80), Color.Navy * 0.5f, 10); | ||
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(65), Color.Navy * 0.4f, 12); | ||
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(45), Color.Navy * 0.3f, 14); | ||
spriteBatch.DrawArc(new Vector2(600, 350), 100, 180, MathHelper.ToRadians(180), MathHelper.ToRadians(12), Color.Navy * 0.2f, 16); | ||
|
||
spriteBatch.DrawArc(new Vector2(600, 400), 80, 90, MathHelper.ToRadians(90), MathHelper.ToRadians(220), Color.Navy, 10); | ||
|
||
base.Draw(gameTime); | ||
spriteBatch.End(); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.