I was able to do what you said with this code:
// Constants
#constant SCREEN = 1
// Globals
global over = 0
global x# = 0
global y# = 0
global x_center = 0
global y_center = 0
// Init Function
game_init()
// Main Loop
do
game_update()
game_draw()
if over = 1
exit
endif
loop
// Function: Game Init
Function game_init()
// Setup sprite background
LoadImage(1, "space_background128.png")
SetImageWrapU( 1, 1 )
SetImageWrapV( 1, 1 )
CreateSprite(SCREEN,1)
SetSpritePosition(SCREEN,0,0)
// Setup Joystick
AddVirtualJoystick( 1, 10, 90, 20 )
SetVirtualJoystickVisible(1,1)
// Setup Print Text Color
SetPrintColor(0, 0, 0)
EndFunction
// Function: Game Update
Function game_update()
// Set scrolling background
SetSpriteUVOffset( SCREEN, x#/100, y#/100 )
// Check x not 0
if GetVirtualJoystickX(1) > 0 or GetVirtualJoystickX(1) < 0
x# = x# + (GetVirtualJoystickX(1)*5)
endif
// Check y not 0
If GetVirtualJoystickY(1) > 0 or GetVirtualJoystickY(1) < 0
y# = y# + (GetVirtualJoystickY(1)*5)
Endif
EndFunction
// Function : Game Draw
Function game_draw()
Print("x: " + Str(x#))
Print("y: " + Str(y#))
print("Joystick x: " + str(GetVirtualJoystickX(1)))
Sync()
EndFunction
The image file is attached.
Thanks for your help!