This is a WIP of a cheat-sheet that I will finish Eventually™
Mapping of the shader types to Heaps types:
Float = Float
Int = Int
Bool = Bool
package states; | |
import flixel.util.FlxColor; | |
import flixel.FlxG; | |
import flixel.FlxSprite; | |
class DoNothingShaderTestState extends flixel.FlxState | |
{ | |
override function create() | |
{ |
package; | |
typedef Listener = | |
{ | |
tag1:String, | |
tag2:String, | |
callback:Dynamic->Dynamic->Void | |
} |
import flixel.system.FlxAssets.FlxShader; | |
import flixel.util.FlxColor; | |
class Outline extends FlxShader | |
{ | |
@:glFragmentSource(' | |
#pragma header | |
uniform vec2 size; | |
uniform vec4 color; |
package util; | |
import echo.data.Options.BodyOptions; | |
import flixel.FlxBasic; | |
import flixel.FlxObject; | |
import flixel.FlxObject.*; | |
import flixel.group.FlxGroup; | |
import echo.Echo; | |
import echo.World; | |
import echo.Body; |
I (Yanrishatum) see too many same questions. They irritate me.
"How dare you come into this chat and not realize that i am the GOD of heaps and that you MUST check out MY documentation1!!! Im veyr abngrey!!!" - translation from someone in chat.
Very accurate, I highly approve.
---------------------------------------------------------------------- | |
-- Generate Normal Map | |
-- | |
-- It works only for RGB color mode. | |
---------------------------------------------------------------------- | |
if app.apiVersion < 1 then | |
return app.alert("This script requires Aseprite v1.2.10-beta3") | |
end |
FlxSpriteGroup
Inheritance
To get Haxeflixel to maintain 1:1 pixel rendering at any scale for desktop targets:
In your Project.xml
, add a new window property with an desktop conditional, resizable
set to false, and the desired width
/height
to match the resolution you'd like to maintain.
<window if="desktop" resizable="false" width="320" height="180" />
Apply a shader to the FlxGame instance or the main FlxCamera instance as a filter. The base FlxShader can even just be used if the project doesn't require custom shaders.
FlxG.game.setFilters([new ShaderFilter(new FlxShader())]);