famo.us

Famo.us how to make a scrollview be filled from bottom to top (or right to left)?

杀马特。学长 韩版系。学妹 提交于 2020-01-16 05:10:11
问题 Assuming I've a scrollview with direction 1 (vertical). While populating the scrollView, the items do appear and are aligned from top to bottom. I would like to know if there is a way to reverse this ordering i.e. to make the scrollView be populated from the bottom to the top. A good example of usage is a message list. You want the last message to always appear on the bottom of the list. By default, the message would be aligned on top, which is not convenient. [EDIT] I just found we can

What is a good way to know when all surfaces had been initially rendered in famo.us?

筅森魡賤 提交于 2020-01-14 03:07:28
问题 I would like to be able to know when all views have been rendered in a layout. The reason I want to do this is because I need to be able to reference positions of rendered views in the layout, so that I may animate views relative to other views that had already been rendered. I have read this: Surface render events in famo.us One way I can think of is to count views that have been rendered and after all had been rendered (based on a known count), I can then assume all have been rendered.

Do famo.us layouts like SequentialLayout participate in the render tree?

耗尽温柔 提交于 2020-01-06 14:38:06
问题 When using a SequentialLayout in trying to apply StateModifiers to Surface objects that had been added to a layout, it looks like some unexpected behavior happens: When applying transformations via setTransform on a StateModifier , I expect to see the transformation applied from the origin of the Surface in question. Instead , the transform is applied from an origin of 0,0 in relation to the parent SequentialLayout Given the code below, the above behavior seems to make no logical sense (for

Do famo.us layouts like SequentialLayout participate in the render tree?

筅森魡賤 提交于 2020-01-06 14:37:24
问题 When using a SequentialLayout in trying to apply StateModifiers to Surface objects that had been added to a layout, it looks like some unexpected behavior happens: When applying transformations via setTransform on a StateModifier , I expect to see the transformation applied from the origin of the Surface in question. Instead , the transform is applied from an origin of 0,0 in relation to the parent SequentialLayout Given the code below, the above behavior seems to make no logical sense (for

how to add walls to a famo.us physics simulation?

别等时光非礼了梦想. 提交于 2020-01-03 05:06:06
问题 I have a simple physics sim with some bouncing balls. I'm trying to add a bounding box of "walls" but having problems. any examples would be great :) meantime looking at the cool ascii art docs here * (wall) * | * | (normal) (origin) * | ---> * * | * | (distance) * ................... * (100px) * * e.g., Wall({normal : [1,0,0], distance : 100}) my guess is that adding a wall of @walls.push = new Wall({normal : [1,0,0], distance : 5}) should be a wall of just 5 pixels left of the origin. my

Famo.us: get the new position of a draggable Surface

…衆ロ難τιáo~ 提交于 2020-01-03 00:53:12
问题 After using drag and drop on a surface I want to get the exact new position of this Surface. How can I do that? 回答1: You will be able to get the position from your Draggable modifier on end event draggable.on('end',function(e){var pos = e.position;}) Here is a link for the following code example : var mainContext = Engine.createContext(); var transTransform = new TransitionableTransform(); transTransform.set(Transform.translate(100, 0, 0)); var surface = new Surface({ size: [300, 100],

How to implement google paper button effects

纵然是瞬间 提交于 2020-01-02 04:08:04
问题 Google’s paper / material design http://www.google.com/design/spec/material-design/introduction.html is a really clean look that I think is going to see a lot of use. Polymer has a bunch of “paper-elements” ready to go and the web community is already playing with different ways to implement it. For this question I’m specifically looking at the button click effect. It has a ripple of activation color that radiates from your click. Here is polymer’s example: http://www.polymer-project.org

how best to create a single scrollable view in famo.us?

我们两清 提交于 2020-01-01 06:55:30
问题 Famo.us has a "Scrollview" but it only scrolls if you have multiple surfaces inside it. I would like a single long page of text, but this doesn't respond to scrolling. Given that famo.us deliberately overrides normal native scrolling views ( https://github.com/Famous/views/issues/45 ), what is the best method to get famous to scroll a long page of content? I'm considering breaking all the content html apart (eg div by div), and adding a bunch of surfaces into a normal scrollview. this may

famo.us: how to handle textbox.onchange events

只愿长相守 提交于 2019-12-31 05:36:13
问题 I don't see any tutorials with text input on famo.us university. How can I add a text box surface to my app and handle onchange events? 回答1: It is a bit hard to understand what you are looking to do.. But lets start out with your first question. There is currently no onchange handler option so if you want it now, you can write a subclass of InputSurface. By overriding the deploy function, while still calling InputSurface's deploy function, we can add the functionality we want, without messing

How to get Famo.us draggable modifier's render node

我怕爱的太早我们不能终老 提交于 2019-12-25 02:06:52
问题 I am trying to get parent renderNode of a draggable modifier on 'end' event, is there any api to get a renderNode to which draggable belongs to? My code is as follows : /*globals define*/ define(function(require, exports, module) { var View = require('famous/core/View'); var Surface = require('famous/core/Surface'); var Transform = require('famous/core/Transform'); var StateModifier = require('famous/modifiers/StateModifier'); var Draggable = require("famous/modifiers/Draggable"); var