fixes for PascalCase

This commit is contained in:
Mike 2019-09-07 22:39:37 -07:00
parent 3e0088aabf
commit 8b3bd76f9e
3 changed files with 20 additions and 21 deletions

25
project_name/DefaultScene.cs Normal file → Executable file
View File

@ -1,27 +1,26 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Nez;
using Nez.ImGuiTools;
namespace project_name
{
public class DefaultScene : Scene
public class DefaultScene : Scene
{
public override void initialize()
public override void Initialize()
{
setDesignResolution(Screen.width, Screen.height, Scene.SceneResolutionPolicy.None);
SetDesignResolution(Screen.Width, Screen.Height, Scene.SceneResolutionPolicy.None);
addRenderer(new DefaultRenderer());
AddRenderer(new DefaultRenderer());
createEntity("demo imgui draw commands")
.setPosition(new Vector2(150, 150))
.addComponent<DemoComponent>()
.addComponent(new PrototypeSprite(20, 20));
CreateEntity("demo imgui draw commands")
.SetPosition(new Vector2(150, 150))
.AddComponent<DemoComponent>()
.AddComponent(new PrototypeSprite(20, 20));
var logo = content.Load<Texture2D>("nez-logo-black");
createEntity("logo")
.setPosition(Screen.center)
.addComponent(new Nez.Sprites.Sprite(logo));
var logo = Content.Load<Texture2D>("nez-logo-black");
CreateEntity("logo")
.SetPosition(Screen.Center)
.AddComponent(new Nez.Sprites.Sprite(logo));
}
}
}

10
project_name/DemoComponent.cs Normal file → Executable file
View File

@ -8,19 +8,19 @@ namespace project_name
{
int _buttonClickCounter;
public override void onAddedToEntity()
public override void OnAddedToEntity()
{
// register with the ImGuiMangaer letting it know we want to render some IMGUI
Core.getGlobalManager<ImGuiManager>().registerDrawCommand(imGuiDraw);
Core.GetGlobalManager<ImGuiManager>().RegisterDrawCommand(ImGuiDraw);
}
public override void onRemovedFromEntity()
public override void OnRemovedFromEntity()
{
// remove ourselves when we are removed from the Scene
Core.getGlobalManager<ImGuiManager>().unregisterDrawCommand(imGuiDraw);
Core.GetGlobalManager<ImGuiManager>().UnregisterDrawCommand(ImGuiDraw);
}
void imGuiDraw()
void ImGuiDraw()
{
// do your actual drawing here
ImGui.Begin("Your ImGui Window", ImGuiWindowFlags.AlwaysAutoResize);

6
project_name/Game1.cs Normal file → Executable file
View File

@ -16,11 +16,11 @@ namespace project_name
System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(System.Console.Out));
#endif
scene = new DefaultScene();
Scene = new DefaultScene();
// optionally render Nez in an ImGui window
var imGuiManager = new ImGuiManager();
Core.registerGlobalManager(imGuiManager);
Core.RegisterGlobalManager(imGuiManager);
}
}
}
}