Very strange... I was having issues getting OpenToWrite working in any capacity. It wasn't even writing to the My Documents folder (although it did create the AGK\app\Media folder), so I decided to try SetRawWritePath to force it to write somewhere else. This worked for the debug stuff I was trying to output... but then my virtual buttons didn't show graphics anymore! The text is still there and they still function, but no button boxes.
SetVirtualResolution( 1024, 768 )
// set debug properties
SetRawWritePath("c:\dropbox\app\RPG")
if getFileExists( "debug.txt" ) then deleteFile( "debug.txt" )
Global ButtonUp = 1
AddVirtualButton(buttonUp, 300, 300, 100)
SetVirtualButtonColor(buttonUp,255,255,0)
SetVirtualButtonText(buttonUp,"Up")
SetVirtualButtonVisible(buttonUp,1)
Global ButtonRight = 2
AddVirtualbutton(ButtonRight, 500, 500, 100)
SetVirtualbuttonColor(buttonRight,255,255,0)
SetVirtualbuttonText(buttonRight,"Right")
SetVirtualbuttonVisible(buttonRight,2)
Global ButtonDown = 3
AddVirtualButton(ButtonDown, 300, 700, 100)
SetVirtualButtonColor(buttonDown,255,255,0)
SetVirtualButtonText(buttonDown,"Down")
SetVirtualButtonVisible(buttonDown,3)
Global ButtonLeft = 4
AddVirtualButton(ButtonLeft, 100, 500, 100)
SetVirtualButtonColor(buttonLeft,255,255,0)
SetVirtualButtonText(buttonLeft,"Left")
SetVirtualButtonVisible(buttonLeft,4)
do
Input()
Print( ScreenFPS() )
Sync()
loop
function Input()
local inputReceived as integer
inputReceived = 0
if GetVirtualButtonState(ButtonUp)=1
SetViewOffset(GetViewOffsetX(),GetViewOffsetY()-5)
inputReceived = 1
endif
if GetVirtualButtonState(ButtonRight)=1
SetViewOffset(GetViewOffsetX()+5,GetViewOffsetY())
inputReceived = 1
endif
if GetVirtualButtonState(ButtonDown)=1
SetViewOffset(GetViewOffsetX(),GetViewOffsetY()+5)
inputReceived = 1
endif
if GetVirtualButtonState(ButtonLeft)=1
SetViewOffset(GetViewOffsetX()-5,GetViewOffsetY())
inputReceived = 1
endif
endfunction inputReceived
What's even stranger is this only happens if I call SetRawWritePath BEFORE I set up the buttons, as I did above. Move that code to after it and the buttons have no problems. Now I'm nervous to keep this command in the code.
Anyone else see this?