// User definable constraints to apply to all child actors //////////////////
Actor self = Self();
- // LocalSource - The Actors to be moved.
- // self - The ScrollView
-
- // Apply some default constraints to ScrollView.
+ // Apply some default constraints to ScrollView & its bound actors
// Movement + Wrap function
- // TODO: Look into removing some of these constraints
Constraint constraint;
- // MoveScaledActor (scrolling/zooming)
+ // MoveActor (scrolling)
constraint = Constraint::New<Vector3>( Actor::POSITION,
Source( self, mPropertyPosition ),
- Source( self, mPropertyScale ),
- MoveScaledActorConstraint );
- constraint.SetRemoveAction(Constraint::Discard);
- ApplyConstraintToBoundActors(constraint);
-
- // ScaleActor (scrolling/zooming)
- constraint = Constraint::New<Vector3>( Actor::SCALE,
- Source( self, mPropertyScale ),
- ScaleActorConstraint );
+ MoveActorConstraint );
constraint.SetRemoveAction(Constraint::Discard);
ApplyConstraintToBoundActors(constraint);
return current + scrollPositionProperty.GetVector3();
}
-Vector3 MoveScaledActorConstraint(const Vector3& current,
- const PropertyInput& scrollPositionProperty,
- const PropertyInput& scrollScaleProperty)
-{
- return scrollScaleProperty.GetVector3() * (current + scrollPositionProperty.GetVector3());
-}
-
-Vector3 ScaleActorConstraint(const Vector3& current,
- const PropertyInput& scrollScaleProperty)
-{
- return current * scrollScaleProperty.GetVector3();
-}
-
Vector3 WrapActorConstraint(const Vector3& current,
const PropertyInput& actorScaleProperty,
const PropertyInput& actorAnchorPointProperty,
const PropertyInput& scrollPositionProperty);
/**
- * Move-Scaled Actor constraint.
- *
- * Moves an Actor in accordance to scroll position (and scroll scale).
- */
-Vector3 MoveScaledActorConstraint(const Vector3& current,
- const PropertyInput& scrollPositionProperty,
- const PropertyInput& scrollScaleProperty);
-
-/**
- * Scale Actor constraint.
- *
- * Scales an Actor in accordance to scroll scale.
- */
-Vector3 ScaleActorConstraint(const Vector3& current,
- const PropertyInput& scrollScaleProperty);
-
-/**
* Wrap Actor constraint.
*
* Wraps an Actors position in accordance to min/max bounds of domain.