r/futile • u/MattRix • Jun 15 '13
New version of Futile is out! (0.91.1)
Hey everyone! A new version of Futile is finally out.
If you've been using the development branches then you've probably already seen most of the new features, but otherwise you're about to get a ton of new stuff.
Oh also, from now on the unitypackage will no longer live in the git repo, instead I will keep it freshly updated (in-sync with master) at http://struct.ca/futile - also, there is now a new version of the unitypackage that has no demos, so if you just want to update Futile itself, this is the thing to use.
Some quick migration tips and info:
The Unity project in the repo has been renamed to
FutileProject(it used to beBananaDemoProject)Everything Futile needs is now in
Assets/FutileThe Banana demo (and soon, more demos) are in
Assets/FutileDemosBefore putting the new stuff in, make sure to delete everything in
/Plugins: so/Futileas well asGoKit.dll,MiniJson.csandMiniJsonExtensions.csAlso make sure to delete
Assets/Resources/Shaders/FutileFutile element names no longer expect a .png extension, so you now say
new FSprite("Banana")instead ofnew FSprite("Banana.png");However, if you set
Futile.shouldRemoveAtlasElementFileExtensions = falsebefore initializing Futile, you can keep using extensions if you prefer that.The
atlasManager.LoadFont()call now requires anoffsetXandoffsetYparameter. These will offset text from that font everywhere (I found that BMFont files didn't give accurate enough information, so being able to tweak positions globally is very handy).Futile.widthis nowFutile.screen.width(etc.)FWatcheris nowRXWatcher(more on what this is later)node.MoveToTop()andMoveToBottom()are nowMoveToFront()andMoveToBack()FShader.Normalhas been renamed toFShader.Basic(this probably won't affect many people)For those who've doing advanced stuff,
FFacetElementNodenow is whatFFacetNodewas before (FFacetNodeis now a more basic class), in other words, if you had a class that previously extendedFFacetNode, make it extendFFacetElementNodeinstead.
With this github link you can see all of the commits from the old version (from back in September!) to now: https://github.com/MattRix/Futile/compare/eabd48b...3500250513
FEATURE LIST:
Unity 4 support
Support for meshes and objects made from triangles (not just quads)
FSliceSprite(for doing 9-slice objects)FWipeSprite(for doing sprites that reveal horizontally or vertical, ex. a progress bar)FRadialWipeSprite(for doing sprites that reveal circularly, ex. a circular spinner thingy)FRepeatSprite(a sprite with a repeating texture)FGameObjectNode(inject a custom unity object into the middle of a Futile scene)FUnityParticleSystemNode(use Unity's robust particle system in Futile)FParticleSystem(a very simple, super-efficient particle system designed for Futile)FDebugFrameRateGraph(a fancy frame rate graph thing)Lots of new convenience methods, ex.
someNode.SetPosition(),someNode.SetAnchor(),someNode.GetLocalMousePosition(),someNode.GetLocalTouchPosition(someTouch)and tons moreMouseOver support and custom hitrects on FButtons (note: FButtons will be getting an overhaul before Futile hits 1.0)
New support for loading png files directly from bytedata instead of having Unity's usual huge image assets, this helps a TON with file size, especially on iOS and Android
FPhysics(this is still very early, but it works great if you understand how Unity's physics work)RXRandom(get random floats, ranges, vectors, select objects randomly from lists/arrays, etc.)RXExtensions(fun stuff likesomeList.GetLastObject(),someList.Log(), etc.)RXUtils(tons of handy stuff, like HSL colors, colors from hex numbers, angle deltas, etc.)
One of the coolest (but trickiest to explain) new features is something called "FNodeEnablers". These are things that only run when an FNode is on the display list. What this means is that you can now call someNode.ListenForUpdate(SomeMethodName) and SomeMethodName() will be called every update tick. Yes, this means NO MORE having to do that messy HandleAddedToStage and HandleRemovedFromStage stuff!
Here's a list of the new enabler methods:
someNode.ListenForUpdate(SomeMethodName); someNode.ListenForFixedUpdate(SomeMethodName); someNode.ListenForLateUpdate(SomeMethodName);
someNode.ListenForResize(SomeMethodName); someNode.ListenForOrientationChange(SomeMethodName);
someNode.EnableSingleTouch() [the node must implement the FSingleTouchableInterface] someNode.EnableMultiTouch() [the node must implement the FMultiTouchableInterface]
Again, you do NOT have to remove these enablers manually (unless you want to for some reason), they will automatically be enabled/disabled when the node is added and removed from the display list.
Along with this stuff, I've also started creating a suite of generic "debugging" classes, including a simple memory profiler (RXProfiler, which keeps track of how many instances are live), a logger (RXDebug) and a watcher (RXWatcher, which is really cool).
If you've been wanting to edit values at runtime, I highly recommend trying the RXWatcher. Simply call RXWatcher.Watch(someObject) and that object will show up in the Unity hierarchy, where you can tweak its values at runtime. Note: the values won't be saved, so you have to manually input the new values into your code yourself, but it's still REALLY handy for tweaking things. Oh and you can even do RXWatcher.Watch(typeof(SomeStaticClass)) if you want to edit static values at runtime.
Phew! Ok that's about it. There are a ton of new things here, so I'm sure there will be a few questions. Let me know which features you'd like more information about. I'm going to start (gradually) working on some documentation and new instructional videos in the lead up to releasing 1.0 (which probably won't be until fall).
Oh also! If you want to see the new physics stuff in action, grab this project: https://github.com/MattRix/TOJam8 (I made it at a game jam, so the code is pretty rough, but it's worth having a look at anyway).
Cheers!
-Matt