Skip to content

[FEATURE] Fully-qualified class paths and namespaces don't work inside scripts #27

Description

@senioritaelizabeth
  • NxScript version: ?.?.?
  • Branch: GitHub (dev)

What problem does this solve?

Currently, imports using full package paths inside scripts do not work correctly.

For example:

flixel.graphics.FlxGraphic

or references like:

import Sys.println;
println("test");

fail inside NxScript code, despite being valid Haxe syntax.

This makes it impossible to access classes or namespaces directly the same way you normally would in Haxe.


Proposed solution

Allow fully-qualified type access and namespace resolution inside NxScript scripts, matching standard Haxe behavior.

Examples that should work:

import Sys.println;

println("hello");

var graphic:flixel.graphics.FlxGraphic;

This would make scripting much more flexible and predictable for users already familiar with Haxe.


Alternatives considered (optional)

Current workaround is importing or exposing classes manually beforehand, but this becomes inconvenient and limits compatibility with existing Haxe-style code.


Example usage (optional)

import Sys.println;

println("works");

var test:flixel.graphics.FlxGraphic;

Additional context (optional)

This behavior differs from normal Haxe expectations and can be confusing for developers using NxScript as an embedded scripting layer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions