(61d00a474) v0.9.7.1

This commit is contained in:
Regalis
2020-03-04 13:04:10 +01:00
parent 3c50efa5c9
commit 3c09ebe02f
5086 changed files with 786063 additions and 295871 deletions
@@ -1,47 +0,0 @@
The 2MGFX tool is used to build a MonoGame Effect from an input Microsoft FX or MGFX file.
## Command Line
The command line options are:
```
2MGFX <SourceFile> <OutputFile> [/Debug] [/Profile:<DirectX_11,OpenGL,PlayStation4>]
```
### Source File
The input effect file in typical FX format with samplers, techniques, and passes defined. This parameter is required.
### Output File
The file to write for the output compiled MGFX file. This parameter is required.
NOTE: The generated file is not an XNB file for use with the ContentManager.
### Debug Info
If the `/Debug` flag is passed the resulting compiled MGFX file will contain extra debug information and the fewest possible optimizations.
### Platform Profile
The `/Profile` option defines the platform we're targeting with this effect file. It can be one of the following:
```
DirectX_11
OpenGL
PlayStation4
PSVita
XboxOne
Switch
```
NOTE: PlayStation 4, Xbox One, PS Vita, and Switch support is only available to licensed console developers.
### Help
If you use `/?`, `/help`, or simply pass no paramters to 2MGFX.exe you will get information about these command line options.
## Runtime Use
The resulting compiled MGFX file can be used from your game code like so:
```csharp
byte[] bytecode = File.ReadAllBytes("mycompiled.mgfx");
var effect = new Effect(bytecode);
```
This is basically how the stock effects (BasicEffect, DualTextureEffect, etc) are compiled and loaded.
@@ -1,49 +0,0 @@
THIS IS A WORK IN PROGRESS!
# MonoGame Documentation
This is the source for the [documentation published on MonoGame.net](http://www.monogame.net/documentation/). It is rebuilt when the code changes and is published nightly to the website.
## General Rules
The following rules must be observed at all times when contributing documentation to the MonoGame project.
- Write in a neutral, technical tone.
- Avoid humor, personal opinions, and colloquial language.
- **Never** plagiarize any documentation from another source.
- Do not use automatic documentation tools as they are ineffective.
Breaking these rules can result in your contribution being rejected.
## Getting Started
You can create and edit documentation right from the web browser without needing to install Git or ever leave the GitHub site.
- [Fork the MonoGame repo](https://help.github.com/articles/fork-a-repo/).
- [Create a new branch](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/) from `develop` and make your changes only in that branch.
- [Create a new file](https://help.github.com/articles/creating-new-files/) or [edit an existing one](https://help.github.com/articles/editing-files-in-your-repository/) using the GitHub markup editor.
- [Submit pull requests](https://help.github.com/articles/creating-a-pull-request/) early and often to merge your documentation changes.
## Style Guide
Review the following expectations before contributing any documentation.
### Manuals, Guides, and Tutorials
TODO!
### API Reference
The API reference documentation is a big part of the documentation effort for MonoGame. The documentation is written in the [C# XML format](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/xml-documentation-comments) and is inline to the MonoGame source code. The final web pages with API documentation are generated using [SharpDoc](https://github.com/xoofx/SharpDoc).
#### Every Word Should Contain Value
Every word in the reference documentation should provide information beyond the API itself. Documentation that only rehashes or rephrases what is already apparent in the class, method, parameter, or property name has zero value and wastes time for both the writer and reader.
#### The First Sentence Is The Most Important
There is no guarantee that the reader will read beyond the first sentence of the reference documentation. This is why that first sentence is the most important and should convey the most key piece of information. Take your time to write the most concise and clear first sentence possible. This helps users tremendously and goes a long way towards having great documentation.
#### Surface Information Hidden In the Code
Being inline with the code allows you to easily look for critical information within it that the user might not know from looking at the API alone. Take your time to explore inner method calls and platform specific sections of the code. The time to write the documentation is once you feel you fully understand the code you are documenting. If you don't feel you understand the code then leave the documentation for someone else to write.
#### Documentation Is Referenced Not Read
Remember that the user is searching for an answer for a specific question. It is your job to predict these questions and provide them clear answers.
## License
All documentation contributed to the MonoGame project is subject to the [Creative Commons Attribution-NonCommercial-ShareAlike](http://creativecommons.org/licenses/by-nc-sa/4.0/) license. By contributing you are agreeing to the terms of that license.
<p align="center"><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Text" property="dct:title" rel="dct:type">MonoGame Documentation</span> by the <a xmlns:cc="http://creativecommons.org/ns#" href="http://www.monogame.net" property="cc:attributionName" rel="cc:attributionURL">MonoGame Team</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike License</a>.</p>
File diff suppressed because it is too large Load Diff
@@ -1,13 +0,0 @@
@*
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
*@
@model SharpDoc.TemplateContext
@using SharpDoc.Model
<iframe id="mainFrame" name="mainFrame" frameborder="0" scrolling="no" width="100%" height="100%"></iframe>
<script type="text/javascript" language="JavaScript">
loadContent("@Model.RootTopic.PageId", "@Param.FileExt");
</script>
@@ -1,26 +0,0 @@
@*
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
*@
@model SharpDoc.TemplateContext
@using SharpDoc.Model;
@Import("PageHead")
@Import("PageBody")
@helper Dump(string title, string bodyTemplateName)
{
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
@Helpers.PageHead.Dump(title)
</head>
<body onload="onPageLoad('@title | MonoGame', '@Model.Topic.PageId');">
@Helpers.PageBody.Dump(bodyTemplateName)
<br />
<br />
</body>
</html>
}
@@ -1,23 +0,0 @@
@*
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
*@
@model SharpDoc.TemplateContext
@using SharpDoc.Model
@helper Dump(string bodyTemplateName)
{
<script type="text/javascript" language="javascript">
if(window == window.top)
location.href = "/documentation/?page=@Model.Topic.PageId";
document.addEvent('domready', function () {
InstallCodeTabs();
});
</script>
<div class="sharpdoc">
<div class="content">
@Include(bodyTemplateName)
</div>
</div>
}
@@ -1,46 +0,0 @@
@*
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
*@
@model SharpDoc.TemplateContext
@using SharpDoc.Model
@Import("PageHead")
@Import("TocBody")
@helper Dump(){
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
@Helpers.PageHead.Dump(Model.RootTopic.PageTitle)
</head>
<body>
@* Initialize splitpane *@
<script type="text/javascript" language="javascript">
document.addEvent('domready', function () {
SplitPane('toc_content', 'pane_toggle', 'pane_resizer');
});
</script>
<div class="sharpdoc">
<div id="body">
<div id="toc_content" class="toc_content">
<div class="inner">
@Helpers.TocBody.Dump()
<br />
<br />
</div>
</div>
<div id="pane_resizer" class="pane_resizer">
<div id="pane_toggle" class="collapse" ></div>
</div>
<div id="main_content" class="main_content">
@Include("ContentHeader")
@Include("MainFrame")
@Include("ContentFooter")
</div>
</div>
</div>
</body>
</html>
}
@@ -1,52 +0,0 @@
@*
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
*@
@model SharpDoc.TemplateContext
@using SharpDoc.Model
@Import("PageIndexBody")
<html>
<head>
<title>@Param.Title</title>
</head>
<body>
@if (Model.RootTopic != null)
{
NTopic indexTopic = new NTopic {PageId = "index"};
Model.Topic = indexTopic;
Model.WriteTo(indexTopic, @Helpers.PageIndexBody.Dump());
<script>
function resizeDocs()
{
var docFrame = document.getElementById('the_docs');
var tocDoc = docFrame.contentDocument || docFrame.contentWindow.document;
var contentFrame = tocDoc.getElementById('mainFrame');
var contentDoc = contentFrame.contentDocument || contentFrame.contentWindow.document;
var tocElem = tocDoc.getElementById('toc_content');
var tocSize = tocElem.scrollHeight ||
tocElem.offsetHeight ||
tocElem.clientHeight ||
0;
// The order here is very specifc to ensure it
// works on IE and Chrome with fallbacks.
var contentSize = contentDoc.documentElement.offsetHeight ||
contentDoc.body.scrollHeight ||
contentDoc.documentElement.scrollHeight ||
contentDoc.offsetHeight ||
contentDoc.documentElement.clientHeight ||
0;
var pageHeight = Math.max(contentSize, tocSize, 720);
docFrame.style.height = pageHeight + 'px';
}
</script>
<iframe id="the_docs" src="html/@indexTopic.PageId@Param.FileExt" frameborder="0" scrolling="no" width="100%" height="100%"></iframe>
}
</body>
</html>
@@ -1,70 +0,0 @@
@*
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
*@
@model SharpDoc.TemplateContext
@using SharpDoc.Model
@Import("Members")
@Import("Syntax")
@*
* ------------------------------------------------------------------
* Dump a section
* ------------------------------------------------------------------
* sectionId: id for the section
* name: display name
* content: html content of the section
* ------------------------------------------------------------------
*@
@helper Dump(string sectionId, string name, string content)
{
<script language="javascript">
window.addEvent('domready', function() {
$('@(sectionId)_toggle').addEvent('click', function (event) {
var ct = $('@(sectionId)_content');
if (ct.isDisplayed())
{
$('@(sectionId)_icon').setProperty('class', 'toggle_icon in');
$('@(sectionId)_content').hide();
}
else
{
$('@(sectionId)_icon').setProperty('class', 'toggle_icon out');
$('@(sectionId)_content').show();
}
});
});
</script>
<div id="@sectionId" class="section">
<div class="title"><a id="@(sectionId)_toggle" href="#" class="title"><div id="@(sectionId)_icon" class="toggle_icon out"></div><span class="title">@Escape(name)</span></a><div class="hr"><hr/></div></div>
<div id="@(sectionId)_content" class="block">
@Raw(content)
</div>
</div>
}
@helper Dump(string name, string content)
{
@Dump("section_" + name.Replace(" ",""), name, content)
}
@helper Dump(string sectionId, string name, IEnumerable<NModelBase> members, bool showIcons)
{
@Dump(sectionId, name, Helpers.Members.Dump(members, showIcons).ToString())
}
@helper Dump(string name, IEnumerable<NModelBase> members, bool showIcons)
{
@Dump(name, Helpers.Members.Dump(members, showIcons).ToString())
}
@helper Dump(string name, IEnumerable<NModelBase> members, bool showIcons, IModelReference context)
{
@Dump(name, Helpers.Members.Dump(members, showIcons, context).ToString())
}
@helper DumpSyntax(NMember member)
{
@Dump("Syntax", Helpers.Syntax.Dump(member).ToString())
}
@@ -1,39 +0,0 @@
@*
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
*@
@model SharpDoc.TemplateContext
@using SharpDoc.Model
@Import("SyntaxMethod")
@Import("SyntaxProperty")
@Import("TabCode")
@Import("SyntaxCodeCSharp")
@Import("SyntaxCodeVB")
@Import("SyntaxCodeFSharp")
@*// Dumps syntax section*@
@helper Dump(NMember member)
{
@Helpers.TabCode.Dump(new string[] {
"C#", "<pre class='brush: csharp;'>" + Escape(Helpers.SyntaxCodeCSharp.Dump(member)) + "</pre>",
"VB", Helpers.SyntaxCodeVB.Dump(member),
"F#", Helpers.SyntaxCodeFSharp.Dump(member),
});
if (member is NMethod)
{
@Helpers.SyntaxMethod.Dump((NMethod) member)
}
else if (member is NProperty)
{
@Helpers.SyntaxProperty.Dump((NProperty) member)
}
else if (member is NDelegate)
{
@Helpers.SyntaxMethod.Dump(((NDelegate) member).Invoke)
}
else if (member is NType)
{
<p>The @member.Name type exposes the following members.</p>
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

@@ -1,322 +0,0 @@
// Copyright (c) 2010-2013 SharpDoc - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// -------------------------------------------------------------------------------
// SplitPane handling Toc and Conent
// -------------------------------------------------------------------------------
// splitPaneId: id to the splitPane container
// splitPaneToggleId: id to the splitPane toggle collapse-expand button
// splitPaneResizerId: id to the resizer grip
function supports_local_storage() {
try {
return 'localStorage' in window && window['localStorage'] !== null && window.localStorage['getItem'] !== null;
} catch (e) {
return false;
}
}
function autoResize(id) {
if (document.getElementById) {
var newheight = "100%";
if (Browser.firefox || Browser.ie) {
newheight = (document.getElementById(id).contentWindow.document.body.scrollHeight) + "px";
}
document.getElementById(id).height = newheight;
}
}
function loadContent(rootTopic, extension) {
var data = window.top.location.search;
var url = rootTopic + extension;
var topicToHighlight = rootTopic;
if(data != null && data !="")
{
var pattern = /page=(\w+)/;
var page = pattern.exec(data);
if(page != null)
{
url = page[1] + extension;
topicToHighlight = page[1];
}
}
$("mainFrame").setAttribute("src", url);
hightLightTopic(topicToHighlight);
}
function onPageLoad(pageTitle, pageId)
{
var topWindow = window.top;
topWindow.resizeDocs();
topWindow.scrollTo(0,0);
topWindow.document.title = pageTitle;
topWindow.history.replaceState(null, pageTitle, '?page=' + pageId);
}
/*
http://webfreak.no/wp/2007/09/05/get-for-mootools-a-way-to-read-get-variables-with-javascript-in-mootools/
Function: $get
This function provides access to the "get" variable scope + the element anchor
Version: 1.3
Arguments:
key - string; optional; the parameter key to search for in the url's query string (can also be "#" for the element anchor)
url - url; optional; the url to check for "key" in, location.href is default
Example:
>$get("foo","http://example.com/?foo=bar"); //returns "bar"
>$get("foo"); //returns the value of the "foo" variable if it's present in the current url(location.href)
>$get("#","http://example.com/#moo"); //returns "moo"
>$get("#"); //returns the element anchor if any, but from the current url (location.href)
>$get(,"http://example.com/?foo=bar&bar=foo"); //returns {foo:'bar',bar:'foo'}
>$get(,"http://example.com/?foo=bar&bar=foo#moo"); //returns {foo:'bar',bar:'foo',hash:'moo'}
>$get(); //returns same as above, but from the current url (location.href)
>$get("?"); //returns the query string (without ? and element anchor) from the current url (location.href)
Returns:
Returns the value of the variable form the provided key, or an object with the current GET variables plus the element anchor (if any)
Returns "" if the variable is not present in the given query string
Credits:
Regex from [url=http://www.netlobo.com/url_query_string_javascript.html]http://www.netlobo.com/url_query_string_javascript.html[/url]
Function by Jens Anders Bakke, webfreak.no
*/
function $get(key, url) {
if (arguments.length < 2) url = location.href;
if (arguments.length > 0 && key != "") {
if (key == "#") {
var regex = new RegExp("[#]([^$]*)");
} else if (key == "?") {
var regex = new RegExp("[?]([^#$]*)");
} else {
var regex = new RegExp("[?&]" + key + "=([^&#]*)");
}
var results = regex.exec(url);
return (results == null) ? "" : results[1];
} else {
url = url.split("?");
var results = {};
if (url.length > 1) {
url = url[1].split("#");
if (url.length > 1) results["hash"] = url[1];
url[0].split("&").each(function (item, index) {
item = item.split("=");
results[item[0]] = item[1];
});
}
return results;
}
}
function InstallCodeTabs() {
var groupTabs = $$('.grouptab');
groupTabs.each(function (groupTab, groupIndex) {
var tabs = groupTab.getChildren('.tabs li.tab');
var content = groupTab.getChildren('.tabcontent');
tabs.each(function (tab, index) {
tab.addEvent('click', function () {
tabs.removeClass('selected');
content.removeClass('selected');
tabs[index].addClass('selected');
content[index].addClass('selected');
});
});
});
}
function SplitPane(splitPaneId, splitPaneToggleId, splitPaneResizerId) {
// Define column elemnts
var paneLeft = $(splitPaneId);
var paneRight = $("main_content");
var splitPaneResizer = $(splitPaneResizerId);
var splitPaneToggle = $(splitPaneToggleId);
var iframe = $('mainFrame');
var paneLeftMinWidth = 100;
var paneLeftOriginalWidth = paneLeft.getWidth();
splitPaneResizer.setStyle('left', paneLeftOriginalWidth + 3);
paneRight.setStyle('left', paneLeftOriginalWidth);
var splitPaneOriginalLeft = splitPaneResizer.getLeft();
var paneRightOriginalLeft = paneRight.getLeft();
// Use localstorage to store toggle state
if (supports_local_storage()) {
if (localStorage.getItem('sharpdoc-resize')) {
var value = localStorage.getItem('sharpdoc-resize');
if (value == 0) {
splitPaneToggle.set('class', 'expand');
paneLeft.setStyle('display', 'none');
}
paneLeft.setStyle('width', value);
}
}
// Snap size for resizer
var resizerSnap = 5;
// Make the left cell resizable
paneLeft.makeResizable({
handle: $(splitPaneResizerId),
grid: resizerSnap,
modifiers: { x: 'width', y: false },
limit: { x: [paneLeftMinWidth, null] },
onStart: function (el) {
// Disable pointer events on iframe while dragging
// otherwise we can't drag over the iframe
iframe.setStyle('pointer-events', 'none');
},
onComplete: function(el) {
// Enable back pointer events on iframe after dragging
// is complete
iframe.setStyle('pointer-events', 'auto');
},
onDrag: function (el) {
splitPaneResizer.setStyle('left', el.getWidth() + 3);
paneRight.setStyle('left', el.getWidth());
if (supports_local_storage()) {
localStorage.setItem('sharpdoc-resize', el.getWidth());
}
},
});
var topTitle = $$('h1.content-title');
var expandCollapseFunction = function (event) {
if (paneLeft.getWidth() < paneLeftMinWidth) {
splitPaneToggle.set('class', 'collapse');
paneLeft.setStyle('display', 'block');
// Morph the following values
paneLeft.morph({'width': paneLeftOriginalWidth,'opacity': '1'});
splitPaneResizer.morph({ 'left': splitPaneOriginalLeft + 12 }); // not sure why we need to add 12 to have a correct display
paneRight.morph({ 'left': paneRightOriginalLeft + 12});
if (supports_local_storage()) {
localStorage.removeItem('sharpdoc-resize');
}
} else {
splitPaneToggle.set('class', 'expand');
paneLeft.set('morph', { link: 'chain' }).morph({ 'width': '1', 'opacity': '0' }).morph({ 'display': 'none' });
splitPaneResizer.morph({ 'left': '1' });
paneRight.morph({ 'left': '1' });
if (supports_local_storage()) {
localStorage.setItem('sharpdoc-resize', 0);
}
}
};
// Handle toggle button collapse-expand events
splitPaneToggle.addEvent('click', expandCollapseFunction);
if (topTitle.length > 0) {
topTitle[0].addEvent('click', expandCollapseFunction);
}
}
function openToc(nodeId) {
//alert("open");
var node = $_(nodeId + "_toc");
var nodeClass = node.get('class');
if (nodeClass.indexOf('opened') == -1) {
var subNodes = $_(nodeId + "_SubTopics");
if (subNodes != undefined && subNodes.set != undefined)
subNodes.set('class', 'visible');
node.set('class', nodeClass.replace('closed', 'opened'));
}
var parent = node.getParent().id;
var pattern = /(\w+)_SubTopics/;
var parentId = pattern.exec(parent);
if (parentId != null)
openToc(parentId[1]);
else
window.top.resizeDocs();
}
function closeToc(nodeId) {
//alert("close");
var node = $_(nodeId + "_toc");
var nodeClass = node.get('class');
// The highlighten topic could not be closed
if (nodeClass.indexOf('highlighting') == -1) {
var subNodes = $_(nodeId + "_SubTopics");
if (subNodes != undefined && subNodes.set != undefined)
subNodes.set('class', 'hidden');
node.set('class', nodeClass.replace('opened', 'closed'));
}
else {
node.set('class', nodeClass.replace(' highlighting', ''));
}
window.top.resizeDocs();
}
function toggleToc(nodeId) {
//alert("toggle");
var node = $_(nodeId + "_toc");
var nodeClass = node.get('class');
if (nodeClass.indexOf('closed') != -1)
openToc(nodeId);
else
closeToc(nodeId);
}
function hightLightTopic(topicId) {
//alert("highlight");
var oldHighlight = $$_('.highlight');
oldHighlight.each(function (old, oldId) {
var oldClass = old.get('class');
old.set('class', oldClass.replace(' highlight', ''));
});
var newHightlight = $_(topicId + '_toc');
var newClass = newHightlight.get('class');
newHightlight.set('class', newClass + ' highlight highlighting');
openToc(topicId);
}
function $_(id) {
var element = $(id);
if (element == undefined)
element = window.parent.$(id);
return element;
}
function $$_(id) {
var elements = $$(id);
if (elements == undefined || elements.length == 0)
{
if (window.parent.$$ != undefined)
elements = window.parent.$$(id);
}
return elements;
}
@@ -1,16 +0,0 @@
<?xml version="1.0"?>
<!--
MonoGame - Copyright (C) The MonoGame Team
This file is subject to the terms and conditions defined in
file 'LICENSE.txt', which is part of this source code package.
-->
<style xmlns="SharpDoc">
<name>MonoGame</name>
<description>MonoGame style for web publishing</description>
<inherit>Standard</inherit>
<param name="FileExt">.html</param>
<param name="ExternalLinkTarget">_top</param>
</style>
@@ -1,43 +0,0 @@
# Game class constructor
Due to some UWP implementation details, MonoGame has to construct your `Game` derived class by itself, using a static initializer `MonoGame.Framework.XamlGame<T>.Create(...)`.
In this situation, you have two main possibilities to create a `Game` derived class:
1. Let `XamlGame` initialize your `Game` derived class using the default constructor
2. Let `XamlGame` initialize your `Game` derived class using a custom constructor.
#### 1. XamlGame uses the default constructor
With this logic, it isn't possible to inject dependencies through the constructor since the default constructor is called:
`var game = new T();`
#### 2. XamlGame uses a custom constructor
Why may you need this constructor?
Consider `Game1` needs some dependencies such as an `ISettingsRepository` to get some values from each *platform* settings store. You would then implement an `AndroidSettingsRepository` and a `UwpSettingsRepository`, but you cannot construct those dependencies in `Game1` itself, **because they are platform dependent**, so you'll have to inject them into its constructor.
For example, in a `MainActivity` on Android you would do:
```csharp
_game = new Game1(
new AndroidTextFileImporter(Assets),
new AndroidSettingsRepository(this));
```
With the UWP implementation using `XamlGame` static initializer, you could do this:
```csharp
_game = MonoGame.Framework.XamlGame<Game1>.Create(
launchArguments,
Window.Current.CoreWindow,
swapChainPanel,
() => new Game1(
new UwpTextFileImporter(Assets),
new UwpSettingsRepository(this)));
```
In this way, you tell the static initializer **how** you'd like to construct `Game1`.
@@ -1,43 +0,0 @@
MonoGame supports more than one method of using fonts, the following is an explanation of how to use TrueType fonts.
#### Using TrueType Fonts with MonoGame
To be able to use a truetype font, MonoGame requires the truetype font file and a .spritefont file.
Truetype fonts may be installed on the system, or added to the project manually using your IDE in the same directory as the .spritefont file.
1. Create the .spritefont file.
<p>
<img src="images/adding_ttf_fonts_step_1.PNG"/>
</p>
<p>
<img src="images/adding_ttf_fonts_step_2.PNG"/>
</p>
2- Open the newly created .spritefont file in your text editor of choice, find this line and change it to your selected .ttf font.
If the font is installed on the system, just type the name of the font.
```xml
<FontName>Arial</FontName>
```
#### Usage Example
Make a class variable of type Spritefont
```csharp
SpriteFont font;
```
Load the font in the LoadContent function
```csharp
font = myGame.Content.Load<SpriteFont>("Fonts/myFont")
```
Draw any text in the Draw function
```csharp
spriteBatch.Begin();
// Finds the center of the string in coordinates inside the text rectangle
Vector2 textMiddlePoint = font.MeasureString(text) / 2;
// Places text in center of the screen
Vector2 position = new Vector2(myGame.Window.ClientBounds.Width / 2, myGame.Window.ClientBounds.Height / 2);
spriteBatch.DrawString(font, "MonoGame Font Test", position, Color.White, 0, textMiddlePoint, 1.0f, SpriteEffects.None, 0.5f)
spriteBatch.End();
```
If you want to know more, please refer to the [API Documentation]()
@@ -1,60 +0,0 @@
#
## Target Frameworks
Specifying the target Android versions can be confusing. MonoGame is built to target Android 4.2 (API Level 17), but can run on lower Android versions. If you build MonoGame from source, you will need the SDK Platform for API Level 17 installed in the Android SDK Manager.
Since MonoGame targets Android 4.2, the Target Framework in your Android project must be set to 4.2 or higher. To allow your game to run on lower Android versions, set the Minimum Android version to the desired version in the project properties.
### Visual Studio
There are three settings in the Application tab of the project properties to set the target Android versions.
`Compile using Android version` must be set to a minimum of `Android 4.2`. If you are using APIs available only in later Android versions, this must be set to the Android version that API became available or higher.
`Minimum Android to target` is set to the lowest Android version that you wish to support.
`Target Android version` is usually set to `Use Compile using SDK version`. This means to use the same value that we set the app to be built with. There is usually no reason to set this to any other value.
This is an example of a project set to build with the 4.4 SDK and target 4.0 as a minimum Android version.
<p align="center">
<img src="images/android_vs_target_frameworks.png"/>
</p>
### Xamarin Studio
Xamarin Studio has the same settings in the project options dialog. They are just in different places.
`Target framework` on the `General` page is the equivalent of Visual Studio's `Compile using Android version`.
<p align="center">
<img src="images/android_xs_target_framework.png"/>
</p>
On the `Android Application` page, you will find `Minimum Android version` (Visual Studio's `Minimum Android to target`) and `Target Android version` (same as Visual Studio).
<p align="center">
<img src="images/android_xs_minimum_framework.png"/>
</p>
## Android Manifest Requirements
### OpenGL ES 2.0 Support
MonoGame uses OpenGL ES 2.0. Google requires the following to be added to AndroidManifest.xml in order for the Market to hide the game from devices that do not have support for OpenGL ES 2.0.
```
<!-- Tell the system this app requires OpenGL ES 2.0. -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
```
### Texture Compression
The Market can also filter games by the types of texture compression they support. Add a ```
<supports-gl-texture> ``` node for each type of texture compression used in your game. See the [Android documentation](http://developer.android.com/guide/topics/manifest/supports-gl-texture-element.html) for further details on this node.
## References
[Such Android API Levels, Much Confuse. Wow.](http://redth.codes/such-android-api-levels-much-confuse-wow/) is a blog post by Redth going into more detail about setting the Android versions in a Xamarin project.
@@ -1,117 +0,0 @@
<?xml version="1.0"?>
<!--
MonoGame - Copyright (C) The MonoGame Team
This file is subject to the terms and conditions defined in
file 'LICENSE.txt', which is part of this source code package.
-->
<config xmlns="SharpDoc">
<title>MonoGame Documentation</title>
<style>MonoGame</style>
<output-dir>Output</output-dir>
<!-- Topics -->
<topic id="Welcome" page-id="main" name="MonoGame Documentation" filename="welcome.md">
<!-- Copy our images to the html/images folder -->
<resource>images</resource>
<topic id="Introduction" name="Introduction" filename="introduction.md">
<topic id="What_is_MonoGame" name="What is MonoGame" filename="what_is_monogame.md"/>
<topic id="System_Requirements" name="System Requirements" filename="system_requirements.md"/>
<topic id="Setting_Up_MonoGame" name="Setting Up MonoGame" filename="setting_up_monogame.md">
<topic id="Setting_Up_MonoGame_Windows" name="Windows" filename="setting_up_monogame_windows.md"/>
<topic id="Setting_Up_MonoGame_Mac" name="Mac" filename="setting_up_monogame_mac.md"/>
<topic id="Setting_Up_MonoGame_Linux" name="Linux" filename="setting_up_monogame_linux.md"/>
<topic id="Setting_Up_MonoGame_Source" name="From Source" filename="setting_up_monogame_source.md"/>
</topic>
<topic id="MonoGame_FAQ" name="MonoGame FAQ" filename="monogame_faq.md"/>
<topic id="Help_and_Support" name="Help and Support" filename="help_and_support.md"/>
</topic>
<topic id="Getting_Started" name="Getting Started" filename="getting_started/getting_started.md">
<topic id="creating_a_new_project" name="Creating a New Project" filename="getting_started/1_creating_a_new_project.md">
<topic id="creating_a_new_project_vs" name="Visual Studio" filename="getting_started/1_creating_a_new_project_vs.md"/>
<topic id="creating_a_new_project_md" name="MonoDevelop / Xamarin Studio" filename="getting_started/1_creating_a_new_project_md.md"/>
</topic>
<topic id="understanding_the_code" name="Understanding the Code" filename="getting_started/2_understanding_the_code.md"/>
<topic id="adding_content" name="Adding Content" filename="getting_started/3_adding_content.md"/>
<topic id="adding_basic_code" name="Adding Basic Code" filename="getting_started/4_adding_basic_code.md"/>
</topic>
<topic id="Tutorials" name="Tutorials" filename="tutorials.md"/>
<topic id="Adding_Art_Sounds_and_More" name="Adding Art, Sounds, and More" filename="content_intro.md">
<topic id="Using_The_Pipeline_Tool" name="Using The Pipeline Tool" filename="using_pipeline_tool.md"/>
<topic id="Custom_Effects" name="Custom Effects" filename="custom_effects.md"/>
<topic id="Using_TrueType_Fonts" name="Using TrueType Fonts" filename="adding_ttf_fonts.md"/>
<topic id="Localization" name="Localization" filename="localization.md" />
</topic>
<topic id="Tools" name="Tools" filename="tools.md">
<topic id="2MGFX" name="2MGFX" filename="2mgfx.md"/>
<topic id="MGCB" name="MGCB" filename="mgcb.md"/>
<topic id="Pipeline" name="Pipeline" filename="pipeline.md"/>
</topic>
<topic id="Platform_Specific_Notes" name="Platform-Specific Notes" filename="platform_specific.md">
<topic id="Android" name="Android" filename="android.md"/>
<topic id="tvOS" name="tvOS" filename="tvOS.md"/>
<topic id="UWP" name="UWP" filename="UWP.md"/>
</topic>
<topic id="External_Links" name="External Links" filename="links.md"/>
<topic id="Change_log" name="Change Log" filename="..\CHANGELOG.md"/>
<!-- Special topic X:ClassLibrary to include generated class library references. No filename to setup as it is generated -->
<topic id="X:ClassLibraryReference" page-id="api" name="Class Library Reference" index="100" on-url="true"/>
</topic>
<!-- List the assemblies to include for the class library-->
<!-- Windows Desktop -->
<group api="default|Windows DirectX Desktop">
<source>..\MonoGame.Framework\bin\Windows\AnyCPU\Release\MonoGame.Framework.dll</source>
<source>..\MonoGame.Framework.Content.Pipeline\bin\Windows\AnyCPU\Release\MonoGame.Framework.Content.Pipeline.dll</source>
</group>
<!-- Linux Desktop -->
<group api="linux|Linux Desktop">
<source>..\MonoGame.Framework\bin\Linux\AnyCPU\Release\MonoGame.Framework.dll</source>
<source>..\MonoGame.Framework.Content.Pipeline\bin\Linux\AnyCPU\Release\MonoGame.Framework.Content.Pipeline.dll</source>
</group>
<!-- MacOS Desktop -->
<!--
<group api="macos|MacOS Desktop">
<source>..\MonoGame.Framework\bin\MacOS\AnyCPU\Release\MonoGame.Framework.dll</source>
<source>..\MonoGame.Framework.Content.Pipeline\bin\MacOS\AnyCPU\Release\MonoGame.Framework.Content.Pipeline.dll</source>
</group>
-->
<!-- WindowsGL Desktop -->
<group api="wingl|Windows OpenGL Desktop">
<source>..\MonoGame.Framework\bin\WindowsGL\AnyCPU\Release\MonoGame.Framework.dll</source>
</group>
<!-- Web -->
<group api="web|Web">
<source>..\MonoGame.Framework\bin\Web\AnyCPU\Release\MonoGame.Framework.dll</source>
</group>
<!-- iOS -->
<!--
<group api="ios|iOS">
<source>..\MonoGame.Framework\bin\iOS\iPhoneSimulator\Release\MonoGame.Framework.dll</source>
</group>
-->
<!-- Android -->
<!--
<group api="android|Android">
<source>..\MonoGame.Framework\bin\Android\AnyCPU\Release\MonoGame.Framework.dll</source>
</group>
-->
</config>
@@ -1,12 +0,0 @@
A big part of your game is your content. This includes standard files like textures, sound effects, music, videos, and custom effects as well as custom content like level and enemy files.
MonoGame implements its own content pipeline for transforming your unoptimized assets into platform optimized content. This is critical in building a game which runs as fast as possible under tight resource constraints.
This section will cover the following topics:
- What is Game Content
- [Using The Pipeline Tool](using_pipeline_tool.md)
- [Using TrueType Fonts](adding_ttf_fonts.md)
- [Custom Effects](custom_effects.md)
- Custom Content Types
@@ -1,75 +0,0 @@
A core element of Microsoft XNA is the effect system which is used for all rendering.
For MonoGame we have the burden of supporting stock and custom effects for desktop GLSL, mobile GLSL, DirectX HLSL, and custom formats like that of the PlayStation Mobile. There currently is no effect system or shader language that supports all the platforms we require, forcing us to build a new custom effect system.
# MGFX
MGFX is MonoGame's own "FX" runtime and tools which with the following core goals:
* Support a similar technique, passes, shaders structure as Microsoft FX files.
* Have a textual format for ease of editing.
* Have a compiled and optimized binary format for runtime use.
* Be cross-platform and support multiple shader languages and bytecodes.
* Easy to extend for future platforms and features.
# Stock Effects
MonoGame has the following effects built-in and fully supported on current platforms:
* SpriteEffect
* BasicEffect
* AlphaTestEffect
* DualTextureEffect
* EnvironmentMapEffect
* SkinnedEffect
Under the hood these effects use the same system and tools as one would for a custom Effect. The source and pre-compiled versions of these effects can be found in the ['MonoGame.Framework\Graphics\Effect\Resources'](https://github.com/MonoGame/MonoGame/tree/develop/MonoGame.Framework/Graphics/Effect/Resources) folder.
If your game requires an extra little bit of performance you can easily hand edit the existing effects to remove unnecessary features or optimize for specific hardware and rebuild them with the MGFX tool.
# Custom Effects
To use a custom effect with MonoGame you must do one of the following (not both):
* Run the effect file through the [MonoGame Effect content processor](mgcb.md) for loading via the `ContentManager` (Recommended).
* Process your effect file with the [2MGFX tool](2mgfx.md) and load them yourself at runtime.
### Effect Writing Tips
These are some tips for writing or converting effects for use with MonoGame.
* The supported shader models when targeting DX are the following:
* `vs_4_0_level_9_1` and `ps_4_0_level_9_1`
* `vs_4_0_level_9_3` and `ps_4_0_level_9_3`
* `vs_4_0` and `ps_4_0` (requires `HiDef` `GraphicsProfile` at runtime)
* `vs_4_1` and `ps_4_1` (requires `HiDef` `GraphicsProfile` at runtime)
* `vs_5_0` and `ps_5_0` (requires `HiDef` `GraphicsProfile` at runtime)
* When targeting GL platforms we automatically translate FX files to GLSL using a library called [MojoShader](http://icculus.org/mojoshader/). The supported feature levels are the following:
* `vs_2_0` and `ps_2_0`
* `vs_3_0` and `ps_3_0`
* You can use preprocessor checks to add conditional code or compilation depending on defined symbols. MonoGame defines the following symbols when compiling effects:
* `2MGFX`
* `HLSL` and `SM4` for DirectX
* `OpenGL` and `GLSL` for OpenGL
As an example, you can conditionally set shader models depending on the platform with the following code:
```
#if OPENGL
#define VS_SHADERMODEL vs_3_0
#define PS_SHADERMODEL ps_3_0
#else
#define VS_SHADERMODEL vs_4_0_level_9_1
#define PS_SHADERMODEL ps_4_0_level_9_1
#endif
technique
{
pass
{
VertexShader = compile VS_SHADERMODEL MainVS();
PixelShader = compile PS_SHADERMODEL MainPS();
}
};
```
Custom symbols can be defined from the [Pipeline Tool](pipeline.md) or via [2MGFX](2mgfx.md).
* Make sure the pixel shaders inputs **exactly match** the vertex shader outputs so the parameters are passed in the correct registers. The parameters need to have the same size and order. Omitting parameters might not break compilation, but can cause unexpected results.
* Note that on GL platforms default values on Effect parameters do not work. Either set the parameter from code or use a real constant like a #define.
* The effect compiler is aggressive about removing unused parameters, be sure the parameters you are setting are actually used.
* Preshaders are not supported.
* If you think you've found a bug porting a shader [please let us know](https://github.com/MonoGame/MonoGame/issues).
@@ -1,3 +0,0 @@
This tutorial assumes that you have configured MonoGame correctly on your system, if you haven't, please read the [Setting Up MonoGame](setting_up_monogame.md).
Depending on the software you plan on using please follow either [Visual Studio](getting_started/1_creating_a_new_project_vs.md), or [VS for Mac / MonoDevelop](getting_started/1_creating_a_new_project_md.md) guide.
@@ -1,21 +0,0 @@
Start up MonoDevelop / Xamarin Studio and select **New...** in the upper left corner.
![New Solution](images/getting_started/1_new_soulution_md.png)
Now you should see a "New Project" dialog pop up. From here select **MonoGame > App** category, then select **MonoGame Cross Platform Desktop Project** and click **Next**.
![New Template](images/getting_started/1_template_dialog_md.png)
On the following dialog, type in the name that you wish to give your project. Do note that you should not use space character for it. For this tutorial, it will be named **ExampleGame**. After you've entered the name, click on the **Browse** button next to location text field, and select where you wish to save your project. Finally click **Create** to create a new project.
![New Project](images/getting_started/1_project_dialog_md.png)
If everything went correctly, you should see an **ExampleGame** project open up like in the picture bellow. To run your game simply press the big **Play Button** in the upper left corner or press **F5**.
![Run Game](images/getting_started/1_run_game_md.png)
You should now see your game window running.
![Game](images/getting_started/1_game_md.png)
Currently it's just clearing the surface with blue color. For further information on creating your game, please look at the [Understanding the Code](getting_started/2_understanding_the_code.md).
@@ -1,17 +0,0 @@
Start up Visual Studio and select **New Project...** in the upper left corner.
![New Solution](images/getting_started/1_new_soulution_vs.png)
Now you should see a "New Project" dialog pop up, from here select **Templates > Visual C# > MonoGame** category, and then select **MonoGame Cross Platform Desktop Project**. Next type in the name that you wish to give your project, for this tutorial let's just use **ExampleGame** (do note that you should not use space character for it). After you've entered the name, click on the **Browse** button next to the location text field, and select where you wish to save your project. Finally click **OK** to create a new project.
![New Template](images/getting_started/1_template_dialog_vs.png)
If everything went correctly, you should see an **ExampleGame** project open up like in the picture bellow. To run your game simply press the big **Play Button** in the toolbar or press **F5**.
![Run Game](images/getting_started/1_run_game_vs.png)
You should now see your game window running.
![Game](images/getting_started/1_game_vs.png)
Currently it's just clearing the surface with blue color. For further information on creating your game, please look at the [Understanding the Code](getting_started/2_understanding_the_code.md).
@@ -1,103 +0,0 @@
This file will go over the code that is getting created when you start a blank project. For help on creating a project please look at [Creating a New Project](getting_started/1_creating_a_new_project.md)
**Using Statements**
```csharp
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.Input;
```
These using statements are required in order to use the code that MonoGame has to offer.
The reason why they start with Microsoft.Xna.Framework is because MonoGame is an open source implementation of Microsoft Xna framework, and in order to maintain compatibility with the XNA code, it is using the same namespaces.
**The Game1 Class**
```csharp
public class Game1 : Game
```
The main Game1 class is inheriting from the Game class, which provides all the core methods for your game (ie. Load/Unload Content, Update, Draw etc.). You usually have only one Game class per game so its name isn't that important.
**Instanced Variables**
```csharp
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
```
The two default variables that the blank template starts with are GraphicsDeviceManager and SpriteBatch. Both of these variables are used for drawing stuff as you will see in a later tutorial.
**Constructor**
```csharp
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
```
The main game constructor is used to initialize the starting variables. In this case we are creating a new GraphicsDeviceManager from our game, and are setting the folder which the game will search for content.
**Initialize Method**
```csharp
protected override void Initialize()
{
// TODO: Add your initialization logic here
base.Initialize();
}
```
This method is called after the constructor, but before the main game loop(Update/Draw). This is where you can query any required services and load any non-graphic related content.
**LoadContent Method**
```csharp
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
}
```
This method is used to load your game content. It is called only once per game, after Initialize method, but before the main game loop methods.
**Update Method**
```csharp
protected override void Update(GameTime gameTime)
{
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
Exit();
// TODO: Add your update logic here
base.Update(gameTime);
}
```
This method is called multiple times per second, and is used to update your game state (checking for collisions, gathering input, playing audio, etc.).
**Draw Method**
```csharp
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
// TODO: Add your drawing code here
base.Draw(gameTime);
}
```
Similar to the Update method, it is also called multiple times per second.
For the next part, look at [Adding Content](getting_started/3_adding_content.md) page.
@@ -1,78 +0,0 @@
This file will go over adding content to your game. For help on creating a project please look at [Creating a New Project](getting_started/1_creating_a_new_project.md)
First of all you are gonna need some content for your game. For this tutorial use the following image of a ball:
![Open Content](images/getting_started/ball.png)
Do **right-click > Save Image As** and save it somewhere with the name "ball.png".
Now open up your game project and look at the left. You should see a solution explorer window. Expand the **Content** folder and open up **Content.mgcb** file by double clicking on it.
![Open Content](images/getting_started/3_open_content.png)
You should now see a MonoGame Pipeline Tool window open up. In case it didn't get opened, you can right-click on **Content.mgcb**, select **open with** and then select **MonoGame Pipeline**.
![MonoGame Pipeline Tool](images/getting_started/3_pipeline_tool.png)
Your game content is managed from this external tool. You can add content to your game in one of the following ways:
- **Add Existing Item** toolbar button
- **Edit > Add > Existing Item...** menu button
- **right-click > Add > Existing Item...** context menu
In our case let's use the **Add Existing Item** toolbar button.
![Add Content](images/getting_started/3_add_content.png)
You should now be prompted to select a file. Select the "ball.png" that you have downloaded a moment ago. After that you will be asked on what action you want to do for adding the file. Just leave the it to default and click **OK**.
![Copy Content](images/getting_started/3_copy_content.png)
Now simply click **Save** toolbar button and close the tool.
![Save Content](images/getting_started/3_save_content.png)
Now that we have added the content, it's time to load it. First declare a new variable so we can load the ball image into memory.
```csharp
public class Game1 : Game
{
Texture2D textureBall;
GraphicsDeviceManager graphics;
```
Next find the Load Content method and use it to initialize the ball private variable:
```csharp
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
textureBall = Content.Load<Texture2D>("ball");
}
```
And finally, find the Draw method, and let's draw the ball onto the screen:
```csharp
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
// TODO: Add your drawing code here
spriteBatch.Begin();
spriteBatch.Draw(textureBall, new Vector2(0, 0), Color.White);
spriteBatch.End();
base.Draw(gameTime);
}
```
Now run the game and you should get the following:
![Game](images/getting_started/3_game.png)
For the next part, look at [Adding Basic Code](getting_started/4_adding_basic_code.md) page.
@@ -1,111 +0,0 @@
This file will go over adding basic logic to your game. Do note that this file continues where [Adding Content](getting_started/3_adding_content.md) tutorial left off.
First of all we need to add few new variables, one for position, and one for speed.
```csharp
public class Game1 : Game
{
Texture2D ballTexture;
Vector2 ballPosition;
float ballSpeed;
```
Next let's initialize them. Find the **Initialize** method and add the following lines.
```csharp
// TODO: Add your initialization logic here
ballPosition = new Vector2(graphics.PreferredBackBufferWidth / 2,
graphics.PreferredBackBufferHeight / 2);
ballSpeed = 100f;
base.Initialize();
```
With this we are putting our ball starting position to the center of the screen. Last thing we need to do is modify the position that the ball is getting drawn to. Find **Draw** method and modify the Draw call to:
```csharp
spriteBatch.Draw(ballTexture, ballPosition, Color.White);
```
Now run the game.
![Draw Ball 1](images/getting_started/4_ball_not_center.png)
As you can see the ball doesn't seem quite centered yet. This is happening because MonoGame uses (0, 0) as the origin point for drawing by default. We can modify this by doing the following:
```csharp
spriteBatch.Draw(
ballTexture,
ballPosition,
null,
Color.White,
0f,
new Vector2(ballTexture.Width / 2, ballTexture.Height / 2),
Vector2.One,
SpriteEffects.None,
0f
);
```
With this we are setting the origin to the center of the image. Now the image will get drawn to the center of the screen.
![Draw Ball 2](images/getting_started/4_ball_center.png)
Next let's setup some movement. Find the **Update** method and add:
```csharp
// TODO: Add your update logic here
var kstate = Keyboard.GetState();
if (kstate.IsKeyDown(Keys.Up))
ballPosition.Y -= ballSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;
if(kstate.IsKeyDown(Keys.Down))
ballPosition.Y += ballSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;
if (kstate.IsKeyDown(Keys.Left))
ballPosition.X -= ballSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;
if(kstate.IsKeyDown(Keys.Right))
ballPosition.X += ballSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;
base.Update(gameTime);
```
Let's discuss the code a bit.
With this we are getting the current keyboard state and just putting it into a variable.
```csharp
var kstate = Keyboard.GetState();
```
Next is just a simple check to see if the Up arrow key is pressed.
```csharp
if (kstate.IsKeyDown(Keys.Up))
```
And last is a simple code for moving the ball by **ballSpeed**. The reason why **ballSpeed** is getting multiplied by **gameTime.ElapsedGameTime.TotalSeconds** is because Update is not usually fixed, that is the time between update calls is not the same, so in order to get smooth movement we multiple speed by the time since the last update method was called.
```csharp
ballPosition.Y -= ballSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;
```
The last 2 code parts repeat for Down, Left and Right arrow keys.
Run the game and you should be able to move the ball with the arrow keys. You will probably notice that you can get out of the window, so let's make it so that the ball can't escape the window. We will do this by setting bounds onto the ballPosition after it has already been moved.
```csharp
if(kstate.IsKeyDown(Keys.Right))
ballPosition.X += ballSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;
ballPosition.X = Math.Min(Math.Max(ballTexture.Width / 2, ballPosition.X), graphics.PreferredBackBufferWidth - ballTexture.Width / 2);
ballPosition.Y = Math.Min(Math.Max(ballTexture.Height / 2, ballPosition.Y), graphics.PreferredBackBufferHeight - ballTexture.Height / 2);
base.Update(gameTime);
```
Now run the game and the ball won't be able to escape window bounds anymore.
Happy Coding ^^
@@ -1,8 +0,0 @@
This section walks you through the basics of MonoGame and help you create your first game.
- [Creating a New Project](getting_started/1_creating_a_new_project.md)
- [Visual Studio](getting_started/1_creating_a_new_project_vs.md)
- [MonoDevelop / Xamarin Studio](getting_started/1_creating_a_new_project_md.md)
- [Understanding the Code](getting_started/2_understanding_the_code.md)
- [Adding Content](getting_started/3_adding_content.md)
- [Adding Basic Code](getting_started/4_adding_basic_code.md)
@@ -1,9 +0,0 @@
This section will provide help and support for MonoGame.
## Help
If you wish to learn how to use MonoGame, please checkout our [Tutorials page](tutorials.md). If you want to find an answer to a more specific problem, you can ask it on our [Community page](http://community.monogame.net/).
## Bugs and New Feature Requests
If you find a bug or have a feature request, [please open a new issue](https://github.com/mono/monogame/issues). Before opening any issue, please search for existing issues and read the [Issue Guidelines](https://github.com/necolas/issue-guidelines).
Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

@@ -1,10 +0,0 @@
This section will give you an overview of MonoGame including, what it contains, development requirements, setup instructions, and additional links for help and support.
This section will cover the following topics:
- [What is MonoGame](what_is_monogame.md)
- [System Requirements](system_requirements.md)
- [Setting Up MonoGame](setting_up_monogame.md)
- [Getting Started](getting_started/getting_started.md)
- [MonoGame FAQ](monogame_faq.md)
- [Help and Support](help_and_support.md)
@@ -1,9 +0,0 @@
Links to several useful reference sites related to MonoGame.
- [Microsoft XNA Documentation](http://msdn.microsoft.com/en-us/library/bb203940.aspx)
- [OpenGL 4.3 Reference Card](http://www.khronos.org/files/opengl43-quick-reference-card.pdf)
- [OpenGL ES 2.0 Reference Card](http://www.khronos.org/opengles/sdk/docs/reference_cards/OpenGL-ES-2_0-Reference-card.pdf)
- [WebGL Reference Card](http://www.khronos.org/files/webgl/webgl-reference-card-1_0.pdf)
- [Collada Specification](http://www.khronos.org/collada/)
- [Valve's Guide to Porting to Linux](https://developer.nvidia.com/sites/default/files/akamai/gamedev/docs/Porting%20Source%20to%20Linux.pdf)
@@ -1,150 +0,0 @@
Localization is an important part of any game. While it can be possible to design a
game that is region independent, its quite hard. At some point you will need to
produce localized text and graphics.
MonoGame has a simple localization system built in. If you want to develop your own
system you are still able to do so. But the default system should be good enough for
most use cases.
# Creating resx files.
MonoGame runs on .net/Mono on most platforms. Localization is handled by those platforms
via the use of resx files. There are walkthroughs on [MSDN](https://msdn.microsoft.com/en-us/library/aa992030(v=vs.100).aspx)
which walk you through the process. A simplified version is presented here.
Create a .resx file in the IDE e.g Foo.resx and add it to your game project. Note this needs to be added to the
main app projects. The Foo.resx file should have an Action of EmbeddedResouce and a Generator value of ResXFileCodeGenerator.
There is a snippet from the .csproj
```xml
<EmbeddedResource Include="Foo.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Foo.Designer.cs</LastGenOutput>
</EmbeddedResource>
```
Add any string resources to that file. These are in the form of a Key/Value pair. You can use the built in editor
or manually edit the .resx file by hand. Its an xml file so you can view the contents easily.
```xml
<data name="Wall_Style" xml:space="preserve">
<value>Wall Style : {0}</value>
</data>
```
What happens when the resx is processed by the generator and produces a Foo.Designer.cs file which is then
included in your project. You can then access the "string" value by using code as follows
```csharp
var s = MyProject.Foo.Wall_Style;
```
Note in the example we have a place holder ({0}) for additional text. You can still use te property of Foo.Wall_Style with
things like string.Format.
```csharp
int i = 1;
var s = string.Format (MyProject.Foo.Wall_Style, i);
```
All this means you dont need to hard the string directly. When accessing MyProject.Foo.Wall_Style the code will lookup the value from
the embedded resx file.
You can add support for a new language by adding a new resx file which uses the language/region code e.g Foo.de-DE.resx.
This new file will contain the translations for that language/region. In the example we are targetting German.
## Universal Windows Platform (UWP) considerations.
Unfortunately UWP does not support resx files anymore. They have a new file called resw. The format is similar but
incompatible. As a result you will need to duplicate the data into a set of resw files to get the to work on UWP. The
process is like the standrd resx process.
# Upgrading your SpriteFont files
By default the SpriteFont processor uses a limited set of characters to generate the font. While this is fine for english
languages it would probably not include special characters needed for other languages (French, Arabic, Korean etc).
As a result MonoGame has a LocalizedFontProcessor which does something slightly different. The process looks at the resx
files you provide it with and generates an optimized spritefont which only contains the characters your game uses.
To make use of this functionality you ned to tell the spritefont which resx files to use. Open the .spritefont with a
xml/text editor and add lines like this inside the Asset node
```xml
<ResourceFiles>
<Resx>..\Foo.resx</Resx>
<Resx>..\Foo.de-DE.resx</Resx>
</ResourceFiles>
```
Note the paths are relative to the .spritefont directory. In the example above the resx files are in the directory
above the .spritefont.
You should end up with a .spritefont file like this
```xml
<?xml version="1.0" encoding="utf-8"?>
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="Graphics:FontDescription">
<FontName>Verdana</FontName>
<Size>14</Size>
<Spacing>1</Spacing>
<Style>Regular</Style>
<CharacterRegions>
<CharacterRegion>
<Start>&#32;</Start>
<End>&#32;</End>
</CharacterRegion>
</CharacterRegions>
<ResourceFiles>
<Resx>..\Foo.resx</Resx>
<Resx>..\Foo.de-DE.resx</Resx>
</ResourceFiles>
</Asset>
</XnaContent>
```
Once that is done you then need to change the .mgcb file so that the SpriteFontProcessor is replaced with
the LocalizedFontProcessor. This can be done by editing the .mgcb file or using the Pipeline tool. After
that you can just compile your content as normal. If the processor has any trouble resolving or reading the
resx files you will get an error.
# Loading the Font
Loading the font can be done in the normal way. The end result of the process is a .xnb file containing a normal
SpriteFont.
```csharp
var font = Content.Load<SpriteFont>("Foo");
```
# Other Localized assets
Not all localized assets will be fonts. In certain situtions you might need to swap out an entire texture or spritesheet.
For these cases a new method has been added to the ContentManager, LoadLocalized. The idea behind this method is that it will
look for localized files BEFORE loading the default one.
So for example say you have an asset, MyCharacter. You have a MyCharacter.xnb file which contains the data for that item. You
can also has a MyCharacter.de-DE.xnb file which contains the German version of that asset. This asset could be a Texture, Audio
or any other game asset. You can then use LoadLocalized to load the localized version of the asset.
```csharp
var myCharacter = Content.LoadLocalized<Texture2D>("MyCharacter");
```
The decision on which localized asset to load is made by looking for a file with the following patterns
```xml
<AssetName>.<CurrentCulture.Name>
<AssetName>.<CurrentCulture.TwoLetterISOLanguageName>
```
These values are retrieved from
```csharp
CultureInfo.CurrentCulture.Name // eg. "en-US"
CultureInfo.CurrentCulture.TwoLetterISOLanguageName // eg. "en"
```
which are part of the System.Globalization namespace. On a side note you can also use the `LoadLocalized` to load language
specific SpriteFonts. They just need to be named in the same way as we have described above.
@@ -1,194 +0,0 @@
The MonoGame Content Builder (MGCB.exe) is a command line tool for building XNB content on Windows, Mac, and Linux desktop systems.
Typically it is executed by the [Pipeline GUI tool](pipeline.md) when editing content or indirectly from VisualStudio or MonoDevelop during the build process of a MonoGame project. Alternatively you can use it yourself from the command line for specialized build pipelines or for debugging content processing.
## Command Line Options
The options are processed "left to right". When an option is repeated the last option always wins.
### Output Directory
```
/outputDir:<directory_path>
```
It specifies the directory where all content is written. If this option is omitted the output will be put into the current working directory.
### Intermediate Directory
```
/intermediateDir:<directory_path>
```
It specifies the directory where all intermediate files are written. If this option is omitted the intermediate data will be put into the current working directory.
### Rebuild Content
```
/rebuild
```
An optional parameter which forces a full rebuild of all content.
### Clean Content
```
/clean
```
Delete all previously built content and intermediate files. Only the `/intermediateDir` and `/outputDir` need to be defined for clean to do its job.
### Incremental Build
```
/incremental
```
Skip cleaning files not included in the current build. Useful for custom tools which only require a subset of the game content built.
### Assembly Reference
```
/reference:<assembly_path>
```
An optional parameter which adds an assembly reference which contains importers, processors, or writers needed during content building.
### Target Platform
```
/platform:<target_Platform>
```
Set the target platform for this build. It must be a member of the TargetPlatform enum:
* Windows
* iOS
* Android
* DesktopGL
* MacOSX
* WindowsStoreApp
* NativeClient
* PlayStation4
* WindowsPhone8
* RaspberryPi
* PSVita
* XboxOne
* Switch
If not set it will default to Windows.
NOTE: PlayStation 4, Xbox One, PS Vita, and Switch support is only available to licensed console developers.
### Target Graphics Profile
```
/profile:<graphics_Profile>
```
Set the target graphics profile for this build. It must be a member of the GraphicsProfile enum:
* HiDef
* Reach
If not set it will default to HiDef.
### Target Build Configuration
```
/config:<build_config>
```
The optional build configuration name from the build system. This is sometimes used as a hint in content processors.
### Content Compression
```
/compress
```
Uses LZ4 compression to compress the contents of the XNB files. Content build times will increase with this option enabled. Compression is not recommended for platforms such as Android, Windows Phone 8 and Windows 8 as the app package is already compressed. This is not compatible with LZX compression used in XNA content.
### Content Importer Name
```
/importer:<class_name>
```
An optional parameter which defines the class name of the content importer for reading source content. If the option is omitted or used without a class name the default content importer for the source type is used.
### Content Processor Name
```
/processor:<class_name>
```
An optional parameter which defines the class name of the content processor for processing imported content. If the option is omitted used without a class name the default content processor for the imported content is used.
Note that when you change the processor all previously defined `/processorParam` are cleared.
### Content Processor Parameter
```
/processorParam:<name>=<value>
```
An optional parameter which defines a parameter name and value to set on a content processor.
Note all defined processor parameters are cleared when the `/processor` is set.
### Build Content File
```
/build:<content_filepath>
/build:<content_filepath>;<destination_filepath>
```
Instructs the content builder to build the specified content file using the previously set switches and options. Optional destination path may be specified if you want to change the output filepath.
### Response File
```
/@:<response_filepath>
```
This defines a text response file (sometimes called a command file) that contains the same options and switches you would normally find on the command line.
Each switch is specified on a new line. Comment lines are prefixed with #. You can specify multiple response files or mix normal command line switches with response files.
An example response file could look like this:
```
# Directories
/outputDir:bin/foo
/intermediateDir:obj/foo
/rebuild
# Build a texture
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyEnabled=false
/build:Textures\wood.png
/build:Textures\metal.png
/build:Textures\plastic.png
```
### Launch Debugger
```
/launchdebugger
```
Allows a debugger to attach to the MGCB executable before content is built.
### Define Preprocessor Parameter
```
/define <name>=<value>
```
Sets or creates a preprocessor parameter with the given name and value.
### Preprocessor Macros
```
$if <name>=<value>
$endif
```
Preprocessor macros are intended to allow conditionals within a response file.
The preprocess step is what expands a response file command into its composite commands for each line in the file. However, a line is only emitted if all conditionals which contain the line evaluate true.
```
<example command line>
MGCB.exe /define:BuildEffects=No /@:example.mgcb
<example.mgcb file>
$if BuildEffects=Yes
/importer:EffectImporter
/processor:EffectProcessor
/build:Effects\custom.fx
# all other effects here....
$endif
```
### Customizing your Build Process
When building content from your project via `msbuild` there are a few ways to can hook into the build process. The `MonoGame.Content.Builder.targets` runs a target called
`BuildContent` just before your project builds. If you want to do any processing before or after this process you can use the `BeforeTargets` and `AfterTargets` mechanism provided
by `msbuild` to run your own targest.
```
<Target Name="MyBeforeTarget" BeforeTargets="BuildContent">
<Message Text="MyBeforeTarget Ran"/>
</Target>
<Target Name="MyAfterTarget" AfterTargets="BuildContent">
<Message Text="MyAfterTarget Ran"/>
</Target>
```
If you want to customise the arguements sent to the `MGCB.exe` as part of the build process you can use the `<MonoGameMGCBAdditionalArguments>` property to define those.
For example if you wanted to pass in the current project configuration you could define
```
<MonoGameMGCBAdditionalArguments>-config:$(Configuration)</MonoGameMGCBAdditionalArguments>
```
@@ -1,11 +0,0 @@
This page contains a list of frequently asked questions.
### What software do I need to start?
Depending on the platform you wish to develop for the following thing are needed:
- Android: [Xamarin.Android](https://docs.microsoft.com/en-us/xamarin/android/)
- iOS: [Xamarin.iOS](https://docs.microsoft.com/en-us/xamarin/ios/)
The linked pages will guide you through the setup process.
@@ -1,23 +0,0 @@
The MonoGame Pipeline Tool (Pipeline.exe) is the front-end GUI editor for MonoGame content builder projects.
<p align="center">
<img src="images/pipeline.png"/>
</p>
The Pipeline Tool has the following features:
* Create, open, and save MGCB projects.
* Import existing XNA .contentproj.
* Tree view showing content of project.
* Property grid for editing content settings.
* Full undo/redo support.
* Build, rebuild, and clean the project.
* Rebuild selected items.
* Create new content like fonts and xml.
* Support for custom importers/processors/writers.
* Template format for adding new custom content types.
The Pipeline Tool is included in the SDK installation.
[Read detailed documentation](using_pipeline_tool.md)
@@ -1,5 +0,0 @@
While MonoGame aims to provide a platform-agnostic framework for developing games and apps, there are still some specific for each platform that need the developer needs to be aware of. This section lists those specifics broken down by platform.
- [Android](android.md)
- [tvOS](tvOS.md)
- [Windows Universal Platform (UWP)](UWP.md)
@@ -1,6 +0,0 @@
This section will help you setup MonoGame on Platform of your choice. Please select the platform you wish to develop from:
- [Windows](setting_up_monogame_windows.md)
- [Mac](setting_up_monogame_mac.md)
- [Linux](setting_up_monogame_linux.md)
- [Building from source](setting_up_monogame_source.md)
@@ -1,30 +0,0 @@
This section will help you setup MonoGame on Linux.
### Running MonoGame Applications
The following packages are needed for the MonoGame Applications to run on Linux:
* libopenal-dev
* mono-runtime
For Ubuntu/Debian based Linux systems, you can run:
```
sudo apt-get install libopenal-dev mono-runtime
```
### Developing MonoGame Applications
* Go to [MonoGame Downloads page](http://www.monogame.net/downloads/)
* Download MonoGame for Linux
* Open up terminal and type in:
```
cd Downloads
chmod +x monogame-sdk.run
sudo ./monogame-sdk.run
```
* During the installation process the installer will give you the following list of dependencies, please make sure they are installed:
* monodevelop ([http://www.monodevelop.com/download/](http://www.monodevelop.com/download/))
* libopenal-dev
* gtk-sharp3
* referenceassemblies-pcl (needed to use PCL template)
* ttf-mscorefonts-installer (recommended, but not needed)
* That's it, MonoGame SDK is installed
@@ -1,34 +0,0 @@
This section will help you setup MonoGame on Mac OSX.
### Running MonoGame Applications
### Developing MonoGame Applications
Developing on the Mac requires a number of other frameworks and applications.
To get started you can use the Linux or DesktopGL platforms which will run quite happily
on MacOS providing you have mono installed.
So to get setup you will first need to install mono.
* Go to [Mono Downloads page](http://www.mono-project.com/download/)
* Download the latest Mac OS installer.
Note: If you are running El Capitan you will need to install the very latest mono otherwise things
will not work correctly.
You will also need Visual Studio for Mac
* Go to the [Visual Studio for Mac website](https://visualstudio.microsoft.com/vs/mac/)
* Download the installer.
This will install Visual Studio for Mac (which is free).
To setup MonoGame application development on mac OSX do the following:
* Go to [MonoGame Downloads page](http://www.monogame.net/downloads/)
* Click on the newest MonoGame release
* Download MonoGame for Mac
* Open the .pkg
* You will probably get an error about signing. If you do , right click and Open the .pkg file and you will be able to continue
* That's it, MonoGame is installed.
Make sure you install mono and Visual Studio for Mac first so that MonoGame can correctly setup the
project templates and addins.
@@ -1,40 +0,0 @@
This section will help you setup MonoGame by building it from source code.
### Prerequisites
Install the tools for the system you are building from:
* Windows:
* [Git for Windows](https://git-scm.com/download/win)
* [Visual Studio](https://www.visualstudio.com/)
* [Xamarin.Android](https://www.xamarin.com/download) (Optional)
* [Windows Phone 8 SDK](https://www.microsoft.com/en-us/download/details.aspx?id=35471) (Optional)
* Mac:
* [Git](https://git-scm.com/download/mac)
* [Xamarin Studio](https://store.xamarin.com/)
* Xamarin.Android and Xamarin.iOS can be installed with the Xamarin Studio installer (Optional)
* Linux:
* [Git](https://git-scm.com/download/linux)
* [Monodevelop](http://www.monodevelop.com/download/linux/)
### Getting the source code
Start up a Terminal (Mac/Linux) or Git Bash (Windows) and clone the MonoGame repository:
```
git clone https://github.com/MonoGame/MonoGame.git
cd MonoGame
git submodule init
git submodule update
```
### Building from source
MonoGame uses [Protobuild](https://protobuild.org/) to generate project and solution files. Protobuild.exe will be in your MonoGame folder. To run Protobuild:
- On Windows run Protobuild.exe either by double-clicking or by executing it from the command line.
- On Mac/Linux open a terminal and run `mono Protobuild.exe` in the MonoGame folder.
Once the project and solution files are generated you can build them with the IDE you installed.
### Referencing the projects
First get the MonoGame SDK from the [downloads page](http://www.monogame.net/downloads/) and install it to get the IDE templates. Start up the IDE you have installed and create a new project from one of the templates. Click Add > Existing Project... on your solution and select the MonoGame.Framework project that matches the template (i.e. MonoGame.Framework.Windows.csproj for a MonoGame Windows project template). The project files are located in MonoGame/MonoGame.Framework. Delete the existing MonoGame.Framework reference and add a reference to the added project by clicking Add Reference... > Projects and selecting the project. You can run your game now. If you make changes to the MonoGame.Framework project it will automatically rebuild when running your game.
@@ -1,20 +0,0 @@
This section will help you setup MonoGame on Windows.
### Developing MonoGame Applications
You will need an IDE to develop MonoGame applications, the most common on Windows is Visual Studio.
* Go to the [Visual Studio website](https://visualstudio.microsoft.com/)
* Download a Visual Studio IDE, the Community edition is free for personal use.
* Run the installer and complete the installation.
Visual Studio is an IDE used to develop applications in, among other languages, C#. C# is the most common language used in MonoGame development.
After installing Visual Studio, do the following:
* Go to [MonoGame Downloads page](http://www.monogame.net/downloads/)
* Click on the newest MonoGame release
* Download MonoGame for Visual Studio
* Run the installer
* You will probably get an error from Windows Defender due to the install file not being digitally signed. If you do, click "More info" and then "Run anyway" to continue the installation.
* That's it, MonoGame is installed.
You are now ready to develop MonoGame applications using Visual Studio. The next time you open Visual Studio you will find a list of MonoGame template projects ready to use.
@@ -1,16 +0,0 @@
This section will give you an overview of minimal system requirements for developing and running MonoGame Applications.
### Development
* Windows -
* Linux - 1 GB Ram
* Mac -
### Running MonoGame Application on specific Platform
* WindowsDX - DirectX 9.0c capable gpu
* WindowsGL -
* Linux - 512 MB Ram
* Mac -
* Android - Android 4.2 or higher
* iOS -
* Windows Phone - Windows Phone 10
@@ -1,4 +0,0 @@
This section explains the various command line tools that are part of MonoGame.
- [2MGFX](2mgfx.md) is used to compile stand alone effects.
- [MGCB](mgcb.md) is used to build content pipeline content.
@@ -1,50 +0,0 @@
Links to various tutorials and articles to help you get started with MonoGame.
### RB Whitaker's MonoGame Tutorials
- [1 - C# Crash Course](http://rbwhitaker.wikidot.com/c-sharp-tutorials)
- [2 - Getting started](http://rbwhitaker.wikidot.com/monogame-getting-started-tutorials)
- [3 - 2D tutorials](http://rbwhitaker.wikidot.com/monogame-2d-tutorials)
- [4 - 3D tutorials](http://rbwhitaker.wikidot.com/monogame-3d-tutorials)
- [Extra - XNA tutorials](http://rbwhitaker.wikidot.com/xna-tutorials)
### Microsoft
Tara Walker's "Building a Shooter Game" tutorial series.
- [Part 1: Overview, Installation, MonoGame 3.0 Project Creation](http://blogs.msdn.com/b/tarawalker/archive/2012/12/04/windows-8-game-development-using-c-xna-and-monogame-3-0-building-a-shooter-game-walkthrough-part-1-overview-installation-monogame-3-0-project-creation.aspx)
- [Part 2: Creating the Shooter/Player Asset of the Game](http://blogs.msdn.com/b/tarawalker/archive/2012/12/10/windows-8-game-development-using-c-xna-and-monogame-3-0-building-a-shooter-game-walkthrough-part-2-creating-the-shooter-player-asset-of-the-game.aspx)
- [Part 3: Updating Graphics using Content Pipeline with MonoGame](http://blogs.msdn.com/b/tarawalker/archive/2013/01/04/windows-8-game-development-using-c-xna-and-monogame-3-0-building-a-shooter-game-walkthrough-part-3-updating-graphics-using-content-pipeline-with-monogame.aspx)
- [Part 4: Adding and Processing Player (User) Input](http://blogs.msdn.com/b/tarawalker/archive/2013/02/23/windows-8-game-development-using-c-xna-and-monogame-3-0-building-a-shooter-game-walkthrough-part-4-adding-and-processing-player-user-input.aspx)
- [Part 5: Animating the Player/Ship and Creating a Parallaxing Background](http://blogs.msdn.com/b/tarawalker/archive/2013/04/12/windows-8-game-development-using-c-xna-and-monogame-3-0-building-a-shooter-game-walkthrough-part-5-animating-the-player-ship-and-creating-a-parallaxing-background.aspx)
- [Part 6: Creating Enemies and Detecting Collisions](http://blogs.msdn.com/b/tarawalker/archive/2013/08/26/windows-8-game-development-using-c-xna-and-monogame-3-0-building-a-shooter-game-walkthrough-part-6-creating-enemies-and-detecting-collisions.aspx)
- [Part 7: Creating Projectiles and Detecting Collisions](http://chrisongames.blogspot.com/2014/12/windows-8-game-development-using-c-xna.html)
- [Part 8: Creating Explosions using Sprite Animations](http://chrisongames.blogspot.com/2015/02/windows-8-game-development-using-c-xna.html)
- [Part 9: Adding Sound Effects and Game Music](http://chrisongames.blogspot.com/2015/12/windows-810-game-development-using-c.html)
### Neil Danson's F# series
- [Part 1 - MacOS](http://neildanson.wordpress.com/2013/07/30/f-and-monogame/)
- [Part 2 - Android](http://neildanson.wordpress.com/2013/07/31/f-and-monogame-part-2-android/)
- [Part 3 - iOS](http://neildanson.wordpress.com/2013/07/31/f-and-monogame-part-3-ios/)
- [Part 4 - Content Pipeline](http://neildanson.wordpress.com/2013/08/13/f-and-monogame-part-4-content-pipeline/)
### Others
- [How to create animations and sprite sheets for MonoGame](https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-and-animations-with-monogame)
- [Making a platformer in F# with MonoGame](http://bruinbrown.wordpress.com/2013/10/06/making-a-platformer-in-f-with-monogame/)
- [XNA 4.0 Shader Programming / HLSL](http://digitalerr0r.wordpress.com/tutorials/)
- [Using Spine with MonoGame - by Randolph Burt (Randeroo)](http://randolphburt.co.uk/2013/03/30/dragons-and-dancing-crabs/)
- [Mac porting series](http://benkane.wordpress.com/2012/01/20/the-great-porting-adventure-day-8/)
- [Porting a Windows Phone 7 Game to Android](http://warrenburch.blogspot.co.uk/2011/12/porting-windows-phone-7-game-to-android.html)
- [A series on embedding MonoGame/WinGL into WinForms](http://jaquadro.com/2013/03/bringing-your-xna-winforms-controls-to-monogame-opengl/)
- [French articles about MonoGame on Linux, Windows and Windows 8](http://www.demonixis.net/blog/category/tutoriels/tuto-xna/)
- [Dark Genesis Blog](http://darkgenesis.zenithmoon.com/tag/monogame/)
- [MonoGame "Hello World" on Mac OS X and Xamarin Studio](http://jaquadro.com/2013/09/monogame-hello-world-on-mac-os-x-and-xamarin-studio/)
- [Solving Resolution Independent Rendering And 2D Camera Using Monogame](http://blog.roboblob.com/2013/07/27/solving-resolution-independent-rendering-and-2d-camera-using-monogame/)
- [XNA is Dead; Long Live the New XNA, MonoGame](http://www.codemag.com/Article/1411081)
- [Make Santa Jump - Making an endless runner game in F# using MonoGame](http://timjones.tw/blog/archive/2014/12/28/make-santa-jump-game-in-fsharp-using-monogame)
- [Running MonoGame on Android Wear](http://crossplatform.io/running-monogame-on-android-wear/)
## Video Tutorials
- [CodingMadeEasy RPG Tutorial](http://www.youtube.com/watch?feature=player_embedded&v=agt9-J9RPZ0)
- [Psuedo Games Tutorials](http://www.youtube.com/watch?feature=player_embedded&v=BwtQn02oy6A)
- [Desenvolvendo jogos multiplataforma em C# com MonoGame - Alexandre Chohfi (Portuguese)](http://channel9.msdn.com/Blogs/MSDN-Brasil-Cursos-de-Desenvolvimento/Desenvolvendo-jogos-multiplataforma-em-C-com-MonoGame)
- [Desenvolvimento de jogos para Windows 8 com XNA - Alexandre Chohfi (Portuguese)](https://www.youtube.com/watch?v=gM5pRnYV1tA)
@@ -1,53 +0,0 @@
## Menu Button Handling
The Menu button will map to the "Back" button on the GamePad. However on tvOS,
the Menu button requires some special processing. According to the Apple
documentation the Menu Button
"*Pauses/resumes gameplay.
Returns to previous screen, exits to main game menu, and/or exits to Apple TV Home screen.*"
By default MonoGame will exit to the Apple TV Home screen when the Menu button is pressed,
this is not alawys the desired behviour. When in gameplay the Menu button really should
Pause the game rather than Exiting to the Home screen.
Because MonoGame has no idea of the game state, it is down to the developer to inform
it when it can exit to the Home screen and when it should ignore the Menu event and allow
the developer to the event.
Some sample code.
```csharp
public class Game1 : Game, IPlaformBackButton
{
private bool _isOnRootMenu = true;
public bool Handled()
{
return !_isOnRootMenu;
}
public Game1()
{
Services.AddService<IPlaformBackButton>(this);
}
public override Update(GameTime gametime)
{
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
{
// do something in game
}
}
}
```
The key to this working is the `IPlatformBackButton` interface. By implementing
and registering this interface MonoGame can callback into your application to ask if it
should let you handle the Menu button or if it should pass it up to tvOS. So in this case if
the app is on the "Main menu" the developer will set *IsOnRootMenu* to true and when the Menu
button is pressed the game with Exit. However if IsOnRootMenu is false then the "Menu" button
click will be routed to the GamePad Back button and the developer can check for the Back button
press and act accordingly.
@@ -1,110 +0,0 @@
The [Pipeline Tool](pipeline.md) is used to organize and build content for use with MonoGame. It is installed as part of the MonoGame SDK Installer or can be built [directly from source](https://github.com/mono/MonoGame/tree/develop/Tools/Pipeline) if needed.
## Create A Project
To start a new project just select "New..." from the "File" menu. This will give you a new empty project to add content to.
If you are starting from an existing XNA project, the Pipeline Tool supports importing your existing .contentproj. Again you can access this from the the "File" menu:
<p align="center">
<img src="images/pipeline_import.png"/>
</p>
This creates a new project, adding all your content and content settings from the XNA project. If you happened to be using custom processors you may need to edit the assembly references to link to the correct paths which we discuss next.
## Project Settings
You can edit the content project settings directly from the property grid editor after selecting the project node in the tree view:
<p align="center">
<img src="images/pipeline_project.png"/>
</p>
This is where you setup the folders for output, the platform to target, the assembly references for custom processors, etc.
Note that currently the Pipeline tool is not setup to support multiple target platforms. This means you may need to manage mutliple content projects or manually change the target platform between builds. We are working on adding functionaliy to support multiple platforms and configurations within a single project.
## Adding Content Items
Once you have a project setup you can add content to it for building. You can do this from the "Edit" menu:
<p align="center">
<img src="images/pipeline_items.png"/>
</p>
Selecting "New Item..." will bring up the New Item dialog which displays a list of new items that can be created:
<p align="center">
<img src="images/pipeline_newitem.png"/>
</p>
When you select "Existing Item..." you get to select an existing item from disk to add to the content project.
## Custom Content Processors
Just like XNA, the MonoGame content pipeline supports custom content processors. To use them you need to rebuild them correctly to work against MonoGame.
The first step is removing all `Microsoft.Xna.Framework.XXX` references and replacing them with references to `MonoGame.Framework` and `MonoGame.Framework.Content.Pipeline`. This is required as you will no longer be building against Microsoft XNA.
Once you references are working you then need to change your assembly target platform. MonoGame does not support x86 (aka 32bit) assemblies in the content pipeline. This is mainly to allow of processing really big content as well as to simplify the number of configurations and native code dependancies. For this reason you should try to target "Any CPU" with your custom content assembly.
After you have done these fixes you should be able to add these new processors to the content project "References".
## Building Content
The Pipeline Tool has 3 actions related to building content: Build, Rebuild and Clean. Build will build all content that needs to be built and put the xnb's in the output directory (bin by default). Content will be skipped if it hasn't changed since the last build. The time source content was last edited is saved in the intermediate directory (obj by default) to determine if content changed since the last build. Clean will empty the output and intermediate directories. Rebuild will first Clean and then Build.
## Linking Content To Your Game
Once you have built your content you have a few different ways to add the xnb's to your game project. They all have the same goal, to get the built xnb's in your project output folder so a ContentManager can easily find and load them.
### MonoGameContentReference
The simplest method is to setup your game project from one of the templates that come with the SDK. When you create a new project it will include a Content.mgcb file with its Build Action set to MonoGameContentReference. This build action is defined in the .targets file [here](https://github.com/MonoGame/MonoGame/blob/develop/MonoGame.Framework.Content.Pipeline/MonoGame.Content.Builder.targets). MonoGameContentReference is set up so that when the project is built, the mgcb will build any new/modified content and copy the resulting xnb's to the project output directory so they can be used in the project. Note that this way you don't even have to manually build the content with the Pipeline Tool. Just add your content to the .mgcb with the Pipeline Tool and the rest will happen when you build your project. The content files do not need to be added to your project.
### Manual Copy
If you don't want to use the automated process, you can build the content project with the Pipeline Tool and copy the xnb's to the output folder of your project manually.
### Add As Content
If you are using Visual Studio you can simply add the xnb files to your C# game project. Create a folder in the project called Content then right click on the folder and select Add -> Existing Item.
<p align="center">
<img src="images/existing_item.png"/>
</p>
You will now see a file dialog from which you can add your content files. Note that if you don't want Visual Studio to make a local copy of the files be sure to use "Add As Link".
<p align="center">
<img src="images/add_as_link.png"/>
</p>
Once the files are added you need to select them all and change their build action to "Content" and "Copy if newer".
<p align="center">
<img src="images/copy_if_newer.png"/>
</p>
### Add With Wildcard
The more automatic option is to hand edit your game .csproj and have it include you content using wildcards. To do this just open the .csproj with any text editor then add the following after any other `<ItemGroup>`:
```
<ItemGroup>
<Content Include="Content\**\*.*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
```
Then any files you put in a Content folder within your game project will automatically be included in the build.
## Reporting Bugs
If you run into any problems with MGCB or the Pipeline Tool, please ask for help on the [community site](http://community.monogame.net/) or submit a [bug report on GitHub](https://github.com/MonoGame/MonoGame/issues).
@@ -1,16 +0,0 @@
Welcome to the MonoGame game library documentation hub.
This area of the site contains the documentation on the API of MonoGame as well as how to use it to create great games.
Note that this is a work in progress so there will be gaps in the documentation coverage.
If you cannot find what you need here you can also look at the [Microsoft XNA documentation](https://msdn.microsoft.com/en-us/library/bb200104.aspx). MonoGame is API compatible
with [XNA](https://msdn.microsoft.com/en-us/library/bb203940.aspx) even down to the namespaces. So usually what works for XNA will work for MonoGame too.
Note that this documentation hub is built from the source code on every commit to the development branch. As such
it applies to the development builds available on the [Downloads](http://www.monogame.net/downloads) page. This may include new features which may
not be available in the current stable release
### We Need Your Help!
Truly great open source projects require high quality documentation. This is call for volunteers to help us make the MonoGame documentation truly great. If you can help write tutorials, guides, code snippets, reference docs, video walkthroughs or just any improvement to our current documentation we could use your help!
Check out the [README on GitHub](https://github.com/mono/MonoGame/blob/develop/Documentation/README.md) or [talk with us on the community site](http://community.monogame.net/t/lets-improve-the-monogame-documentation/916) to learn how to help!
@@ -1,25 +0,0 @@
MonoGame is an Open Source implementation of the Microsoft XNA 4 Framework. Our goal is to allow people to make great games using a simple API.
The currently supported platforms are as follows.
* Desktop PCs
* Windows 10 Store Apps (UWP)
* Windows Win32 (OpenGL & DirectX)
* Linux (OpenGL)
* Mac OS X (OpenGL)
* Mobile/Tablet Devices
* Android (OpenGL)
* iPhone/iPad (OpenGL)
* Windows Phone 10
* Television
* tvOS
MonoGame also supports a number of Game Consoles. The templates and source for these platforms
are not publicly availalbe. However they are available to developers registered with the appropriate
developer programs.
* Consoles (for registered developers)
* PlayStation 4 (Sony)
* PlayStation Vita (Sony)
* Xbox One (both UWP and XDK) (id@xbox)
* Nintendo Switch (Nintendo)
@@ -1,44 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.MonoGame.Core", "MonoDevelop.MonoGame.Core\MonoDevelop.MonoGame.Core.csproj", "{3FE5AAE8-BE24-4FC3-AF86-2AA3C3CD8DB4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.MonoGame", "MonoDevelop.MonoGame\MonoDevelop.MonoGame.csproj", "{B2C75BDF-A022-41C6-9618-EDD8BEE76556}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.MonoGame.Android", "MonoDevelop.MonoGame.Android\MonoDevelop.MonoGame.Android.csproj", "{FB8E0F6F-522F-4C22-A2F2-1097EB549FE5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.MonoGame.iOS", "MonoDevelop.MonoGame.iOS\MonoDevelop.MonoGame.iOS.csproj", "{B2150BB5-02A0-4CD7-A61F-C17C09045D1D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.MonoGame.Mac", "MonoDevelop.MonoGame.Mac\MonoDevelop.MonoGame.Mac.csproj", "{08E68315-4124-4199-BBD9-E57282458A31}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{08E68315-4124-4199-BBD9-E57282458A31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{08E68315-4124-4199-BBD9-E57282458A31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{08E68315-4124-4199-BBD9-E57282458A31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{08E68315-4124-4199-BBD9-E57282458A31}.Release|Any CPU.Build.0 = Release|Any CPU
{3FE5AAE8-BE24-4FC3-AF86-2AA3C3CD8DB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3FE5AAE8-BE24-4FC3-AF86-2AA3C3CD8DB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FE5AAE8-BE24-4FC3-AF86-2AA3C3CD8DB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3FE5AAE8-BE24-4FC3-AF86-2AA3C3CD8DB4}.Release|Any CPU.Build.0 = Release|Any CPU
{B2150BB5-02A0-4CD7-A61F-C17C09045D1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2150BB5-02A0-4CD7-A61F-C17C09045D1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2150BB5-02A0-4CD7-A61F-C17C09045D1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2150BB5-02A0-4CD7-A61F-C17C09045D1D}.Release|Any CPU.Build.0 = Release|Any CPU
{B2C75BDF-A022-41C6-9618-EDD8BEE76556}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2C75BDF-A022-41C6-9618-EDD8BEE76556}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2C75BDF-A022-41C6-9618-EDD8BEE76556}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2C75BDF-A022-41C6-9618-EDD8BEE76556}.Release|Any CPU.Build.0 = Release|Any CPU
{FB8E0F6F-522F-4C22-A2F2-1097EB549FE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FB8E0F6F-522F-4C22-A2F2-1097EB549FE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB8E0F6F-522F-4C22-A2F2-1097EB549FE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB8E0F6F-522F-4C22-A2F2-1097EB549FE5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = ..\MonoDevelop.MonoGame\MonoDevelop.MonoGame.csproj
EndGlobalSection
EndGlobal
@@ -1,110 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{FB8E0F6F-522F-4C22-A2F2-1097EB549FE5}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>MonoDevelop.MonoGame.Android</RootNamespace>
<AssemblyName>MonoDevelop.MonoGame.Android</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="MonoDevelop.Ide">
<HintPath>/Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/bin/MonoDevelop.Ide.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MonoDevelop.Core">
<HintPath>/Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/bin/MonoDevelop.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MonoDevelop.DesignerSupport">
<HintPath>/Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MonoDevelop.MonoDroid">
<HintPath>/Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/AddIns/MonoDevelop.MonoDroid/MonoDevelop.MonoDroid.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Xamarin.Components.Ide">
<HintPath>/Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/AddIns/Xamarin.Ide/Xamarin.Components.Ide.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Xamarin.Ide">
<HintPath>/Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/AddIns/Xamarin.Ide/Xamarin.Ide.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Xamarin.Ide.Insights">
<HintPath>/Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop//AddIns/Xamarin.Ide.Insights/Xamarin.Ide.Insights.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\MonoDevelop.MonoGame.Core\MonoDevelop.MonoGame.Core.csproj">
<Project>{3FE5AAE8-BE24-4FC3-AF86-2AA3C3CD8DB4}</Project>
<Name>MonoDevelop.MonoGame.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="templates\" />
<Folder Include="icons\" />
<Folder Include="templates\Android\" />
</ItemGroup>
<ItemGroup>
<Content Include="templates\MonoGameAndroidProject.xpt.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="templates\Android\AboutAssets.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="templates\Android\AboutContent.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="templates\Android\AboutResources.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="templates\Android\Splash.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="templates\Android\Styles.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="templates\Android\Resource.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="templates\Android\AndroidManifest.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="templates\Android\Activity1.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="MonoGameAndroidProject.cs" />
</ItemGroup>
</Project>
@@ -1,29 +0,0 @@
using System;
namespace MonoDevelop.MonoGame.Android
{
public class MonoGameAndroidProject : MonoDevelop.MonoDroid.MonoDroidProject
{
public MonoGameAndroidProject () : base()
{
}
public override MonoDevelop.Projects.SolutionItemConfiguration CreateConfiguration (string name)
{
return base.CreateConfiguration (name);
}
protected override void PopulateSupportFileList (MonoDevelop.Projects.FileCopySet list, MonoDevelop.Projects.ConfigurationSelector configuration)
{
base.PopulateSupportFileList (list, configuration);
}
[Obsolete]
public override string ProjectType {
get {
return "MonoGameAndroid";
}
}
}
}
@@ -1,22 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle ("MonoDevelop.MonoGame.Android")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("")]
[assembly: AssemblyProduct ("")]
[assembly: AssemblyCopyright ("MonoGame Team")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion ("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
@@ -1,19 +0,0 @@
Any raw assets you want to be deployed with your application can be placed in
this directory (and child directories) and given a Build Action of "AndroidAsset".
These files will be deployed with you package and will be accessible using Android's
AssetManager, like this:
public class ReadAsset : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
InputStream input = Assets.Open ("my_asset.txt");
}
}
Additionally, some Android functions will automatically load asset files:
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
@@ -1,44 +0,0 @@
Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.
For example, a sample Android app that contains a user interface layout (main.axml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:
Resources/
drawable/
icon.png
layout/
main.axml
values/
strings.xml
In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called "R"
(this is an Android convention) that contains the tokens for each one of the resources
included. For example, for the above Resources layout, this is what the R class would expose:
public class R {
public class drawable {
public const int icon = 0x123;
}
public class layout {
public const int main = 0x456;
}
public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
to reference the layout/main.axml file, or R.strings.first_string to reference the first
string in the dictionary file values/strings.xml.
@@ -1,44 +0,0 @@
Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.
For example, a sample Android app that contains a user interface layout (main.axml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:
Resources/
drawable/
icon.png
layout/
main.axml
values/
strings.xml
In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called "R"
(this is an Android convention) that contains the tokens for each one of the resources
included. For example, for the above Resources layout, this is what the R class would expose:
public class R {
public class drawable {
public const int icon = 0x123;
}
public class layout {
public const int main = 0x456;
}
public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
to reference the layout/main.axml file, or R.strings.first_string to reference the first
string in the dictionary file values/strings.xml.
@@ -1,40 +0,0 @@
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Content.PM;
using Android.Views;
using Android.Widget;
using Android.OS;
using Microsoft.Xna.Framework;
namespace ${Namespace}
{
[Activity (Label = "${ProjectName}",
MainLauncher = true,
Icon = "@drawable/icon",
Theme = "@style/Theme.Splash",
AlwaysRetainTaskState=true,
LaunchMode=LaunchMode.SingleInstance,
ScreenOrientation = ScreenOrientation.FullUser,
ConfigurationChanges = ConfigChanges.Orientation |
ConfigChanges.KeyboardHidden |
ConfigChanges.Keyboard |
ConfigChanges.ScreenSize |
ConfigChanges.ScreenLayout)]
public class Activity1 : AndroidGameActivity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
var g = new Game1 ();
SetContentView (g.Services.GetService<View>());
g.Run ();
}
}
}
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="${ProjectName}">
<uses-sdk android:minSdkVersion="10" />
<application android:label="${ProjectName}">
</application>
</manifest>
@@ -1,103 +0,0 @@
#pragma warning disable 1591
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 4.0.30319.17020
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
[assembly: Android.Runtime.ResourceDesignerAttribute("OpenGLApplication1.Resource", IsApplication=true)]
namespace ${Namespace}
{
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
public partial class Resource
{
static Resource()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
public static void UpdateIdValues()
{
}
public partial class Attribute
{
static Attribute()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Attribute()
{
}
}
public partial class Drawable
{
// aapt resource value: 0x7f020000
public const int Icon = 2130837504;
static Drawable()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Drawable()
{
}
}
public partial class Id
{
static Id()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Id()
{
}
}
public partial class Layout
{
static Layout()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Layout()
{
}
}
public partial class String
{
// aapt resource value: 0x7f040001
public const int ApplicationName = 2130968577;
static String()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private String()
{
}
}
}
}
#pragma warning restore 1591
Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Splash" parent="android:Theme">
<item name="android:windowBackground">@drawable/splash</item>
<item name="android:windowNoTitle">true</item>
</style>
</resources>
@@ -1,63 +0,0 @@
<?xml version="1.0"?>
<Template>
<TemplateConfiguration>
<_Name>MonoGame for Android Application</_Name>
<Category>monogame/app/games</Category>
<Icon>monogame-project</Icon>
<LanguageName>C#</LanguageName>
<_Description>Creates an MonoGame for Android Project </_Description>
</TemplateConfiguration>
<Actions>
<Open filename = "Game1.cs"/>
</Actions>
<Combine name = "${ProjectName}" directory = ".">
<Options>
<StartupProject>${ProjectName}</StartupProject>
</Options>
<Project name = "${ProjectName}" directory = "." type = "MonoDroid">
<Options
AndroidApplication="true"
AndroidResgenFile="Resources/Resource.designer.cs"
AndroidResgenClass="Resource"
TargetFrameworkVersion="MonoAndroid,Version=v5.0" />
<References>
<Reference type="Gac" refto="System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" />
<Reference type="Gac" refto="System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" />
<Reference type="Gac" refto="System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" />
<Reference type="Gac" refto="Mono.Android" />
<Reference type="Gac" refto="OpenTK-1.0" />
<Reference type="Package" refto="MonoGame.Framework" />
</References>
<Files>
<File name="Activity1.cs" src="Android/Activity1.cs" />
<File name="Game1.cs" src="Common/Game1.cs" />
<Directory name="Resources">
<File name="Resource.designer.cs" src="Android/Resource.cs" />
<RawFile name="AboutResources.txt" src="Android/AboutResources.txt" />
<Directory name="drawable">
<RawFile name="Icon.png" src="Common/Icon-md.png" />
<RawFile name="Splash.png" src="Android/Splash.png" />
</Directory>
<Directory name="values">
<RawFile name="Styles.xml" src="Android/Styles.xml" />
</Directory>
</Directory>
<Directory name="Properties">
<File name="AssemblyInfo.cs" src="Common/AssemblyInfo.cs" />
<File name="AndroidManifest.xml" src="Android/AndroidManifest.xml" />
</Directory>
<Directory name="Content">
<File name="Content.mgcb" src="Common/Content.mgcb" BuildAction="MonoGameContentReference"/>
</Directory>
<Directory name="Assets">
<RawFile name="AboutAssets.txt" src="Android/AboutAssets.txt" />
<Directory name="Content">
</Directory>
</Directory>
</Files>
</Project>
</Combine>
</Template>
@@ -1,9 +0,0 @@
using System;
namespace MonoDevelop.MonoGame.Core
{
public interface IMonoGameProject
{
}
}
@@ -1,40 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3FE5AAE8-BE24-4FC3-AF86-2AA3C3CD8DB4}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>MonoDevelop.MonoGame.Core</RootNamespace>
<AssemblyName>MonoDevelop.MonoGame.Core</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="IMonoGameProject.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

Some files were not shown because too many files have changed in this diff Show More