-
Notifications
You must be signed in to change notification settings - Fork 1
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
17 changed files
with
1,835 additions
and
1 deletion.
There are no files selected for viewing
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,63 @@ | ||
############################################################################### | ||
# Set default behavior to automatically normalize line endings. | ||
############################################################################### | ||
* text=auto | ||
|
||
############################################################################### | ||
# Set default behavior for command prompt diff. | ||
# | ||
# This is need for earlier builds of msysgit that does not have it on by | ||
# default for csharp files. | ||
# Note: This is only used by command line | ||
############################################################################### | ||
#*.cs diff=csharp | ||
|
||
############################################################################### | ||
# Set the merge driver for project and solution files | ||
# | ||
# Merging from the command prompt will add diff markers to the files if there | ||
# are conflicts (Merging from VS is not affected by the settings below, in VS | ||
# the diff markers are never inserted). Diff markers may cause the following | ||
# file extensions to fail to load in VS. An alternative would be to treat | ||
# these files as binary and thus will always conflict and require user | ||
# intervention with every merge. To do so, just uncomment the entries below | ||
############################################################################### | ||
#*.sln merge=binary | ||
#*.csproj merge=binary | ||
#*.vbproj merge=binary | ||
#*.vcxproj merge=binary | ||
#*.vcproj merge=binary | ||
#*.dbproj merge=binary | ||
#*.fsproj merge=binary | ||
#*.lsproj merge=binary | ||
#*.wixproj merge=binary | ||
#*.modelproj merge=binary | ||
#*.sqlproj merge=binary | ||
#*.wwaproj merge=binary | ||
|
||
############################################################################### | ||
# behavior for image files | ||
# | ||
# image files are treated as binary by default. | ||
############################################################################### | ||
#*.jpg binary | ||
#*.png binary | ||
#*.gif binary | ||
|
||
############################################################################### | ||
# diff behavior for common document formats | ||
# | ||
# Convert binary document formats to text before diffing them. This feature | ||
# is only available from the command line. Turn it on by uncommenting the | ||
# entries below. | ||
############################################################################### | ||
#*.doc diff=astextplain | ||
#*.DOC diff=astextplain | ||
#*.docx diff=astextplain | ||
#*.DOCX diff=astextplain | ||
#*.dot diff=astextplain | ||
#*.DOT diff=astextplain | ||
#*.pdf diff=astextplain | ||
#*.PDF diff=astextplain | ||
#*.rtf diff=astextplain | ||
#*.RTF diff=astextplain |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# Bridge.VirtualJoystick | ||
A Bridge.Net definition library for https://github.com/viewar/virtualjoystick.js. | ||
|
||
A Bridge.Net definition library for https://github.com/viewar/virtualjoystick.js which was [started](https://github.com/jeromeetienne/virtualjoystick.js) by [Jerome Etienne](https://github.com/jeromeetienne). |
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,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.27019.1 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bridge.VirtualJoystick", "Bridge.VirtualJoystick\Bridge.VirtualJoystick.csproj", "{B476097A-B3F4-49E0-AB36-A7BD7F2C59D7}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example", "Example\Example.csproj", "{50438438-512E-4BA8-B465-9645136E262E}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{B476097A-B3F4-49E0-AB36-A7BD7F2C59D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B476097A-B3F4-49E0-AB36-A7BD7F2C59D7}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B476097A-B3F4-49E0-AB36-A7BD7F2C59D7}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B476097A-B3F4-49E0-AB36-A7BD7F2C59D7}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{50438438-512E-4BA8-B465-9645136E262E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{50438438-512E-4BA8-B465-9645136E262E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{50438438-512E-4BA8-B465-9645136E262E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{50438438-512E-4BA8-B465-9645136E262E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {D141EDAE-6AFC-4559-B423-C2CFB59E72FE} | ||
EndGlobalSection | ||
EndGlobal |
67 changes: 67 additions & 0 deletions
67
src/Bridge.VirtualJoystick/Bridge.VirtualJoystick/Bridge.VirtualJoystick.csproj
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,67 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<NoStdLib>true</NoStdLib> | ||
<NuGetPackageImportStamp> | ||
</NuGetPackageImportStamp> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{B476097A-B3F4-49E0-AB36-A7BD7F2C59D7}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Bridge.VirtualJoystick</RootNamespace> | ||
<AssemblyName>Bridge.VirtualJoystick</AssemblyName> | ||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</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> | ||
<Compile Include="Models\VirtualJoystickOptionsModel.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="VirtualJoystick.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="bridge.json" /> | ||
<None Include="Bridge.VirtualJoystick.nuspec" /> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="Bridge, Version=16.5.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\Bridge.Core.16.5.0\lib\net40\Bridge.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Bridge.Html5, Version=16.5.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\Bridge.Html5.16.5.0\lib\net40\Bridge.Html5.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Newtonsoft.Json, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\Bridge.Newtonsoft.Json.1.3.0\lib\net40\Newtonsoft.Json.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<Import Project="..\packages\Bridge.Min.16.5.0\build\Bridge.Min.targets" Condition="Exists('..\packages\Bridge.Min.16.5.0\build\Bridge.Min.targets')" /> | ||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | ||
<PropertyGroup> | ||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> | ||
</PropertyGroup> | ||
<Error Condition="!Exists('..\packages\Bridge.Min.16.5.0\build\Bridge.Min.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Bridge.Min.16.5.0\build\Bridge.Min.targets'))" /> | ||
</Target> | ||
</Project> |
15 changes: 15 additions & 0 deletions
15
src/Bridge.VirtualJoystick/Bridge.VirtualJoystick/Bridge.VirtualJoystick.nuspec
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,15 @@ | ||
<?xml version="1.0"?> | ||
<package > | ||
<metadata> | ||
<id>$id$</id> | ||
<version>1.0.0</version> | ||
<title>A Virtual Joystick Bridge.Net definition library.</title> | ||
<authors>Ethan Lemke</authors> | ||
<owners>Ethan Lemke</owners> | ||
<licenseUrl>https://github.com/lemke-ethan/Bridge.VirtualJoystick/blob/master/LICENSE</licenseUrl> | ||
<projectUrl>https://github.com/lemke-ethan/Bridge.VirtualJoystick</projectUrl> | ||
<requireLicenseAcceptance>true</requireLicenseAcceptance> | ||
<description>A Bridge.Net definition library for viewar's fork of Jerome Etienne's Virtual Joystick(https://github.com/jeromeetienne/virtualjoystick.js).</description> | ||
<tags>Bridge.Net C# VitualJoystick Bridge JavaScript</tags> | ||
</metadata> | ||
</package> |
127 changes: 127 additions & 0 deletions
127
src/Bridge.VirtualJoystick/Bridge.VirtualJoystick/Models/VirtualJoystickOptionsModel.cs
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,127 @@ | ||
using Bridge.Html5; | ||
using System; | ||
|
||
namespace Bridge.VirtualJoystick.Models | ||
{ | ||
/// <summary> | ||
/// Virtual Joystick options. | ||
/// </summary> | ||
/// <remarks> | ||
/// All are optional. | ||
/// </remarks> | ||
[External] | ||
[ObjectLiteral] | ||
[Namespace(false)] | ||
[Convention(Target = ConventionTarget.Member, Notation = Notation.LowerCamelCase)] | ||
public class VirtualJoystickOptionsModel | ||
{ | ||
#region Public Properties | ||
|
||
/// <summary> | ||
/// Function that checks if the coordinate is valid. | ||
/// </summary> | ||
/// <remarks> | ||
/// Defaults to a function that returns true. | ||
/// </remarks> | ||
public Func<int, int, bool> CheckValid { get; set; } | ||
|
||
/// <summary> | ||
/// The DOM element on which we display the joystick. | ||
/// </summary> | ||
/// <remarks> | ||
/// Defaults to the <see cref="Document.Body"/>. | ||
/// </remarks> | ||
public HTMLElement Container { get; set; } | ||
|
||
/// <summary> | ||
/// The stroke style of the joystick. | ||
/// </summary> | ||
/// <remarks> | ||
/// Defaults to the color cyan. | ||
/// </remarks> | ||
public Union<string, CanvasGradient, CanvasPattern> StrokeStyle { get; set; } | ||
|
||
/// <summary> | ||
/// Hides the joystick base. | ||
/// </summary> | ||
/// <remarks> | ||
/// Defaults to false. | ||
/// </remarks> | ||
public bool StickBaseHidden { get; set; } | ||
|
||
/// <summary> | ||
/// The radius of the joystick stick. | ||
/// </summary> | ||
/// <remarks> | ||
/// Defaults to 40. | ||
/// </remarks> | ||
public int StickDisplayRadius { get; set; } | ||
|
||
/// <summary> | ||
/// The radius of the joystick base. | ||
/// </summary> | ||
/// <remarks> | ||
/// Defaults to 60. | ||
/// </remarks> | ||
public int StickBaseDisplayRadius { get; set; } | ||
|
||
/// <summary> | ||
/// The element to use for the joystick stick. | ||
/// </summary> | ||
/// <remarks> | ||
/// Defaults to an <see cref="HTMLCanvasElement"/>. | ||
/// </remarks> | ||
public HTMLElement StickElement { get; set; } | ||
|
||
/// <summary> | ||
/// The element to use for the joystick base. | ||
/// </summary> | ||
/// <remarks> | ||
/// Defaults to an <see cref="HTMLCanvasElement"/>. | ||
/// </remarks> | ||
public HTMLElement BaseElement { get; set; } | ||
|
||
/// <summary> | ||
/// Indicates if the joystick base should be stationary. | ||
/// </summary> | ||
/// <remarks> | ||
/// Defaults to false. | ||
/// </remarks> | ||
public bool StationaryBase { get; set; } | ||
|
||
/// <summary> | ||
/// The joystick base X coordinate. | ||
/// </summary> | ||
/// <remarks> | ||
/// Defaults to 0. | ||
/// </remarks> | ||
public int BaseX { get; set; } | ||
|
||
/// <summary> | ||
/// The joystick base Y coordinate. | ||
/// </summary> | ||
/// <remarks> | ||
/// Defaults to 0. | ||
/// </remarks> | ||
public int BaseY { get; set; } | ||
|
||
/// <summary> | ||
/// Limit the joystick's travel. | ||
/// </summary> | ||
/// <remarks> | ||
/// Defaults to false. | ||
/// </remarks> | ||
public bool LimitStickTravel { get; set; } | ||
|
||
/// <summary> | ||
/// The max distance the joystick stick can travel from the center of the joystick. | ||
/// This is used by <see cref="LimitStickTravel"/>. | ||
/// </summary> | ||
/// <remarks> | ||
/// Defaults to 100. | ||
/// </remarks> | ||
public int StickRadius { get; set; } | ||
|
||
#endregion | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/Bridge.VirtualJoystick/Bridge.VirtualJoystick/Properties/AssemblyInfo.cs
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,31 @@ | ||
using System.Reflection; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("Bridge.VirtualJoystick")] | ||
[assembly: AssemblyDescription("A Bridge.Net definition library for Jerome Etienne's Virtual Joystick.")] | ||
[assembly: AssemblyProduct("Bridge.VirtualJoystick")] | ||
[assembly: AssemblyCopyright("Copyright © 2017")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("b476097a-b3f4-49e0-ab36-a7bd7f2c59d7")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
Oops, something went wrong.