Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Class Shadowing #541

Open
AdamHarte opened this issue Oct 29, 2024 · 0 comments
Open

Document Class Shadowing #541

AdamHarte opened this issue Oct 29, 2024 · 0 comments

Comments

@AdamHarte
Copy link

Explanation from the Haxe Discord:

shadow
Shadowing classes in haxe, means, overwriting an original source file with a local copy without needing to modify the original copy.

This is useful under situations where you want to test out changes to libraries, or change something to fit your projects needs.

  1. Locate the full package of the file you wish to overwrite as an example - flixel/system/frontEnds/SoundFrontEnd.hx
  2. Go to your own project and locate your source directory. Create a file called SoundFrontEnd.hx at the exact same destination. So it looks a little like: your_project_root/src/flixel/system/frontEnds/SoundFrontEnd.hx
  3. Copy the contents of the original file (or a pr) to the file created within your project
  4. You've now overwritten the original source file! Make any changes you wish to this file and it will apply to all SoundFrontEnd references, including inside libraries.

Notes:
it's even possible with a lib, as long as -lib newImplem is later than -lib oldImplem in hxml order

It replaces the entire file, but it is possible to replace specific vars and functions using a macro, if that is actually what you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant