Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add actions to tween effect properties #5993

Merged
merged 13 commits into from
Dec 4, 2023
Merged

Add actions to tween effect properties #5993

merged 13 commits into from
Dec 4, 2023

Conversation

D8H
Copy link
Collaborator

@D8H D8H commented Dec 2, 2023

It can be useful for:

  • Changing fog and lighting progressively
  • Animating UI
  • Flashing objects
  • Thunder effect
  • Animating a camera focus

Changes

  • Allow to get effect property values from JS
  • Filter enumerated instructions according to the object behaviors
    • Effect tweens only appear for objects that handle effects
    • It could be use for 3D tweens as well one day
  • Improve effects type declaration
  • Reorganize tween code files

@D8H D8H marked this pull request as ready for review December 4, 2023 10:27
@D8H D8H requested a review from 4ian as a code owner December 4, 2023 10:27
@D8H
Copy link
Collaborator Author

D8H commented Dec 4, 2023

Quick check of the effect example:

image

duration,
easing,
linearInterpolation,
effect ? effect.getDoubleParameter(propertyName) : 0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this error if there is no effect?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you you think I should add an error log?
I'm not sure if it's necessary because it's a drop-down list in the UI (though it's missing for object effects)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know. I guess we don't want the game to crash but an log could be useful for debugging purposes

@@ -1,6 +1,10 @@
// @ts-nocheck - TODO: fix typings in this file
Copy link
Collaborator

Choose a reason for hiding this comment

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

💜

@@ -47,11 +47,22 @@ namespace gdjs {
1
);
}
getDoubleParameter(filter: PIXI.Filter, parameterName: string): number {
return filter.uniforms[parameterName] || 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

No if statements here either?

Copy link
Collaborator

@AlexandreSi AlexandreSi left a comment

Choose a reason for hiding this comment

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

OK to merge with the error log should the effect miss

@D8H D8H merged commit 423f15b into master Dec 4, 2023
6 checks passed
@D8H D8H deleted the effect-tween branch December 4, 2023 14:25
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