improve: rename project
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
namespace Hangman.SDK.Attributes;
|
||||
namespace Polonium.Attributes;
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class AutoRegister : Attribute
|
||||
{
|
||||
|
||||
25
src/Scenes/CameraScene.cs
Normal file
25
src/Scenes/CameraScene.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Godot;
|
||||
|
||||
namespace Polonium.Scenes;
|
||||
|
||||
public abstract partial class CameraScene : Scene
|
||||
{
|
||||
private Camera2D Camera { get; set; }
|
||||
protected abstract float MaxZoom { get; }
|
||||
protected abstract float MinZoom { get; }
|
||||
protected abstract float ZoomRate { get; }
|
||||
private float Zoom
|
||||
{
|
||||
get => Camera.Zoom.X;
|
||||
set => Camera.Zoom = value * Vector2.One;
|
||||
}
|
||||
public override void _Ready()
|
||||
{
|
||||
Camera = GetNode<Camera2D>("Camera");
|
||||
base._Ready();
|
||||
}
|
||||
protected void ZoomIn() => Mathf.Max(Zoom * (1 + ZoomRate), MaxZoom);
|
||||
protected void ZoomOut() => Mathf.Min(Zoom * (1 - ZoomRate), MinZoom);
|
||||
protected void ZoomAt(Vector2 pos) => Camera.Position = pos;
|
||||
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
using Godot;
|
||||
|
||||
namespace Hangman.SDK.Scenes;
|
||||
namespace Polonium.Scenes;
|
||||
|
||||
public abstract partial class RootScene : Node2D
|
||||
{
|
||||
private Scene CurrentScene { get; set; }
|
||||
private Polonium.Scenes.Scene CurrentScene { get; set; }
|
||||
|
||||
public void SwitchScene(Scene scene)
|
||||
public void SwitchScene(Polonium.Scenes.Scene scene)
|
||||
{
|
||||
if (CurrentScene != null)
|
||||
RemoveChild(CurrentScene);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Godot;
|
||||
|
||||
namespace Hangman.SDK.Scenes;
|
||||
namespace Polonium.Scenes;
|
||||
|
||||
public abstract partial class Scene : Node2D
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace Hangman.SDK;
|
||||
namespace Polonium;
|
||||
|
||||
public static class Utils
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user