February 18, 2005
ScriptHost Version 2.9.24.0
'Internal definition of TextOutObject
class TextOutObject
str as String
x as Long
y as Long
sub TextOut (str as String, x as long, y as long)
end class
Function XUScriptPlugin.AddTextOutHandler(ByVal strName As String) As TextOutObject
'This will draw a string on the screen
Sub XUScriptPlugin.RemoveTextOutHandler(ByVal str As String) 'Be sure to free up all
allocated memory
'Some scripting languages do not like referenced variables, so these will compensate:
Function XUScriptHost.GetCursorPosX() As Long 'Gets the mouse X
Function XUScriptHost.GetCursorPosY() As Long 'Gets the mouse Y
Function XUScriptHost.GetCursorButtonLeft() As Boolean 'Gets the mouse LButton
Function XUScriptHost.GetCursorButtonMiddle() As Boolean 'Gets the mouse MButton
Function XUScriptHost.GetCursorButtonRight() As Boolean 'Gets the mouse RButton
'Example of how to use the TextOutObject
Dim TextOutHandler
set TextOutHandler = XUScriptPlugin.AddTextOutHandler("MyTextHandler") 'Assign the
handler a name. It must be unique for each handler
TextOutHandler.TextOut "Hello World",30,30
'Optionally: TextOutHandler.str = "Hello World"
'Optionally: TextOutHandler.x = 30
'Optionally: TextOutHandler.y = 30
Sleep 10000 'Show it on the screen for 10 seconds
XUScriptPlugin.RemoveTextOutHandler "MyTextHandler" 'Remember to free up memory
|