This is a set of extensions I am working on for Attract-Mode:
https://github.com/liquid8d/attract-extra/tree/master/layouts/extendedI say extensions because it's a set of .nut files that can be added to any layout that will extend the capabilities of AM.
ExtendedObjectsCurrently, ExtendedObjects is primarily a wrapper around the current Fe.Text, Fe.Image, Fe.ListBox objects with some helper functions to make it easier to work with your layout objects.
ExtendedObjects has the typical .add_text, .add_image, .add_artwork, and .add_listbox functions, just with an addition of an object id as the first parameter. Returned to you is a new class of that object: ExtendedText, ExtendedImage, ExtendedArtwork and ExtendedListBox. One major difference in these new classes is you don't get or set variables directly:
obj.x becomes obj.getX() or obj.setX(x)
obj.y becomes obj.getY() or obj.setY(y)
...
This is so the extended objects class can do some stuff whenever variables are changed. My initial reason for doing this was to add animation to the objects (modify x and y), but it kind of grew from there.
BenefitsCustom Objects:
You can extend the new classes which not only will take advantage of the additions of ExtendedObjects but allow you to combine multiple objects as one. This would allow someone to create for instance a full marquee wheel that can then be its own object.
Layers:
With the addition of surfaces in 1.3, ExtendedObjects will create a layered system where you can add objects to different layers. This means you don't have to create objects in the order you want them displayed.
Debugging System:
I wrote a debug system that makes use of ExtendedObjects. When enabled, text boxes are overlayed over every object in your layout which can help with debugging.
Positioning:
A full set of functions to help you position objects, you can use something like obj.setPosition("center") instead of having to do something like (fe.layout.width / 2) - (obj.width / 2), (fe.layout.height / 2) - (obj.height / 2)
Animations:
Why I originally wrote this, you can add animation effects to any object.
AnimationAs I played with the onTick and onTransition functions and looked at examples, I saw how powerful it could be. I thought it would be a pain to create some animation effects every time I wanted something in a layout, so I began building the animate extension.
I did a lot of research to get animation working, since I know very little about it
I had to write a custom onTick and onTransition to handle everything and it includes all kinds of neat easing functions. Everything is pretty much done by just telling it which object to animate and providing a config table. It looks like this:
local animConfig = {
which = "translate",
when = Transition.FromOldSelection,
duration = 1500,
from = "offleft",
to = "left"
}
obj.animate(animConfig);
BenefitsBuiltin easing functions:
You can specify the animation "effects" using the easing and tween config options. For examples, you can look at something like:
http://matthewlein.com/experiments/easing.htmlPre-included animations:
I have two currently, property and translate. Property animates a property (like alpha, skew, size or rotation) and translate moves objects.
Custom animations:
I have a boiler-plate template for creating your own animations where all you initialize, then handle start, frame and stop functions. There is an example animations on github to check out.
Animation sets:
I haven't done much with this yet, but intend on creating some already put together configs for common animations, for instance fade out a snapshot on transition, then fade it back in.
Particle animations:
A new animation I am working on which will essentially mirror the particle effects of HyperTheme. It's pretty cool.
FeedbackI'm still trying to figure out what all to do with this thing, but I want it to be user friendly and provide helpful functions to make creating layouts easier. If you get a chance to play around with it, I'd love to hear some feedback. It's fairly well documented on the github page, but as I make changes, some things might not have been updated. Let me know if you have any issues or questions!