getting closer to zero config

This commit is contained in:
Mike 2019-02-10 19:59:53 -08:00
parent 5e618eca79
commit 4a49a86ae7
7 changed files with 48 additions and 27 deletions

9
.gitignore vendored
View File

@ -1,6 +1,9 @@
.DS_Store
FNA/
fnalibs/
project_name/bin/
project_name/obj/
project_name/CompiledContent/.mgstats
Shitty/bin
Shitty/CompiledContent/bin
Shitty/CompiledContent/obj
.mgstats
Shitty/obj

View File

@ -95,7 +95,11 @@ fi
# Rename project
read -p "Enter the project name to use for your folder and csproj file: " newProjectName
read -p "Enter the project name to use for your folder and csproj file or 'exit' to quit: " newProjectName
if [[ $newProjectName = 'exit' ]]; then
exit 1
fi
sed -i '' "s/project_name/$newProjectName/g" project_name/project_name.csproj
sed -i '' "s/project_name/$newProjectName/g" project_name/Game1.cs
sed -i '' "s/project_name/$newProjectName/g" project_name/Program.cs
@ -104,3 +108,14 @@ sed -i '' "s/project_name/$newProjectName/g" project_name/.vscode/launch.json
mv project_name/project_name.csproj "project_name/$newProjectName.csproj"
mv project_name "$newProjectName"
git init
git submodule add git@github.com:prime31/Nez.FNA.git
cd Nez.FNA
git submodule init
git submodule update
sleep 10
nuget restore Nez.FNA/Nez/Nez.sln
msbuild Nez.FNA/Nez/Nez.sln

View File

@ -27,6 +27,7 @@
],
"group": "build",
"problemMatcher": "$msCompile",
"dependsOn": "Build Content",
},
{

View File

@ -16,3 +16,15 @@
/reference:../../Nez.FNA/Nez/Nez.PipelineImporter/bin/Debug/Nez.dll
#---------------------------------- Content ---------------------------------#
#begin nez-logo-black.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:nez-logo-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -1,38 +1,27 @@
using System;
using Nez;
using Microsoft.Xna.Framework;
namespace project_name
{
class Game1 : Game
class Game1 : Core
{
GraphicsDeviceManager graphics;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
public Game1() : base()
{}
override protected void Initialize()
{
base.Initialize();
}
var newScene = new Scene();
newScene.addRenderer(new DefaultRenderer());
override protected void LoadContent()
{
base.LoadContent();
}
var logo = newScene.content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("nez-logo-black");
newScene.createEntity("logo")
.setPosition(Screen.center)
.addComponent(new Nez.Sprites.Sprite(logo));
override protected void Update(GameTime gameTime)
{
base.Update(gameTime);
}
override protected void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
base.Draw(gameTime);
scene = newScene;
}
}
}

View File

@ -11,6 +11,7 @@
<!-- Reference FNA project -->
<ItemGroup>
<ProjectReference Include="../FNA/FNA.csproj" />
<ProjectReference Include="../Nez.FNA/Nez.FNA/Nez.FNA.csproj" />
</ItemGroup>
<!-- Include the Content directory (except for .fx files, since we use .fxb at runtime) -->