Skip to content
This repository has been archived by the owner on Aug 15, 2020. It is now read-only.
Robert Yang edited this page Aug 21, 2018 · 17 revisions
  • for core Yarn and YarnSpinner commands, consult YarnSpinner documentation
  • this wiki just covers the extra Yarn commands implemented by Ropework
  • Ropework Yarn commands follows syntax <<(command) @ (parameters)>> (the RopeworkManager is a GameObject named "@")

double check your sprite import settings

  • for reference, the example character sprites are about 600 x 1200 pixels... its import settings look like:
    • Texture Type: Sprite
    • Pixels Per Unit: 165 (you should try different numbers to see what works)
    • Pivot: Bottom

example Ropework Yarn script

is in Assets/Ropework/examples/yarnScripts/RopeworkSimpleExample.yarn.txt

basic Ropework Yarn commands

HOW TO READ THIS: for example, with <<Show @ (spriteName), (x=0.5), (y=0.5)>>, the "=0.5" is a default value used if you don't specify a number yourself

<<Scene @ (spriteName)>>

set background image to (spriteName)

<<Show @ (spriteName), (x=0.5), (y=0.5)>>

show (spriteName) at (x,y) in normalized screenspace (0.0-1.0)

  • 0.0 is like 0% left / bottom of screen, 1.0 is like 100% right / top of screen
  • for x or y, you can also use keywords like "right", "upper", "top" (0.75) or "middle", "center" (0.5) or "left", "lower", "bottom" (0.25)
  • when x and/or y are omitted (e.g. <<Show @ TreeSprite>>) then they default to values of 0.5... thus, omitting both x and y would set the position to (0.5, 0.5) in normalized screenspace (center of the screen)

<<Hide @ (actorOrSpriteName)>>

hide any actor called (actorOrSpriteName), or any sprites called (actorOrSpriteName)

<<HideAll @>>

hides all sprites and actors, takes no parameters

<<Act @ (actorName), (spriteName), (x=0.5), (y=0.5), (HTMLcolor=black) >>

very useful... kind of like <<Show>> except it also has (actorName), which links the sprite to that actorName

  • anytime a character named (actorName) talks in a Yarn script, this sprite will automatically highlight
  • also good for changing expressions, e.g. calling <<Act @ Dog,dog_happy,left>> and then <<Act @ Dog,dog_sad>> will change the Dog's sprite and preserve its positioning... this is better than tediously calling <<Show @ dog_happy>> and then <<Hide @ dog_happy>> and then <<Show @ dog_sad>>
  • (HTMLcolor) is a web hex color (like "#ffffff") or a common color keyword (like "white")... here, it affects the color of the name label in Ropework's ClassicDialogueUI, but I suppose you could use it for anything

visual effects

<<Flip @ (actorOrSpriteName)>>

horizontally flips an actor or sprite, in case you need to make your characters look around or whatever

<<Move @ (actorOrSpriteName), (xPosition), (yPosition), (moveTime)>>

animates / slides an actor or sprite toward a new position, good for animating walking or running

  • (moveTime) is how long it will take to move from current position to new position, in seconds
  • for notes on (xPosition) and (yPosition), see entry for <<Show>> above
  • KNOWN BUG: not recommended to use this at the same time as a <<Shake>> call... let the previous call finish, first

<<Shake @ (actorOrSpriteName),(shakeTime=0.5)>>

shakes an actor or a sprite, good for when someone is surprised or angry or laughing

  • if shakeTime isn't specified, the default value 0.5 means "shake this object at 50% strength for 0.5 seconds"
  • a shakeTime=1.0 means "shake this object at 100% for 1.0 seconds", and so on
  • KNOWN BUG: not recommended to use this at the same time as a <<Move>> call... let the previous call finish, first

<<Fade @ (HTMLcolor=black), (startOpacity=0.0), (endOpacity=1.0), (fadeTime=1.0)>>

fades the screen to a certain color, could be a fade in or a fade out depending on how you use it

  • startOpacity and endOpacity are numbers 0.0-1.0 (like 0%-100%)
  • by default with no parameters (<<Fade @>>) will fade to black over 1.0 seconds
  • (HTMLcolor) is a web hex color (like "#ffffff") or a common color keyword (like "white")

<<FadeIn @ (fadeTime=1.0)>>

useful shortcut for fading in, no matter what the previous fade settings were... equivalent to calling something like <<Fade @ black, -1, 0.0, 1.0>> (where startOpacity=-1 means it will reuse the last fade command's colors and opacity)

audio playback

<<PlayAudio @ (audioClipName),(volume),("loop")>>

plays an audio clip named (audioClipName) at volume (0.0-1.0)

  • if "loop" is present, it will loop the audio repeatedly until stopped; otherwise, the sound will end automatically

<<StopAudio @ (audioClipName)>>

stop playing any active audio clip named (audioClipName)

<<StopAudioAll @>>

stops playing all sounds, no parameters