From the example you need to init the class and display the scroll bar
This is the core line:
// Get the position of the img1 scrollbar
// and convert to a value to display the img1 image
float img1Pos = hs1.getPos()-width/2;
When you say println(img1Pos); you will see the values
Now use this value before text() command:
translate (0, img1Pos);
text( „Hello“, 22, 100);