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;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Nez; using Nez;
using Nez.ImGuiTools;
namespace project_name 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") CreateEntity("demo imgui draw commands")
.setPosition(new Vector2(150, 150)) .SetPosition(new Vector2(150, 150))
.addComponent<DemoComponent>() .AddComponent<DemoComponent>()
.addComponent(new PrototypeSprite(20, 20)); .AddComponent(new PrototypeSprite(20, 20));
var logo = content.Load<Texture2D>("nez-logo-black"); var logo = Content.Load<Texture2D>("nez-logo-black");
createEntity("logo") CreateEntity("logo")
.setPosition(Screen.center) .SetPosition(Screen.Center)
.addComponent(new Nez.Sprites.Sprite(logo)); .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; int _buttonClickCounter;
public override void onAddedToEntity() public override void OnAddedToEntity()
{ {
// register with the ImGuiMangaer letting it know we want to render some IMGUI // 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 // 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 // do your actual drawing here
ImGui.Begin("Your ImGui Window", ImGuiWindowFlags.AlwaysAutoResize); 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)); System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(System.Console.Out));
#endif #endif
scene = new DefaultScene(); Scene = new DefaultScene();
// optionally render Nez in an ImGui window // optionally render Nez in an ImGui window
var imGuiManager = new ImGuiManager(); var imGuiManager = new ImGuiManager();
Core.registerGlobalManager(imGuiManager); Core.RegisterGlobalManager(imGuiManager);
} }
} }
} }