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

Support an action to Move characters on screen #418

Open
notexplosive opened this issue Feb 4, 2024 · 1 comment
Open

Support an action to Move characters on screen #418

notexplosive opened this issue Feb 4, 2024 · 1 comment
Labels
feature New feature or request

Comments

@notexplosive
Copy link
Collaborator

Description

Writers want the ability for characters to "fly in" or "fly out" from an arbitrary position (from the left, from the bottom, etc). I think this can be genericized into the ability to displace/move a character.

Acceptance Criteria

This story will be finished when you can use a Narrative Script command to move a character. There will probably need to be two variants (or a parameter on one command)

  • Move a character instantly
  • Move a character over a duration

This way we can for example:

  • Spawn Arin
  • Put Arin off screen instantly (so you don't see him yet)
  • Slide Arin in

Implementation thoughts (not prescriptive):
I think the "default" position should be 0,0. And any offset should be some number of "units" away from the center. That way you'll be able to easily tell if an actor is in the "right" position by moving it to the origin.

@notexplosive notexplosive added the feature New feature or request label Feb 4, 2024
@notexplosive notexplosive added this to the 1.0: Case 2 milestone Feb 4, 2024
@ViMaSter
Copy link
Member

ViMaSter commented Feb 5, 2024

Potential suggestion for the action:

  • &TRANSLATE_CHARACTER:<actor_name>,<durationInSeconds>,<fromDirection>
  • &TRANSLATE_CHARACTER:Arin,2,MiddleLeft (example)

In this scenario the target is wherever the actor was placed using SET_ACTOR_POSITION or ACTOR (based on a scene with multiple slots or without, respectively).


Move a character instantly

That could be handled by SET_ACTOR_POSITION; calling &TRANSLATE_CHARACTER with 0 seconds would not do anything.


The "offset" is a good topic actually:
Right now character sprites always take up the entire screen. Let's say we default to an offset of 1 full viewport:
Actors wouldn't appear for over half of the duration, because they tend to takes up less than half of the screen:

An example of &TRANSLATE_CHARACTER:Arin,2,MiddleLeft
…after 0s:
image
…after 1s:
image
…after 2s:
image
One potential way to resolve this, would be to determine the first non-transparent pixel closest to the viewport in the scroll direction and anchor the actor there:
image
However I feel like this might only work for static images. Either animations would require recalculating the "first non-transparent pixel" in the sprite whenever the animation is played or we'd have to accept that an animation "jumps" into the screen like so:
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants