49 lines
3.1 KiB
Markdown

# Standalone OpenFL Application
This project is a standalone OpenFL application that serves as a template for building your own applications using the OpenFL framework. Below are the details regarding the structure and usage of the project.
## Project Structure
- **src/**: Contains the source code for the application.
- **Main.hx**: Entry point for the application. Initializes the application and sets up the main logic.
- **ApplicationMain.hx**: Manages the application lifecycle, creates the application instance, and handles preloader functionality.
- **DocumentClass.hx**: Extends the main application class, managing display and event handling.
- **ManifestResources.hx**: Manages application resources, including asset loading and preloader resources.
- **assets/**: Contains asset files for the application.
- **img/**: Directory for image assets. Currently contains a placeholder file.
- **placeholder.txt**: Placeholder file that can be replaced with actual image files.
- **build.hxml**: Build configuration file for the Haxe compiler. Specifies source files, output directory, and additional compiler flags or libraries.
- **compile.sh**: Shell script to automate the build process. Runs the Haxe compiler with the specified build.hxml configuration.
- **project.xml**: Project configuration file for OpenFL, containing metadata such as title, version, and dependencies.
- **README.md**: Documentation for the project, including setup instructions and usage information.
## Setup Instructions
1. **Install Haxe and OpenFL**: Ensure you have Haxe and OpenFL installed on your system. You can find installation instructions on the [Haxe website](https://haxe.org/download/) and the [OpenFL website](https://openfl.org/download/).
2. **Replace Placeholders**: Open the `src/ApplicationMain.hx` file and replace the `::` placeholders with actual values relevant to your application:
- `::APP_FILE::`: Path to your main application file (e.g., "src/Main.hx").
- `::meta.buildNumber::`: Build number of your application.
- `::meta.company::`: Your company name.
- `::meta.title::`: Title of your application.
- `::meta.packageName::`: Package name of your application.
- `::meta.version::`: Version of your application.
- `::WIN_WIDTH::` and `::WIN_HEIGHT::`: Desired window dimensions.
- Other boolean values like `::allowHighDPI::`, `::alwaysOnTop::`, etc., with appropriate settings.
3. **Adjust Build Configuration**: Modify the `build.hxml` file to include necessary libraries and source files for your application.
4. **Build the Application**: Run the `compile.sh` script to build your OpenFL application. This will compile the source files and generate the executable.
5. **Run the Application**: After building, you can run the generated executable to see your application in action.
## Usage Information
This template provides a solid foundation for developing OpenFL applications. You can expand upon the provided classes and resources to create your own unique application. Be sure to refer to the OpenFL documentation for additional guidance on using the framework effectively.
Happy coding!