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

FlxAsepriteUtils demo #326

Merged
merged 6 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions Graphics/FlxAsepriteUtils/FlxAsepriteUtils.hxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<project version="2">
<!-- Output SWF options -->
<output>
<movie outputType="CustomBuild" />
<movie input="" />
<movie path="Project.xml" />
<movie fps="60" />
<movie width="640" />
<movie height="480" />
<movie version="1" />
<movie minorVersion="0" />
<movie platform="Lime" />
<movie background="000000" />
<movie preferredSDK="Haxe 3.0.0;3.0.0;" />
</output>
<!-- Other classes to be compiled into your SWF -->
<classpaths>
<class path="C:\HaxeToolkit\haxe\lib\flixel\git" />
<class path="C:\HaxeToolkit\haxe\lib\openfl\2,1,6" />
<class path="C:\HaxeToolkit\haxe\lib\lime\2,0,0" />
<class path="source" />
<class path="export\flash\haxe" />
</classpaths>
<!-- Build options -->
<build>
<option directives="flixel=3.3.6&#xA;openfl=2.1.6&#xA;lime=2.0.0&#xA;tools=2.0.0&#xA;FLX_NO_DEBUG&#xA;no-compilation&#xA;NAPE_RELEASE_BUILD&#xA;openfl-flash&#xA;web" />
<option flashStrict="False" />
<option noInlineOnDebug="False" />
<option mainClass="ApplicationMain" />
<option enabledebug="True" />
<option additional="--macro flixel.system.macros.FlxConditionals.run()&#xA;-swf-version 11.8" />
</build>
<!-- haxelib libraries -->
<haxelib>
<!-- example: <library name="..." /> -->
</haxelib>
<!-- Class files to compile (other referenced classes will automatically be included) -->
<compileTargets>
<compile path="Source\TestDrawRect.hx" />
</compileTargets>
<!-- Paths to exclude from the Project Explorer tree -->
<hiddenPaths>
<hidden path="obj" />
</hiddenPaths>
<!-- Executed before build -->
<preBuildCommand>"$(CompilerPath)/haxelib" run lime build "$(OutputFile)" $(TargetBuild) -$(BuildConfig) -Dfdb</preBuildCommand>
<!-- Executed after build -->
<postBuildCommand alwaysRun="False" />
<!-- Other project options -->
<options>
<option showHiddenPaths="False" />
<option testMovie="Custom" />
<option testMovieCommand="" />
</options>
<!-- Plugin storage -->
<storage />
</project>
84 changes: 84 additions & 0 deletions Graphics/FlxAsepriteUtils/Project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://lime.software/project/1.0.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://lime.software/project/1.0.2 http://lime.software/xsd/project-1.0.2.xsd">

<!-- _________________________ Application Settings _________________________ -->

<app title="FlxAsepriteUtils" file="FlxAsepriteUtils" main="Main" version="0.0.1" company="HaxeFlixel" />

<!--The flixel preloader is not accurate in Chrome. You can use it regularly if you embed the swf into a html file
or you can set the actual size of your file manually at "FlxPreloaderBase-onUpdate-bytesTotal"!-->
<app preloader="flixel.system.FlxPreloader" />

<!--Minimum without FLX_NO_GAMEPAD: 11.8, without FLX_NO_NATIVE_CURSOR: 11.2 -->
<set name="SWF_VERSION" value="11.8" />

<!-- ____________________________ Window Settings ___________________________ -->

<!--These window settings apply to all targets-->
<window width="640" height="480" fps="60" background="#000000" hardware="true" vsync="false" />

<!--HTML5-specific-->
<window if="html5" resizable="false" />

<!--Desktop-specific-->
<window if="desktop" orientation="landscape" fullscreen="false" resizable="true" />

<!--Mobile-specific-->
<window if="mobile" orientation="landscape" fullscreen="true" width="0" height="0" />

<!-- _____________________________ Path Settings ____________________________ -->

<set name="BUILD_DIR" value="export" />
<source path="source" />
<assets path="assets" />

<!-- _______________________________ Libraries ______________________________ -->

<haxelib name="flixel" />

<!--In case you want to use the addons package-->
<!--<haxelib name="flixel-addons" />-->

<!--In case you want to use the ui package-->
<!--<haxelib name="flixel-ui" />-->

<!--In case you want to use nape with flixel-->
<!--<haxelib name="nape-haxe4" />-->

<!-- ______________________________ Haxedefines _____________________________ -->

<!--Enable the Flixel core recording system-->
<!--<haxedef name="FLX_RECORD" />-->

<!--Disable the right and middle mouse buttons-->
<!--<haxedef name="FLX_NO_MOUSE_ADVANCED" />-->

<!--Disable the Native cursor api for Flash target-->
<!--<haxedef name="FLX_NO_NATIVE_CURSOR" />-->

<!--Optimise inputs, be careful you will get null errors if you don't use conditionals in your game-->
<!--<haxedef name="FLX_NO_MOUSE" if="mobile" />-->
<!--<haxedef name="FLX_NO_KEYBOARD" if="mobile" />-->
<!--<haxedef name="FLX_NO_TOUCH" if="desktop" />-->
<!--<haxedef name="FLX_NO_GAMEPAD" />-->

<!--Disable the Flixel core sound tray-->
<!--<haxedef name="FLX_NO_SOUND_TRAY" />-->

<!--Disable the Flixel sound management code-->
<!--<haxedef name="FLX_NO_SOUND_SYSTEM" />-->

<!--Disable the Flixel core focus lost screen-->
<!--<haxedef name="FLX_NO_FOCUS_LOST_SCREEN" />-->

<!--Disable the Flixel core debugger. Automatically gets set whenever you compile in release mode!-->
<haxedef name="FLX_NO_DEBUG" unless="debug" />

<!--Enable this for Nape release builds for a serious peformance improvement-->
<haxedef name="NAPE_RELEASE_BUILD" unless="debug" />

<!-- _________________________________ Custom _______________________________ -->

<!-- Place custom nodes like icons here -->
</project>
26 changes: 26 additions & 0 deletions Graphics/FlxAsepriteUtils/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# FlxAsepriteUtils

Demonstrates how to utilize Aseprite art files with the built-in FlxAsepriteUtils functionality.

## Table of Contents

* [Files](#files)
* [Aseprite Export](#aseprite-export)

### Files

* `player.ase` - Aseprite file built using Character Animations from Kenney.nl (https://www.kenney.nl/assets/platformer-characters)
* `player.png` - Sprite sheet exported from Aseprite. See [Aseprite Export](#aseprite-export) for details.
* `player.json` - Atlas frame data exported from Aseprite. See [Aseprite Export](#aseprite-export) for details.

### Aseprite Export

There are two main ways of exporting sprite sheets from Aseprite:

* UI
* See the [Official UI Docs](https://www.aseprite.org/docs/sprite-sheet/#export)
* Requires user interaction, but allows for preview to visualize sprite sheet settings
* Good default settings are provided when using the [Flixel Aseprite Export Plugin](https://github.com/MondayHopscotch/aseprite-scripts/releases/latest)
* CLI
* See the [Official CLI Docs](https://www.aseprite.org/docs/cli/)
* Useful for automated workflows
Binary file added Graphics/FlxAsepriteUtils/assets/player.ase
Binary file not shown.
Loading
Loading