Created
June 4, 2015 09:59
-
-
Save oldschooljarvis/be1911d93234a4f3cdc8 to your computer and use it in GitHub Desktop.
animation lag in hierarchical scenes #190\1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var f = require('famous'); | |
f.core.FamousEngine.init(); | |
var scene = f.core.FamousEngine.createScene(); | |
var parent = scene.addChild(); | |
new f.domRenderables.DOMElement(parent, { tagName: 'div' }).setContent('parent'); | |
parent.setSizeMode('absolute','absolute','absolute').setAbsoluteSize(50, 50).setAlign(0.5, 0.5).setMountPoint(0.5, 0.5).setOrigin(0.5, 0.5); | |
var child = parent.addChild(); | |
new f.domRenderables.DOMElement(child, { tagName: 'div' }).setContent('child'); | |
//new f.webglRenderables.Mesh(child).setGeometry('Circle').setBaseColor(new f.utilities.Color('green')); //Bottom example only. | |
child.setSizeMode('absolute','absolute','absolute').setAbsoluteSize(50, 50).setAlign(0.5, 0.5).setMountPoint(0.5, 0.5).setOrigin(0.5, 0.5); | |
child.setPosition(0, 50, 0); | |
//child.setOpacity(0.5); //Bottom example only. | |
new f.components.Position(parent).set(300, 0, 0, {duration: 3000, curve: 'spring'}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment