You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been struggling with what is probably one or two lines of code and lack of documentation or community response/expertise via StackOverflow, IRC and the like. Apologies in advance for posting in Issues/here.
I'm trying to drive transformations of a StateModifier with a separate transparent Surface - I've spent hours trying to get the secret sauce that is pipe, on update, setPosition, setTransform, or transformFrom without success...
Template.test3.rendered = ->
Session.set 'perspective',1000
position=[0,0]
# TODO: this will NOT update when the window is resized
@extent = Math.round (window.innerWidth/2)
dragFV = FView.byId 'drag3'
dragSrf = dragFV.surface
drag = dragFV.modifier
drag.setOptions
xRange: [-@extent,@extent]
yRange: [-1,1]
cubeFV = FView.byId 'cube3'
cubeMod = cubeFV.modifier
sync = new Famous.GenericSync ['mouse','touch']
dragSrf.pipe drag
drag.on 'update', (data) ->
position = data.position
cubeMod.setTransform Famous.Transform.translate position[0],position[1],0
drag.on 'end', =>
cubeMod.setTransform Famous.Transform.translate 0,0,0
drag.setPosition [0,0],
curve : 'easeOutBounce'
duration : 300
cubeFV.modifier.setTransform Famous.Transform.translate [0,0,0]
Lots of great demos that scratch the surface but haven't found anything aside from raw famo.us that gets into more detail. I'm documenting the whole experience from my new user perspective. The tutas-labs work got me started along with PEM--'s great code snippets and other resources but still struggling on what are probably very simple concepts I'm overlooking. Thank you for any assistance.
The text was updated successfully, but these errors were encountered:
I've started to get my head around solving this thanks to @tutaslabs and after reading through the famo.us code so documenting here for anyone else learning in the same way... essentially stopped using Draggable altogether as it's a wrapper and for me didn't feel flexible for my needs - session vars and reactive template helpers was my solution
Hey there,
I've been struggling with what is probably one or two lines of code and lack of documentation or community response/expertise via StackOverflow, IRC and the like. Apologies in advance for posting in Issues/here.
I'm trying to drive transformations of a
StateModifier
with a separate transparentSurface
- I've spent hours trying to get the secret sauce that ispipe
,on update
,setPosition
,setTransform
, ortransformFrom
without success...template
my attempt (coffeescript)
Lots of great demos that scratch the surface but haven't found anything aside from raw famo.us that gets into more detail. I'm documenting the whole experience from my new user perspective. The tutas-labs work got me started along with PEM--'s great code snippets and other resources but still struggling on what are probably very simple concepts I'm overlooking. Thank you for any assistance.
The text was updated successfully, but these errors were encountered: