Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
Scroll Text
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VESPR
Scroll Text
Commits
c965f60d
Commit
c965f60d
authored
Apr 16, 2021
by
Wakefield Morys-Carter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moving
parent
29840c73
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
62 deletions
+52
-62
scroll-text-legacy-browsers.js
scroll-text-legacy-browsers.js
+24
-29
scroll-text.js
scroll-text.js
+24
-29
scroll-text.psyexp
scroll-text.psyexp
+4
-4
No files found.
scroll-text-legacy-browsers.js
View file @
c965f60d
...
...
@@ -272,6 +272,7 @@ var lines;
var
maxScroll
;
var
viewAll
;
var
dragging
;
var
moving
;
var
trialComponents
;
function
trialRoutineBegin
(
snapshot
)
{
return
function
()
{
...
...
@@ -291,6 +292,7 @@ function trialRoutineBegin(snapshot) {
maxScroll
-=
(
round
((
1.6
/
fontSize
))
-
1
);
viewAll
=
0
;
dragging
=
0
;
moving
=
0
;
scrollText
.
setPos
([((
-
0.45
)
*
screenRatio
),
0.45
]);
scrollText
.
setAlignHoriz
(
'left'
);
...
...
@@ -344,48 +346,31 @@ function trialRoutineEachFrame(snapshot) {
if
(((
viewAll
===
1
)
&&
_pj
.
in_es6
(
"space"
,
keys
)))
{
continueRoutine
=
false
;
}
else
{
if
(
(
_pj
.
in_es6
(
"down"
,
keys
)
&&
(
scroll
<
maxScroll
)
))
{
if
(
_pj
.
in_es6
(
"down"
,
keys
))
{
scroll
+=
1
;
scrollText
.
setPos
([((
-
0.45
)
*
screenRatio
),
(
0.45
+
((
scroll
*
fontSize
)
*
1.08
))]);
scrollButton
.
setPos
([(
screenRatio
*
0.475
),
((
trackLength
/
2
)
-
((
trackLength
*
scroll
)
/
maxScroll
))]);
bottomCrop
.
setPos
([((
-
0.1
)
+
(
0.01
*
(
scroll
%
2
))),
(
-
0.475
)]);
continueText
.
setOpacity
((
1
-
(
0.01
*
(
scroll
%
2
))));
moving
=
1
;
}
else
{
if
(
(
_pj
.
in_es6
(
"up"
,
keys
)
&&
(
scroll
>
0
)
))
{
if
(
_pj
.
in_es6
(
"up"
,
keys
))
{
scroll
-=
1
;
scrollText
.
setPos
([((
-
0.45
)
*
screenRatio
),
(
0.45
+
((
scroll
*
fontSize
)
*
1.08
))]);
scrollButton
.
setPos
([(
screenRatio
*
0.475
),
((
trackLength
/
2
)
-
((
trackLength
*
scroll
)
/
maxScroll
))]);
bottomCrop
.
setPos
([((
-
0.1
)
+
(
0.01
*
(
scroll
%
2
))),
(
-
0.475
)]);
continueText
.
setOpacity
((
1
-
(
0.01
*
(
scroll
%
2
))));
moving
=
1
;
}
}
}
}
else
{
if
(
mouse
.
isPressedIn
(
scrollBar
))
{
mouseY
=
mouse
.
getPos
()[
1
];
if
((
mouseY
>
(
trackLength
/
2
)))
{
mouseY
=
(
trackLength
/
2
);
}
else
{
if
((
mouseY
<
((
-
trackLength
)
/
2
)))
{
mouseY
=
((
-
trackLength
)
/
2
);
}
}
scrollButton
.
setPos
([(
screenRatio
*
0.475
),
mouseY
]);
scroll
=
((((
trackLength
/
2
)
-
mouseY
)
*
maxScroll
)
/
trackLength
);
scrollText
.
setPos
([((
-
0.45
)
*
screenRatio
),
(
0.45
+
((
scroll
*
fontSize
)
*
1.08
))]);
bottomCrop
.
setPos
([((
-
0.1
)
+
(
0.01
*
(
scroll
%
2
))),
(
-
0.475
)]);
continueText
.
setOpacity
((
1
-
(
0.01
*
(
scroll
%
2
))));
moving
=
1
;
}
else
{
if
((
mouse
.
getPressed
()[
0
]
===
1
))
{
if
((
dragging
===
0
))
{
dragging
=
1
;
mouseY
=
mouse
.
getPos
()[
1
];
}
else
{
scroll
+=
(((
mouse
.
getPos
()[
1
]
-
mouseY
)
/
fontSize
)
/
1.08
);
scrollText
.
setPos
([((
-
0.45
)
*
screenRatio
),
(
0.45
+
((
scroll
*
fontSize
)
*
1.08
))]);
scrollButton
.
setPos
([(
screenRatio
*
0.475
),
((
trackLength
/
2
)
-
((
trackLength
*
scroll
)
/
maxScroll
))]);
bottomCrop
.
setPos
([((
-
0.1
)
+
(
0.01
*
(
scroll
%
2
))),
(
-
0.475
)]);
continueText
.
setOpacity
((
1
-
(
0.01
*
(
scroll
%
2
))));
scroll
+=
(((
mouse
.
getPos
()[
1
]
-
mouseY
)
*
fontSize
)
*
1.08
);
if
((
scroll
>
maxScroll
))
{
moving
=
1
;
}
}
}
else
{
if
((
dragging
===
1
))
{
...
...
@@ -394,9 +379,19 @@ function trialRoutineEachFrame(snapshot) {
}
}
}
if
(((
scroll
===
maxScroll
)
&&
(
viewAll
===
0
)))
{
viewAll
=
1
;
continueText
.
text
=
"Press space to continue"
;
if
((
moving
===
1
))
{
if
((
scroll
>=
maxScroll
))
{
scroll
=
maxScroll
;
if
((
viewAll
===
0
))
{
viewAll
=
1
;
continueText
.
text
=
"Press space to continue"
;
}
}
scrollText
.
setPos
([((
-
0.45
)
*
screenRatio
),
(
0.45
+
((
scroll
*
fontSize
)
*
1.08
))]);
scrollButton
.
setPos
([(
screenRatio
*
0.475
),
((
trackLength
/
2
)
-
((
trackLength
*
scroll
)
/
maxScroll
))]);
bottomCrop
.
setPos
([((
-
0.1
)
+
(
0.01
*
(
scroll
%
2
))),
(
-
0.475
)]);
continueText
.
setOpacity
((
1
-
(
0.01
*
(
scroll
%
2
))));
moving
=
0
;
}
...
...
scroll-text.js
View file @
c965f60d
...
...
@@ -282,6 +282,7 @@ var lines;
var
maxScroll
;
var
viewAll
;
var
dragging
;
var
moving
;
var
trialComponents
;
function
trialRoutineBegin
(
snapshot
)
{
return
function
()
{
...
...
@@ -301,6 +302,7 @@ function trialRoutineBegin(snapshot) {
maxScroll
-=
(
round
((
1.6
/
fontSize
))
-
1
);
viewAll
=
0
;
dragging
=
0
;
moving
=
0
;
scrollText
.
setPos
([((
-
0.45
)
*
screenRatio
),
0.45
]);
scrollText
.
setAlignHoriz
(
'left'
);
...
...
@@ -353,48 +355,31 @@ function trialRoutineEachFrame(snapshot) {
if
(((
viewAll
===
1
)
&&
_pj
.
in_es6
(
"space"
,
keys
)))
{
continueRoutine
=
false
;
}
else
{
if
(
(
_pj
.
in_es6
(
"down"
,
keys
)
&&
(
scroll
<
maxScroll
)
))
{
if
(
_pj
.
in_es6
(
"down"
,
keys
))
{
scroll
+=
1
;
scrollText
.
setPos
([((
-
0.45
)
*
screenRatio
),
(
0.45
+
((
scroll
*
fontSize
)
*
1.08
))]);
scrollButton
.
setPos
([(
screenRatio
*
0.475
),
((
trackLength
/
2
)
-
((
trackLength
*
scroll
)
/
maxScroll
))]);
bottomCrop
.
setPos
([((
-
0.1
)
+
(
0.01
*
(
scroll
%
2
))),
(
-
0.475
)]);
continueText
.
setOpacity
((
1
-
(
0.01
*
(
scroll
%
2
))));
moving
=
1
;
}
else
{
if
(
(
_pj
.
in_es6
(
"up"
,
keys
)
&&
(
scroll
>
0
)
))
{
if
(
_pj
.
in_es6
(
"up"
,
keys
))
{
scroll
-=
1
;
scrollText
.
setPos
([((
-
0.45
)
*
screenRatio
),
(
0.45
+
((
scroll
*
fontSize
)
*
1.08
))]);
scrollButton
.
setPos
([(
screenRatio
*
0.475
),
((
trackLength
/
2
)
-
((
trackLength
*
scroll
)
/
maxScroll
))]);
bottomCrop
.
setPos
([((
-
0.1
)
+
(
0.01
*
(
scroll
%
2
))),
(
-
0.475
)]);
continueText
.
setOpacity
((
1
-
(
0.01
*
(
scroll
%
2
))));
moving
=
1
;
}
}
}
}
else
{
if
(
mouse
.
isPressedIn
(
scrollBar
))
{
mouseY
=
mouse
.
getPos
()[
1
];
if
((
mouseY
>
(
trackLength
/
2
)))
{
mouseY
=
(
trackLength
/
2
);
}
else
{
if
((
mouseY
<
((
-
trackLength
)
/
2
)))
{
mouseY
=
((
-
trackLength
)
/
2
);
}
}
scrollButton
.
setPos
([(
screenRatio
*
0.475
),
mouseY
]);
scroll
=
((((
trackLength
/
2
)
-
mouseY
)
*
maxScroll
)
/
trackLength
);
scrollText
.
setPos
([((
-
0.45
)
*
screenRatio
),
(
0.45
+
((
scroll
*
fontSize
)
*
1.08
))]);
bottomCrop
.
setPos
([((
-
0.1
)
+
(
0.01
*
(
scroll
%
2
))),
(
-
0.475
)]);
continueText
.
setOpacity
((
1
-
(
0.01
*
(
scroll
%
2
))));
moving
=
1
;
}
else
{
if
((
mouse
.
getPressed
()[
0
]
===
1
))
{
if
((
dragging
===
0
))
{
dragging
=
1
;
mouseY
=
mouse
.
getPos
()[
1
];
}
else
{
scroll
+=
(((
mouse
.
getPos
()[
1
]
-
mouseY
)
/
fontSize
)
/
1.08
);
scrollText
.
setPos
([((
-
0.45
)
*
screenRatio
),
(
0.45
+
((
scroll
*
fontSize
)
*
1.08
))]);
scrollButton
.
setPos
([(
screenRatio
*
0.475
),
((
trackLength
/
2
)
-
((
trackLength
*
scroll
)
/
maxScroll
))]);
bottomCrop
.
setPos
([((
-
0.1
)
+
(
0.01
*
(
scroll
%
2
))),
(
-
0.475
)]);
continueText
.
setOpacity
((
1
-
(
0.01
*
(
scroll
%
2
))));
scroll
+=
(((
mouse
.
getPos
()[
1
]
-
mouseY
)
*
fontSize
)
*
1.08
);
if
((
scroll
>
maxScroll
))
{
moving
=
1
;
}
}
}
else
{
if
((
dragging
===
1
))
{
...
...
@@ -403,9 +388,19 @@ function trialRoutineEachFrame(snapshot) {
}
}
}
if
(((
scroll
===
maxScroll
)
&&
(
viewAll
===
0
)))
{
viewAll
=
1
;
continueText
.
text
=
"Press space to continue"
;
if
((
moving
===
1
))
{
if
((
scroll
>=
maxScroll
))
{
scroll
=
maxScroll
;
if
((
viewAll
===
0
))
{
viewAll
=
1
;
continueText
.
text
=
"Press space to continue"
;
}
}
scrollText
.
setPos
([((
-
0.45
)
*
screenRatio
),
(
0.45
+
((
scroll
*
fontSize
)
*
1.08
))]);
scrollButton
.
setPos
([(
screenRatio
*
0.475
),
((
trackLength
/
2
)
-
((
trackLength
*
scroll
)
/
maxScroll
))]);
bottomCrop
.
setPos
([((
-
0.1
)
+
(
0.01
*
(
scroll
%
2
))),
(
-
0.475
)]);
continueText
.
setOpacity
((
1
-
(
0.01
*
(
scroll
%
2
))));
moving
=
0
;
}
...
...
scroll-text.psyexp
View file @
c965f60d
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment