[text] swipe

Viewer

  1. {"firstLayout":"","gdVersion":{"build":99,"major":4,"minor":0,"revision":0},"properties":{"adaptGameResolutionAtRuntime":true,"folderProject":false,"orientation":"landscape","packageName":"com.example.gamename","projectUuid":"acd81fe1-8f64-4b8a-b834-997e85bb145a","scaleMode":"linear","sizeOnStartupMode":"adaptHeight","useExternalSourceFiles":false,"version":"1.0.0","name":"Project","author":"","windowWidth":800,"windowHeight":600,"latestCompilationDirectory":"","maxFPS":60,"minFPS":20,"verticalSync":false,"platformSpecificAssets":{},"loadingScreen":{"backgroundColor":0,"backgroundFadeInDuration":0.2,"backgroundImageResourceName":"","gdevelopLogoStyle":"light","logoAndProgressFadeInDuration":0.2,"logoAndProgressLogoFadeInDelay":0.2,"minDuration":1.5,"progressBarColor":16777215,"progressBarHeight":20,"progressBarMaxWidth":200,"progressBarMinWidth":40,"progressBarWidthPercent":30,"showGDevelopSplash":true,"showProgressBar":true},"extensionProperties":[],"platforms":[{"name":"GDevelop JS platform"}],"currentPlatform":"GDevelop JS platform"},"resources":{"resources":[{"alwaysLoaded":false,"file":"https://resources.gdevelop-app.com/assets/pzUH Pack/Characters/Cute Girl/Cute Girl_Idle_13.png","kind":"image","metadata":"","name":"Cute Girl_Idle_13.png","smoothed":true,"userAdded":false,"origin":{"identifier":"https://resources.gdevelop-app.com/assets/pzUH Pack/Characters/Cute Girl/Cute Girl_Idle_13.png","name":"gdevelop-asset-store"}},{"alwaysLoaded":false,"file":"https://resources.gdevelop-app.com/assets/Generic Backgrounds/tiled_Castles Background.png","kind":"image","metadata":"","name":"tiled_Castles Background.png","smoothed":true,"userAdded":true,"origin":{"identifier":"https://resources.gdevelop-app.com/assets/Generic Backgrounds/tiled_Castles Background.png","name":"gdevelop-asset-store"}}],"resourceFolders":[]},"objects":[],"objectsGroups":[],"variables":[],"layouts":[{"b":209,"disableInputWhenNotFocused":true,"mangledName":"New_32scene","name":"New scene","oglFOV":90,"oglZFar":500,"oglZNear":1,"r":209,"standardSortMethod":true,"stopSoundsOnStartup":true,"title":"","v":209,"uiSettings":{"grid":false,"gridB":255,"gridG":180,"gridHeight":32,"gridOffsetX":0,"gridOffsetY":0,"gridR":158,"gridType":"rectangular","gridWidth":32,"snap":true,"windowMask":false,"zoomFactor":0.48999999999999955},"objectsGroups":[],"variables":[],"instances":[{"angle":0,"customSize":false,"height":0,"layer":"","locked":false,"name":"debug","persistentUuid":"bff34c79-892a-4cca-9910-bf6e8c0f9302","width":0,"x":64,"y":63,"zOrder":2,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0,"customSize":true,"height":613,"layer":"","locked":false,"name":"NewObject","persistentUuid":"f89cf6fa-da08-445b-9065-4382a2836deb","width":790,"x":3,"y":-11,"zOrder":0,"numberProperties":[],"stringProperties":[],"initialVariables":[]}],"objects":[{"name":"NewObject","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"Swipe","type":"Swipe::Swipe","Time":0.2,"MinLength":30,"PointStartX":0,"PointStartY":0,"PointEndX":0,"PointEndY":0,"Length":0,"DirectionX":0,"DirectionY":0,"SwipeStart":false,"Angle":0,"Timer":0,"Done":false}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"tiled_Castles Background.png","points":[],"originPoint":{"name":"origine","x":0,"y":0},"centerPoint":{"automatic":true,"name":"centre","x":0,"y":0},"customCollisionMask":[]}]}]}]},{"bold":false,"italic":false,"name":"debug","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Text","font":"","characterSize":80,"color":{"b":0,"g":0,"r":0}}],"events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"Swipe::Swipe::IsDone"},"parameters":["NewObject","Swipe",""],"subInstructions":[]}],"actions":[{"type":{"inverted":false,"value":"TextObject::String"},"parameters":["debug","=","NewObject.Swipe::Average4Direction()"],"subInstructions":[]}],"events":[]}],"layers":[{"ambientLightColorB":32,"ambientLightColorG":0,"ambientLightColorR":0,"followBaseLayerCamera":false,"isLightingLayer":false,"name":"","visibility":true,"cameras":[{"defaultSize":true,"defaultViewport":true,"height":0,"viewportBottom":1,"viewportLeft":0,"viewportRight":1,"viewportTop":0,"width":0}],"effects":[]}],"behaviorsSharedData":[{"name":"Swipe","type":"Swipe::Swipe"}]}],"externalEvents":[],"eventsFunctionsExtensions":[{"author":"@e1e5en","description":"A behavior that detects a swipe being done on the screen, and that gives you information about it, including the direction and the length.\n\nTo begin, attach this behavior to *any object*.\n\nSettings are :\n- Time (s) - duration of the swipe (default value is 0.2s);\n- Min Length (px) - the minimum length that the swipe must have to be considered (default value 100 px).\n\nUse **the condition to check if a swipe** was done. Then you can use **the expressions** to get the swipe values:\n- `StartPointX`, `StartPointY` (Expression) - coordinates of the point where the swipe starts,\n- `EndPointX`, `EndPointY` (Expression) - coordinates of the swipe end point,\n- `Length` (Expression) - the length of the swipe, in pixels,\n- `DirectionX`, `DirectionY` (Expression) - values ​​of the swipe direction vector,\n- `DirectionNormX`, `DirectionNormY` (Expression) - values ​​of the normalized vector of the swipe direction,\n- `Angle` (Expression) - the value of the angle of the direction vector to the zero angle in range (-180, 180),\n- `Average4Direction` (String Expression) - the direction value for 4 sides (UP, DOWN, LEFT, RIGHT). In this case, the “circle” is divided into 4 segments of 90 degrees,\n- `Average8Direction` (String Expression) - the direction value for 8 sides (UP, DOWN, LEFT, RIGHT, UP-LEFT, UP-RIGHT, DOWN-LEFT, DOWN-RIGHT). In this case, the “circle” is divided into 8 segments of 45 degrees.","extensionNamespace":"","fullName":"Swipe Detector","helpPath":"","iconUrl":"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWdlc3R1cmUtc3dpcGUtcmlnaHQiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTAsOUExLDEgMCAwLDEgMTEsOEExLDEgMCAwLDEgMTIsOVYxMy40N0wxMy4yMSwxMy42TDE4LjE1LDE1Ljc5QzE4LjY4LDE2LjAzIDE5LDE2LjU2IDE5LDE3LjE0VjIxLjVDMTguOTcsMjIuMzIgMTguMzIsMjIuOTcgMTcuNSwyM0gxMUMxMC42MiwyMyAxMC4yNiwyMi44NSAxMCwyMi41N0w1LjEsMTguMzdMNS44NCwxNy42QzYuMDMsMTcuMzkgNi4zLDE3LjI4IDYuNTgsMTcuMjhINi44TDEwLDE5VjlNMTIsNEw5LDFWM0gzVjVIOVY3TDEyLDRaIiAvPjwvc3ZnPg==","name":"Swipe","previewIconUrl":"https://resources.gdevelop-app.com/assets/Icons/gesture-swipe-right.svg","shortDescription":"A behavior that detects a swipe being done on the screen, and that gives you information about it, including the direction and the length.","version":"1.0.1","tags":["swipe"],"dependencies":[],"eventsFunctions":[],"eventsBasedBehaviors":[{"description":"Attach the behavior to any object, then use the condition to check if a swipe was done, and expressions to get information about the swipe.","fullName":"Swipe Detector","name":"Swipe","objectType":"","eventsFunctions":[{"description":"","fullName":"","functionType":"Action","name":"doStepPreEvents","private":false,"sentence":"","events":[{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"disabled":false,"folded":false,"name":"Swipe check and calculation","source":"","type":"BuiltinCommonInstructions::Group","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"BuiltinCommonInstructions::And"},"parameters":[],"subInstructions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertySwipeStart"},"parameters":["Object","Behavior"],"subInstructions":[]},{"type":{"inverted":false,"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"inverted":true,"value":"SourisBouton"},"parameters":["","Left"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyTimer"},"parameters":["Object","Behavior",">=","Object.Behavior::PropertyTime()"],"subInstructions":[]}]}]}],"actions":[{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertySwipeStart"},"parameters":["Object","Behavior","no"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyPointEndX"},"parameters":["Object","Behavior","=","MouseX()"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyPointEndY"},"parameters":["Object","Behavior","=","MouseY()"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyDirectionX"},"parameters":["Object","Behavior","=","Object.Behavior::PropertyPointEndX()-Object.Behavior::PropertyPointStartX()"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyDirectionY"},"parameters":["Object","Behavior","=","Object.Behavior::PropertyPointEndY()-Object.Behavior::PropertyPointStartY()"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyLength"},"parameters":["Object","Behavior","=","Object.Behavior::Length()"],"subInstructions":[]}],"events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyLength"},"parameters":["Object","Behavior",">=","Object.Behavior::PropertyMinLength()"],"subInstructions":[]}],"actions":[{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyDone"},"parameters":["Object","Behavior","yes"],"subInstructions":[]}],"events":[]}]}],"parameters":[]},{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"disabled":false,"folded":false,"name":"Timer operation","source":"","type":"BuiltinCommonInstructions::Group","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertySwipeStart"},"parameters":["Object","Behavior"],"subInstructions":[]}],"actions":[{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyTimer"},"parameters":["Object","Behavior","+","TimeDelta()"],"subInstructions":[]}],"events":[]}],"parameters":[]},{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"disabled":false,"folded":false,"name":"Start swipe, clear property","source":"","type":"BuiltinCommonInstructions::Group","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":true,"value":"Swipe::Swipe::PropertySwipeStart"},"parameters":["Object","Behavior"],"subInstructions":[]}],"actions":[],"events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"SourisBouton"},"parameters":["","Left"],"subInstructions":[]},{"type":{"inverted":false,"value":"BuiltinCommonInstructions::Once"},"parameters":[],"subInstructions":[]}],"actions":[{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyPointStartX"},"parameters":["Object","Behavior","=","MouseX()"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyPointStartY"},"parameters":["Object","Behavior","=","MouseY()"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyPointEndX"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyPointEndY"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertySwipeStart"},"parameters":["Object","Behavior","yes"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyLength"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyTimer"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyAngle"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyDirectionX"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyDirectionY"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyDone"},"parameters":["Object","Behavior",""],"subInstructions":[]}],"events":[]}]}],"parameters":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"","fullName":"","functionType":"Action","name":"doStepPostEvents","private":false,"sentence":"","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyDone"},"parameters":["Object","Behavior"],"subInstructions":[]}],"actions":[{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyDone"},"parameters":["Object","Behavior","no"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertySwipeStart"},"parameters":["Object","Behavior","no"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyPointStartX"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyPointStartY"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyPointEndX"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyPointEndY"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyLength"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyTimer"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyAngle"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyDirectionX"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyDirectionY"},"parameters":["Object","Behavior","=","0"],"subInstructions":[]}],"events":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"","fullName":"","functionType":"Action","name":"onDestroy","private":false,"sentence":"","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertySwipeStart"},"parameters":["Object","Behavior","no"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyDone"},"parameters":["Object","Behavior",""],"subInstructions":[]}],"events":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"Check if a swipe was done. Use the expressions to get information about the swipe.","fullName":"Swipe is done","functionType":"Condition","name":"IsDone","private":false,"sentence":"Swipe (detected by _PARAM0_) is done","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyDone"},"parameters":["Object","Behavior"],"subInstructions":[]}],"actions":[{"type":{"inverted":false,"value":"SetReturnBoolean"},"parameters":["True"],"subInstructions":[]}],"events":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"Get the position of the start point of the swipe on the X axis","fullName":"Start point of the swipe X position","functionType":"Expression","name":"StartPointX","private":false,"sentence":"","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"inverted":false,"value":"SetReturnNumber"},"parameters":["Object.Behavior::PropertyPointStartX()"],"subInstructions":[]}],"events":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"Get the position of the start point of the swipe on the Y axis","fullName":"Start point of the swipe Y position","functionType":"Expression","name":"StartPointY","private":false,"sentence":"","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"inverted":false,"value":"SetReturnNumber"},"parameters":["Object.Behavior::PropertyPointStartY()"],"subInstructions":[]}],"events":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"Get the position of the end point of the swipe on the X axis","fullName":"End point of the swipe X position","functionType":"Expression","name":"EndPointX","private":false,"sentence":"","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"inverted":false,"value":"SetReturnNumber"},"parameters":["Object.Behavior::PropertyPointEndX()"],"subInstructions":[]}],"events":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"Get the position of the end point of the swipe on the Y axis","fullName":"End point of the swipe Y position","functionType":"Expression","name":"EndPointY","private":false,"sentence":"","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"inverted":false,"value":"SetReturnNumber"},"parameters":["Object.Behavior::PropertyPointEndY()"],"subInstructions":[]}],"events":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"Get the length of the swipe","fullName":"Length of the swipe","functionType":"Expression","name":"Length","private":false,"sentence":"","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyLength"},"parameters":["Object","Behavior","=","ceil(sqrt(Object.Behavior::PropertyDirectionX() * Object.Behavior::PropertyDirectionX() + Object.Behavior::PropertyDirectionY() * Object.Behavior::PropertyDirectionY()))"],"subInstructions":[]},{"type":{"inverted":false,"value":"SetReturnNumber"},"parameters":["Object.Behavior::PropertyLength()"],"subInstructions":[]}],"events":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"Swipe vector value on Y axis","fullName":"Swipe vector value on Y axis","functionType":"Expression","name":"DirectionY","private":false,"sentence":"","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyLength"},"parameters":["Object","Behavior",">","0"],"subInstructions":[]}],"actions":[{"type":{"inverted":false,"value":"SetReturnNumber"},"parameters":["Object.Behavior::PropertyDirectionY()"],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":true,"value":"Swipe::Swipe::PropertyLength"},"parameters":["Object","Behavior",">","0"],"subInstructions":[]}],"actions":[{"type":{"inverted":false,"value":"SetReturnNumber"},"parameters":["0"],"subInstructions":[]}],"events":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"Swipe vector value on X axis","fullName":"Swipe vector value on X axis","functionType":"Expression","name":"DirectionX","private":false,"sentence":"","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyLength"},"parameters":["Object","Behavior",">","0"],"subInstructions":[]}],"actions":[{"type":{"inverted":false,"value":"SetReturnNumber"},"parameters":["Object.Behavior::PropertyDirectionX()"],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":true,"value":"Swipe::Swipe::PropertyLength"},"parameters":["Object","Behavior",">","0"],"subInstructions":[]}],"actions":[{"type":{"inverted":false,"value":"SetReturnNumber"},"parameters":["0"],"subInstructions":[]}],"events":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"Swipe vector normalized value on X axis","fullName":"Swipe vector normalized value on X axis","functionType":"Expression","name":"DirectionNormX","private":false,"sentence":"","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyLength"},"parameters":["Object","Behavior",">","0"],"subInstructions":[]}],"actions":[{"type":{"inverted":false,"value":"SetReturnNumber"},"parameters":["(1 / Object.Behavior::PropertyLength()) * Object.Behavior::PropertyDirectionX()"],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":true,"value":"Swipe::Swipe::PropertyLength"},"parameters":["Object","Behavior",">","0"],"subInstructions":[]}],"actions":[{"type":{"inverted":false,"value":"SetReturnNumber"},"parameters":["0"],"subInstructions":[]}],"events":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"Swipe vector normalized value on Y axis","fullName":"Swipe vector normalized value on Y axis","functionType":"Expression","name":"DirectionNormY","private":false,"sentence":"","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyLength"},"parameters":["Object","Behavior",">","0"],"subInstructions":[]}],"actions":[{"type":{"inverted":false,"value":"SetReturnNumber"},"parameters":["(1 / Object.Behavior::PropertyLength()) * Object.Behavior::PropertyDirectionY()"],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":true,"value":"Swipe::Swipe::PropertyLength"},"parameters":["Object","Behavior",">","0"],"subInstructions":[]}],"actions":[{"type":{"inverted":false,"value":"SetReturnNumber"},"parameters":["0"],"subInstructions":[]}],"events":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"Get the angle of the swipe","fullName":"Angle of the swipe","functionType":"Expression","name":"Angle","private":false,"sentence":"Get angle _PARAM0_ ","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyAngle"},"parameters":["Object","Behavior","=","AngleBetweenPositions(0, 0, Object.Behavior::PropertyDirectionX(), Object.Behavior::PropertyDirectionY())"],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"inverted":false,"value":"SetReturnNumber"},"parameters":["Object.Behavior::PropertyAngle()"],"subInstructions":[]}],"events":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"Get the swipe average direction (UP, DOWN, LEFT or RIGHT)","fullName":"Average swipe direction (among 4 directions)","functionType":"StringExpression","name":"Average4Direction","private":false,"sentence":"","events":[{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"disabled":false,"folded":false,"name":"Angle calculation","source":"","type":"BuiltinCommonInstructions::Group","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyAngle"},"parameters":["Object","Behavior","=","Object.Behavior::Angle()"],"subInstructions":[]}],"events":[]}],"parameters":[]},{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"disabled":false,"folded":false,"name":"Definition of \"direction state\" (\"circle\" is divided into 4 segments of 90 degrees)","source":"","type":"BuiltinCommonInstructions::Group","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"BuiltinCommonInstructions::And"},"parameters":[],"subInstructions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior","<","-45"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior",">=","-135"],"subInstructions":[]}]}],"actions":[{"type":{"inverted":false,"value":"SetReturnString"},"parameters":["\"UP\""],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"BuiltinCommonInstructions::And"},"parameters":[],"subInstructions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior",">=","45"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior","<","135"],"subInstructions":[]}]}],"actions":[{"type":{"inverted":false,"value":"SetReturnString"},"parameters":["\"DOWN\""],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior",">=","135"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior","<","-135"],"subInstructions":[]}]}],"actions":[{"type":{"inverted":false,"value":"SetReturnString"},"parameters":["\"LEFT\""],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"BuiltinCommonInstructions::And"},"parameters":[],"subInstructions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior",">=","-45"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior","<","45"],"subInstructions":[]}]}],"actions":[{"type":{"inverted":false,"value":"SetReturnString"},"parameters":["\"RIGHT\""],"subInstructions":[]}],"events":[]}],"parameters":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]},{"description":"Get the swipe average direction (UP, DOWN, LEFT, RIGHT, UP-LEFT, UP-RIGHT, DOWN-LEFT or DOWN-RIGHT)","fullName":"Average swipe direction (among 8 directions)","functionType":"StringExpression","name":"Average8Direction","private":false,"sentence":"","events":[{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"disabled":false,"folded":false,"name":"Angle calculation","source":"","type":"BuiltinCommonInstructions::Group","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"inverted":false,"value":"Swipe::Swipe::SetPropertyAngle"},"parameters":["Object","Behavior","=","Object.Behavior::Angle()"],"subInstructions":[]}],"events":[]}],"parameters":[]},{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"disabled":false,"folded":false,"name":"Definition of \"direction state\" (\"circle\" is divided into 8 segments of 45 degrees)","source":"","type":"BuiltinCommonInstructions::Group","events":[{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"BuiltinCommonInstructions::And"},"parameters":[],"subInstructions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior","<","-68"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior",">=","-112"],"subInstructions":[]}]}],"actions":[{"type":{"inverted":false,"value":"SetReturnString"},"parameters":["\"UP\""],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"BuiltinCommonInstructions::And"},"parameters":[],"subInstructions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior",">=","68"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior","<","112"],"subInstructions":[]}]}],"actions":[{"type":{"inverted":false,"value":"SetReturnString"},"parameters":["\"DOWN\""],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior",">=","158"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior","<","-157"],"subInstructions":[]}]}],"actions":[{"type":{"inverted":false,"value":"SetReturnString"},"parameters":["\"LEFT\""],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"BuiltinCommonInstructions::And"},"parameters":[],"subInstructions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior","<","22"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior",">=","-23"],"subInstructions":[]}]}],"actions":[{"type":{"inverted":false,"value":"SetReturnString"},"parameters":["\"RIGHT\""],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"BuiltinCommonInstructions::And"},"parameters":[],"subInstructions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior","<","-112"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior",">=","-158"],"subInstructions":[]}]}],"actions":[{"type":{"inverted":false,"value":"SetReturnString"},"parameters":["\"UP-LEFT\""],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"BuiltinCommonInstructions::And"},"parameters":[],"subInstructions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior","<=","-23"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior",">","-68"],"subInstructions":[]}]}],"actions":[{"type":{"inverted":false,"value":"SetReturnString"},"parameters":["\"UP-RIGHT\""],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"BuiltinCommonInstructions::And"},"parameters":[],"subInstructions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior",">","112"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior","<=","158"],"subInstructions":[]}]}],"actions":[{"type":{"inverted":false,"value":"SetReturnString"},"parameters":["\"DOWN-LEFT\""],"subInstructions":[]}],"events":[]},{"disabled":false,"folded":false,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":false,"value":"BuiltinCommonInstructions::And"},"parameters":[],"subInstructions":[{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior",">","22"],"subInstructions":[]},{"type":{"inverted":false,"value":"Swipe::Swipe::PropertyAngle"},"parameters":["Object","Behavior","<=","68"],"subInstructions":[]}]}],"actions":[{"type":{"inverted":false,"value":"SetReturnString"},"parameters":["\"DOWN-RIGHT\""],"subInstructions":[]}],"events":[]}],"parameters":[]}],"parameters":[{"codeOnly":false,"defaultValue":"","description":"Object","longDescription":"","name":"Object","optional":false,"supplementaryInformation":"","type":"object"},{"codeOnly":false,"defaultValue":"","description":"Behavior","longDescription":"","name":"Behavior","optional":false,"supplementaryInformation":"Swipe::Swipe","type":"behavior"}],"objectGroups":[]}],"propertyDescriptors":[{"value":"0.200","type":"Number","label":"Time (s)","description":"","extraInformation":[],"hidden":false,"name":"Time"},{"value":"100","type":"Number","label":"Min Length (px)","description":"","extraInformation":[],"hidden":false,"name":"MinLength"},{"value":"0","type":"Number","label":"","description":"","extraInformation":[],"hidden":true,"name":"PointStartX"},{"value":"0","type":"Number","label":"","description":"","extraInformation":[],"hidden":true,"name":"PointStartY"},{"value":"0","type":"Number","label":"","description":"","extraInformation":[],"hidden":true,"name":"PointEndX"},{"value":"0","type":"Number","label":"","description":"","extraInformation":[],"hidden":true,"name":"PointEndY"},{"value":"0","type":"Number","label":"","description":"","extraInformation":[],"hidden":true,"name":"Length"},{"value":"0","type":"Number","label":"","description":"","extraInformation":[],"hidden":true,"name":"DirectionX"},{"value":"0","type":"Number","label":"","description":"","extraInformation":[],"hidden":true,"name":"DirectionY"},{"value":"","type":"Boolean","label":"","description":"","extraInformation":[],"hidden":true,"name":"SwipeStart"},{"value":"0","type":"Number","label":"","description":"","extraInformation":[],"hidden":true,"name":"Angle"},{"value":"0","type":"Number","label":"","description":"","extraInformation":[],"hidden":true,"name":"Timer"},{"value":"","type":"Boolean","label":"","description":"","extraInformation":[],"hidden":true,"name":"Done"}]}]}],"externalLayouts":[],"externalSourceFiles":[]}

Editor

You can edit this paste and save as new:


File Description
  • swipe
  • Paste Code
  • 09 Aug-2021
  • 38.55 Kb
You can Share it: