### Clone and Run Starling Demo (NPM/TypeScript) Source: https://github.com/openfl/starling/blob/master/README.md Clone the Starling repository and run the demo project using npm. This example specifically targets the TypeScript version. ```bash git clone https://github.com/openfl/starling cd starling/samples/demo_npm/typescript npm install npm start -s ``` -------------------------------- ### Install Starling Framework (Haxelib) Source: https://github.com/openfl/starling/blob/master/README.md Install the Starling framework using the Haxelib package manager. This is the primary method for Haxe projects. ```sh haxelib install starling ``` -------------------------------- ### Install Ruby and ImageMagick on Windows Source: https://github.com/openfl/starling/blob/master/util/field_agent/README.md Install Ruby and ImageMagick on Windows using Chocolatey. These are required dependencies for the Field Agent. ```bash choco install ruby choco install imagemagick ``` -------------------------------- ### Initialize Starling Project (NPM) Source: https://github.com/openfl/starling/blob/master/README.md Set up a new Starling project for TypeScript, JavaScript, or AS3 using the Yeoman generator. This command installs the generator globally. ```bash npm install -g yo generator-starling-framework mkdir StarlingProject cd StarlingProject yo starling-framework ``` -------------------------------- ### Install ImageMagick on macOS Source: https://github.com/openfl/starling/blob/master/util/field_agent/README.md Use Homebrew to install ImageMagick on macOS. This is a prerequisite for the Field Agent script. ```bash brew install imagemagick ``` -------------------------------- ### Create New Starling Project (OpenFL) Source: https://github.com/openfl/starling/blob/master/README.md Create a new, empty Starling project using the OpenFL command-line tool. ```sh openfl create starling:project StarlingProject ``` -------------------------------- ### Basic HTML and CSS for Starling Demo Source: https://github.com/openfl/starling/blob/master/samples/demo_npm/es5/public/index.html Sets up the basic HTML structure and CSS for the Starling demo, including body margins, overflow, and content background. Also includes font face definitions for DejaVu Sans and Ubuntu. ```html html,body { margin: 0; padding: 0; height: 100%; overflow: hidden; } #openfl-content { background: #000000; width: 100%; height: 100%; } ``` ```css @font-face { font-family: 'DejaVu Sans'; src: url('assets/fonts/DejaVuSans.eot'); src: url('assets/fonts/DejaVuSans.eot?#iefix') format('embedded-opentype'), url('assets/fonts/DejaVuSans.svg#my-font-family') format('svg'), url('assets/fonts/DejaVuSans.woff') format('woff'), url('assets/fonts/DejaVuSans.ttf') format('truetype'); font-weight: normal; font-style: normal; } ``` ```css @font-face { font-family: 'Ubuntu'; src: url('assets/fonts/Ubuntu-R.eot'); src: url('assets/fonts/Ubuntu-R.eot?#iefix') format('embedded-opentype'), url('assets/fonts/Ubuntu-R.svg#my-font-family') format('svg'), url('assets/fonts/Ubuntu-R.woff') format('woff'), url('assets/fonts/Ubuntu-R.ttf') format('truetype'); font-weight: normal; font-style: normal; } ``` -------------------------------- ### Enable High-DPI Support (XML) Source: https://github.com/openfl/starling/blob/master/README.md Configure your project to support high-DPI displays by adding this line to your project file. ```xml ``` -------------------------------- ### Test Starling Demo Project (OpenFL) Source: https://github.com/openfl/starling/blob/master/README.md Clone and test the Starling demo project using OpenFL. This involves creating the demo, navigating to its directory, and testing it on HTML5. ```sh openfl create starling:demo cd demo openfl test html5 ``` -------------------------------- ### Basic CSS for OpenFL Application Source: https://github.com/openfl/starling/blob/master/samples/demo_npm/es6/public/index.html Applies essential styling to the HTML body and the OpenFL content container. Ensures the application takes up the full screen and has a black background. ```css html,body { margin: 0; padding: 0; height: 100%; overflow: hidden; } #openfl-content { background: #000000; width: 100%; height: 100%; } ``` -------------------------------- ### Tag and Push Git Release Source: https://github.com/openfl/starling/blob/master/release-checklist.md Create a signed Git tag for the release and push it to the remote repository. ```sh git tag -s x.y.z -m "version x.y.z" git push origin x.y.z ``` -------------------------------- ### Submit Starling to Haxelib Source: https://github.com/openfl/starling/blob/master/release-checklist.md Upload the Starling haxelib artifact to the Haxelib repository. ```sh haxelib submit starling-haxelib.zip ``` -------------------------------- ### Make Field Agent Executable Source: https://github.com/openfl/starling/blob/master/util/field_agent/README.md Make the field_agent.rb script executable after navigating to its directory. This allows direct invocation. ```bash cd /path/to/starling/util/field_agent chmod u+x field_agent.rb ``` -------------------------------- ### Compare Git Commits in Terminal Source: https://github.com/openfl/starling/blob/master/release-checklist.md Use this command to view a list of commits between two tags in your local repository. ```sh git log a.b.c...master --oneline ``` -------------------------------- ### Publish Starling to npm Source: https://github.com/openfl/starling/blob/master/release-checklist.md Publish the Starling npm artifact to the npm registry. ```sh npm publish starling-npm.tgz ``` -------------------------------- ### Generate Distance Field Texture with Quality and Scale Source: https://github.com/openfl/starling/blob/master/util/field_agent/README.md Combine quality and scale options to first upscale the internal resolution to 200% and then downscale the output to 25%. ```bash ruby field_agent.rb input.png output.png --quality 2 --scale 0.25 ``` -------------------------------- ### Include Starling in OpenFL Project Source: https://github.com/openfl/starling/blob/master/README.md Add the Starling framework to an OpenFL project by including this line in your _project.xml_ file. ```xml ``` -------------------------------- ### Update openfl Version in package.json Source: https://github.com/openfl/starling/blob/master/release-checklist.md Specify the desired version of the openfl dependency in your package.json file. ```json "openfl": "^9.4.1", ``` -------------------------------- ### Enable High-DPI Support (Haxe) Source: https://github.com/openfl/starling/blob/master/README.md Enable high-resolution support within your Starling application code by setting this flag to true. ```haxe starling.supportHighResolutions = true; ``` -------------------------------- ### Generate Distance Field Texture with Scale Setting Source: https://github.com/openfl/starling/blob/master/util/field_agent/README.md Convert an input PNG to a distance field texture, scaling the output resolution down to 25% of the input size. ```bash ruby field_agent.rb input.png output.png --scale 0.25 ``` -------------------------------- ### Enable JavaScript Execution Source: https://github.com/openfl/starling/blob/master/tests/templates/html5/template/index.html This script ensures that JavaScript is enabled in the user's browser to run the application. It is typically placed in the HTML head or before the closing body tag. ```javascript lime.$scripts["::APP_FILE::"](); ``` -------------------------------- ### Define Ubuntu Font Face Source: https://github.com/openfl/starling/blob/master/samples/demo_npm/es6/public/index.html Defines the 'Ubuntu' font face, providing different font file formats for cross-browser support. This allows the application to use the Ubuntu font. ```css @font-face { font-family: 'Ubuntu'; src: url('assets/fonts/Ubuntu-R.eot'); src: url('assets/fonts/Ubuntu-R.eot?#iefix') format('embedded-opentype'), url('assets/fonts/Ubuntu-R.svg#my-font-family') format('svg'), url('assets/fonts/Ubuntu-R.woff') format('woff'), url('assets/fonts/Ubuntu-R.ttf') format('truetype'); font-weight: normal; font-style: normal; } ``` -------------------------------- ### Generate Distance Field Texture with Quality Setting Source: https://github.com/openfl/starling/blob/master/util/field_agent/README.md Convert an input PNG to a distance field texture, scaling the internal resolution by a factor of 4 for higher quality. ```bash ruby field_agent.rb input.png output.png --quality 4 ``` -------------------------------- ### Generate Distance Field Texture with Custom Spread Source: https://github.com/openfl/starling/blob/master/util/field_agent/README.md Generate a distance field texture with a custom edge spread of 6 pixels in the output image resolution. ```bash ruby field_agent.rb input.png output.png --scale 0.25 --spread 6 ``` -------------------------------- ### Define DejaVu Sans Font Face Source: https://github.com/openfl/starling/blob/master/samples/demo_npm/es6/public/index.html Defines the 'DejaVu Sans' font face using multiple formats for broad browser compatibility. This is necessary for custom font rendering within the application. ```css @font-face { font-family: 'DejaVu Sans'; src: url('assets/fonts/DejaVuSans.eot'); src: url('assets/fonts/DejaVuSans.eot?#iefix') format('embedded-opentype'), url('assets/fonts/DejaVuSans.svg#my-font-family') format('svg'), url('assets/fonts/DejaVuSans.woff') format('woff'), url('assets/fonts/DejaVuSans.ttf') format('truetype'); font-weight: normal; font-style: normal; } ``` -------------------------------- ### Apply DistanceFieldStyle in Starling Source: https://github.com/openfl/starling/blob/master/util/field_agent/README.md Assign a DistanceFieldStyle to an Image object in Starling after loading the distance field texture. ```actionscript var image:Image = new Image(distanceFieldTexture); image.style = new DistanceFieldStyle(); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.