I think my current stumbling block is that there isn't a HelloFamous example - in Meteor - for MixedMode. I've got the HelloFamous example from http://famous.org/learn/, and it's very tantalizing. But it's in Node dialect, rather than the Meteor dialect. So, trying to piece together how to run it in the Meteor context.
Will gadicohen:famous
handle the require function? Am I just suppose to wrap everything in a Meteor.startup()
call? That's my current stumbling block. If I can get that working, I think I'll be mostly self-sufficient afterwards.
// how is this require taken care of????
// var famous = require('famous');
Meteor.startup(function(){
// Famous dependencies
var DOMElement = famous.domRenderables.DOMElement;
var FamousEngine = famous.core.FamousEngine;
// Initialize with a scene; then, add a 'node' to the scene root
var logo = FamousEngine.createScene().addChild();
// Create an [image] DOM element providing the logo 'node' with the 'src' path
new DOMElement(logo, { tagName: 'img' })
.setAttribute('src', './images/famous-logo.svg');
// Chainable API
logo
// Set size mode to 'absolute' to use absolute pixel values: (width 250px, height 250px)
.setSizeMode('absolute', 'absolute', 'absolute')
.setAbsoluteSize(250, 250)
// Center the 'node' to the parent (the screen, in this instance)
.setAlign(0.5, 0.5)
// Set the translational origin to the center of the 'node'
.setMountPoint(0.5, 0.5)
// Set the rotational origin to the center of the 'node'
.setOrigin(0.5, 0.5);
// Add a spinner component to the logo 'node' that is called, every frame
var spinner = logo.addComponent({
onUpdate: function(time) {
logo.setRotation(0, time / 1000, 0);
logo.requestUpdateOnNextTick(spinner);
}
});
// Let the magic begin...
logo.requestUpdate(spinner);
FamousEngine.init();
});