Skip to content

C# wrapper #286

Open
Open
@Renari

Description

@Renari

Project Type

2D, 3D

Feature Description

It would be nice if phantom camera included a C# wrapper to ease use with C#.

Use Cases

Currently to call phantom camera methods in C# you have to do something like this:

var cameraActive = (bool)GetNode("PhantomCamera2D").Call("is_active");

This is prone to causing runtime issues, for example if phantom camera changed the is_active method to active this would still compile but cause runtime issues.

(Optional) Proposed Solution

Phantom Camera could ship a C# wrapper that would prevent the above from happening.

One such example:
https://github.com/Portponky/better-terrain/blob/main/addons/better-terrain/BetterTerrain.cs

The above example could then be changed to:

var cameraActive = GetNode<PhantomCamera>("PhantomCamera2D").is_active();

Upon such an update where is_active is changed to active this would then cause a compile error, this also integrates better with IDE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphantom cameraRelated to PhantomCamera nodes

    Projects

    Status

    💬 Requires More Thought

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions