Hi so I have ti nspire problem. Code:
Code:
I script on an editor called Jens' Script Editor (using version 2.2.1). It is an on-calc editor. I am on a clickpad nSpire with CAS OS 3.6 installed, but these problems happen on non CAS and other versions as well.
Basically, the above code, if I use the student software, which has a built in calculator emulator (running version 3.9 but other versions are the same), and am running JSE 2.2.1 on the emulator, the code above will run just fine. The screen refreshes and the "O" will move around the screen.
When running JSE 2.2.1 on-calc, the above code will not update the screen at all, the "O" will stay in place on both OS 3.6 and 3.9. If I add:
"platform.window:invalidate()"
At the end of each on.arrow function, then the screen will update properly. However, on OS 3.9, the screen will refresh after adding the above invalidate command, but it won't erase the old "O". It will only create a string of "O"s along the path you draw.
But on 3.6, adding the invalidate command will cause it to refresh complete correctly, and the "O" will move around without leaving a trail.
Is there anyway to fix the on-calc issue? Or anybody might have an idea why it's even happening? It is the exact same script editor, the only difference is that one instance is on-calc, and the other is the same exact calculator with the same OS version, only difference being that it is emulated.
So why would the emulator refresh correctly and the on-calc wouldn't?
Please and thanks!
Code:
local x=0
local y=0
function on.arrowUp()
y=y-10
end
function on.arrowDown()
y=y+10
end
function on.arrowLeft()
x=x-10
end
function on.arrowRight()
x=x+10
end
function on.paint(gc)
gc:drawString("O",x,y,"top")
end
I script on an editor called Jens' Script Editor (using version 2.2.1). It is an on-calc editor. I am on a clickpad nSpire with CAS OS 3.6 installed, but these problems happen on non CAS and other versions as well.
Basically, the above code, if I use the student software, which has a built in calculator emulator (running version 3.9 but other versions are the same), and am running JSE 2.2.1 on the emulator, the code above will run just fine. The screen refreshes and the "O" will move around the screen.
When running JSE 2.2.1 on-calc, the above code will not update the screen at all, the "O" will stay in place on both OS 3.6 and 3.9. If I add:
"platform.window:invalidate()"
At the end of each on.arrow function, then the screen will update properly. However, on OS 3.9, the screen will refresh after adding the above invalidate command, but it won't erase the old "O". It will only create a string of "O"s along the path you draw.
But on 3.6, adding the invalidate command will cause it to refresh complete correctly, and the "O" will move around without leaving a trail.
Is there anyway to fix the on-calc issue? Or anybody might have an idea why it's even happening? It is the exact same script editor, the only difference is that one instance is on-calc, and the other is the same exact calculator with the same OS version, only difference being that it is emulated.
So why would the emulator refresh correctly and the on-calc wouldn't?
Please and thanks!