You should create a text object, then pass the integer to it as a string using Str(). See below:
SetVirtualResolution(GetDeviceWidth(), GetDeviceHeight())
// Set default integer value
intVal = 25
// Initialize text string for showing integer
txtString = CreateText(Str(intVal))
SetTextSize(txtString, 24)
SetTextPosition(txtString, 50, 50)
SetTextColor(txtString, 0, 255, 0, 255)
// Main Loop
Do
// Change integer value on press
If GetPointerPressed()
// Set to random number
intVal = Random(0, 500)
// Update text string
SetTextString(txtString, Str(intVal))
Endif
Sync()
Loop
This will position an integer value at (50, 50) and will update the integer when you click the mouse or tap your finger on the screen. There are also text alignment options that can be used as needed.