Skip to content

feat: add ease and write default argument#705

Merged
MakinoharaShoko merged 2 commits intoOpenWebGAL:devfrom
HardyNLee:feat-add-ease-arg
Jun 7, 2025
Merged

feat: add ease and write default argument#705
MakinoharaShoko merged 2 commits intoOpenWebGAL:devfrom
HardyNLee:feat-add-ease-arg

Conversation

@HardyNLee
Copy link
Copy Markdown
Contributor

@HardyNLee HardyNLee commented Jun 4, 2025

介绍

-ease 缓动类型

  • changeFigure changeBg setTransform 添加 缓动 参数
    • 语法: -ease=easeType 其中 easeType 可为
      • linear
      • anticipate
      • easeIn
      • easeOut
      • easeInOut (默认值)
      • circIn
      • circOut
      • circInOut
      • backIn
      • backOut
      • backInOut
      • bounceIn
      • bounceOut
      • bounceInOut
  • 用户可以在自定义 animation 里添加 ease: string 属性, 例如:
[
  {
    "scale": {
      "x": 1,
      "y": 1
    },
    "duration": 0
  },
  {
    "scale": {
      "x": 1.15,
      "y": 1.15
    },
    "duration": 2000,
    "ease": "easeOut"
  },
  {
    "scale": {
      "x": 1,
      "y": 1
    },
    "duration": 2000,
    "ease": "linear"
  }
]

close #643

-writeDefault 写入默认 transform

setTransform setAnimation setTempAnimation 添加 写入默认值 参数
语法: -writeDefault -writeDefault=true -writeDefault=false
当值为 true 时, 没有填写的 ITransform 属性会从 baseTransform 找值
当值为 false 时, 没有填写的 ITransform 属性会继承当前 ITransform 的终值

注意: setTransform 现在和 setAnimation 一样, 默认是会继承数值的,如果需要适配旧工程, 则需要为所有 setTransform 加上 -writeDefault, 其行为跟以前是一样的

close #618

timeline: Array<ITransform & { duration: number, ease: string }>,
targetKey: string,
duration: number,
ease: string,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里参数传入了 ease,timeline 里又有 ease,是否有一个多余?并且我看也只用到了传入参数的 ease,是否 timeline 的 ease 是无必要的,并且 AnimationFrame 中的 ease 也是无必要的?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里参数传入了 ease,timeline 里又有 ease,是否有一个多余?并且我看也只用到了传入参数的 ease,是否 timeline 的 ease 是无必要的,并且 AnimationFrame 中的 ease 也是无必要的?

已 force push

export interface IUserAnimation {
name: string;
effects: Array<ITransform & { duration: number }>;
effects: Array<ITransform & { duration: number, ease: string }>;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里有用到吗

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@HardyNLee HardyNLee force-pushed the feat-add-ease-arg branch from b564a2a to 3ff0ebd Compare June 5, 2025 15:25
feat: add ease arg
feat: add write default arg
@HardyNLee HardyNLee force-pushed the feat-add-ease-arg branch from 7803b22 to 2880ba4 Compare June 6, 2025 15:26
@HardyNLee HardyNLee changed the title feat: add ease argument feat: add ease and write default argument Jun 6, 2025
@HardyNLee
Copy link
Copy Markdown
Contributor Author

在最新的提交中已修改 ease 参数的位置, 并添加了新的 writeDefault 参数, 详情见一楼

@MakinoharaShoko MakinoharaShoko merged commit 54aadf6 into OpenWebGAL:dev Jun 7, 2025
1 check passed
KonshinHaoshin pushed a commit to KonshinHaoshin/WebGAL_Eastmount that referenced this pull request Nov 7, 2025
feat: add ease and write default argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants