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

Fading fades everything, should only fade the specified Entity. #18

Open
EriKWDev opened this issue Dec 11, 2021 · 1 comment
Open

Fading fades everything, should only fade the specified Entity. #18

EriKWDev opened this issue Dec 11, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@EriKWDev
Copy link
Owner

Example:

import nanim

proc myScene(): Scene =
  let
    scene = newScene()
    dot1 = newDot(100)
    dot2 = newDot(100)

  scene.add(dot1, dot2)

  dot1.moveTo(200, 500)
  dot2.moveTo(800, 500)

  scene.play(dot1.fadeOut())
  scene.play(dot2.fadeOut())

  return scene

when isMainModule:
  render(myScene)

I expect first dot1 to fadeOut, then dot2 to follow. Currently, both fades out at the same time:
fade

@EriKWDev EriKWDev added the bug Something isn't working label Dec 11, 2021
@EriKWDev
Copy link
Owner Author

Found it.

in init(entity: Entity) I use the defaultStyle, which for some reason causes it to be mutated within the interpolations. By changing it to be defaultStlye.deepCopy() in the initialization this is fixed. Will be included in next version bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant