Animation.skew

解释: 对 X、Y 轴坐标进行倾斜

方法参数

Number ax,Number ay

参数说明

参数范围-180~180;一个参数时, Y 轴坐标不变, X 轴坐标延顺时针倾斜 ax 度;两个参数时,分别在 X 轴倾斜 ax 度,在 Y 轴倾斜 ay 度。

示例

在开发者工具中预览效果

扫码体验

Animation.skew - 图1请使用百度APP扫码

图片示例

Animation.skew - 图2

Animation.skew - 图3

Animation.skew - 图4

代码示例

  1. <view class="wrap">
  2. <view class="animation-element-wrapper">
  3. <view class="animation-element" animation="{{animation}}"></view>
  4. </view>
  5. <view class="card-area">
  6. <view class="top-description border-bottom">展示动画</view>
  7. <button type="primary" bindtap="skew">skew</button>
  8. </view>
  9. </view>
  1. Page({
  2. data:{ },
  3. onReady() {
  4. this.animation = swan.createAnimation({
  5. transformOrigin: "50% 50%",
  6. duration: 1000,
  7. timingFunction: "ease",
  8. delay: 0
  9. })
  10. },
  11. skew() {
  12. this.animation.skew(Math.random() * 90, Math.random() * 90).step()
  13. this.setData({animation: this.animation.export()})
  14. }
  15. });