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
6e673674
Commit
6e673674
authored
May 22, 2021
by
Wakefield Morys-Carter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added text text_2
parent
3602323d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
5 deletions
+79
-5
scroll-text-legacy-browsers.js
scroll-text-legacy-browsers.js
+26
-1
scroll-text.js
scroll-text.js
+26
-1
scroll-text.psyexp
scroll-text.psyexp
+27
-3
No files found.
scroll-text-legacy-browsers.js
View file @
6e673674
...
...
@@ -94,6 +94,7 @@ var scrollBar;
var
scrollButton
;
var
bottomCrop
;
var
continueText
;
var
text_2
;
var
endClock
;
var
text
;
var
globalClock
;
...
...
@@ -172,6 +173,17 @@ function experimentInit() {
depth
:
-
6.0
});
text_2
=
new
visual
.
TextStim
({
win
:
psychoJS
.
window
,
name
:
'text_2'
,
text
:
' '
,
font
:
'Arial'
,
units
:
undefined
,
pos
:
[
0.4
,
0.4
],
height
:
0.1
,
wrapWidth
:
undefined
,
ori
:
0
,
color
:
new
util
.
Color
(
'red'
),
opacity
:
1
,
depth
:
-
7.0
});
// Initialize components for Routine "end"
endClock
=
new
util
.
Clock
();
text
=
new
visual
.
TextStim
({
...
...
@@ -298,7 +310,8 @@ function trialRoutineBegin(snapshot) {
moving
=
0
;
scrollText
.
setPos
([((
-
0.45
)
*
screenRatio
),
0.45
]);
maxScroll
-=
round
(
1.4
/
fontSize
)
+
19
;
maxScroll
-=
round
(
1.4
/
fontSize
);
maxScroll
+=
19
;
//.04 => 39 but needs to be 20
//.03 => 52
//.02 => 79 but needs to be 99
...
...
@@ -311,6 +324,7 @@ function trialRoutineBegin(snapshot) {
trialComponents
.
push
(
scrollButton
);
trialComponents
.
push
(
bottomCrop
);
trialComponents
.
push
(
continueText
);
trialComponents
.
push
(
text_2
);
trialComponents
.
forEach
(
function
(
thisComponent
)
{
if
(
'status'
in
thisComponent
)
...
...
@@ -401,6 +415,7 @@ function trialRoutineEachFrame(snapshot) {
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
))));
text_2
.
text
=
((
scroll
.
toString
()
+
" of "
)
+
maxScroll
.
toString
());
moving
=
0
;
}
...
...
@@ -454,6 +469,16 @@ function trialRoutineEachFrame(snapshot) {
continueText
.
setAutoDraw
(
true
);
}
// *text_2* updates
if
(
t
>=
0.0
&&
text_2
.
status
===
PsychoJS
.
Status
.
NOT_STARTED
)
{
// keep track of start time/frame for later
text_2
.
tStart
=
t
;
// (not accounting for frame time here)
text_2
.
frameNStart
=
frameN
;
// exact frame index
text_2
.
setAutoDraw
(
true
);
}
// check for quit (typically the Esc key)
if
(
psychoJS
.
experiment
.
experimentEnded
||
psychoJS
.
eventManager
.
getKeys
({
keyList
:[
'escape'
]}).
length
>
0
)
{
return
quitPsychoJS
(
'The [Escape] key was pressed. Goodbye!'
,
false
);
...
...
scroll-text.js
View file @
6e673674
...
...
@@ -105,6 +105,7 @@ var scrollBar;
var
scrollButton
;
var
bottomCrop
;
var
continueText
;
var
text_2
;
var
endClock
;
var
text
;
var
globalClock
;
...
...
@@ -183,6 +184,17 @@ function experimentInit() {
depth
:
-
6.0
});
text_2
=
new
visual
.
TextStim
({
win
:
psychoJS
.
window
,
name
:
'text_2'
,
text
:
' '
,
font
:
'Arial'
,
units
:
undefined
,
pos
:
[
0.4
,
0.4
],
height
:
0.1
,
wrapWidth
:
undefined
,
ori
:
0
,
color
:
new
util
.
Color
(
'red'
),
opacity
:
1
,
depth
:
-
7.0
});
// Initialize components for Routine "end"
endClock
=
new
util
.
Clock
();
text
=
new
visual
.
TextStim
({
...
...
@@ -308,7 +320,8 @@ function trialRoutineBegin(snapshot) {
moving
=
0
;
scrollText
.
setPos
([((
-
0.45
)
*
screenRatio
),
0.45
]);
maxScroll
-=
round
(
1.4
/
fontSize
)
+
19
;
maxScroll
-=
round
(
1.4
/
fontSize
);
maxScroll
+=
19
;
//.04 => 39 but needs to be 20
//.03 => 52
//.02 => 79 but needs to be 99
...
...
@@ -321,6 +334,7 @@ function trialRoutineBegin(snapshot) {
trialComponents
.
push
(
scrollButton
);
trialComponents
.
push
(
bottomCrop
);
trialComponents
.
push
(
continueText
);
trialComponents
.
push
(
text_2
);
for
(
const
thisComponent
of
trialComponents
)
if
(
'status'
in
thisComponent
)
...
...
@@ -410,6 +424,7 @@ function trialRoutineEachFrame(snapshot) {
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
))));
text_2
.
text
=
((
scroll
.
toString
()
+
" of "
)
+
maxScroll
.
toString
());
moving
=
0
;
}
...
...
@@ -463,6 +478,16 @@ function trialRoutineEachFrame(snapshot) {
continueText
.
setAutoDraw
(
true
);
}
// *text_2* updates
if
(
t
>=
0.0
&&
text_2
.
status
===
PsychoJS
.
Status
.
NOT_STARTED
)
{
// keep track of start time/frame for later
text_2
.
tStart
=
t
;
// (not accounting for frame time here)
text_2
.
frameNStart
=
frameN
;
// exact frame index
text_2
.
setAutoDraw
(
true
);
}
// check for quit (typically the Esc key)
if
(
psychoJS
.
experiment
.
experimentEnded
||
psychoJS
.
eventManager
.
getKeys
({
keyList
:[
'escape'
]}).
length
>
0
)
{
return
quitPsychoJS
(
'The [Escape] key was pressed. Goodbye!'
,
false
);
...
...
scroll-text.psyexp
View file @
6e673674
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