When running an ndless program nRemote stops responding. The screen disappears and I have to force close the program by using task manager. Is it not compatible with ndless or does ndless block I/O through USB when running a program? [edit]Also, where are the recordings saved?
function on.paint(gc) if screenNeedUpdate then for i=1,2 do for ii=1,5,1 do tile = string.sub(map[i], ii, ii) if tile == "G" then gc:drawImage(tileGrass, tileGrass:width()*ii, tileGrass:height()*i ) end if tile == "W" then gc:drawImage(tileWater, tileWater:width()*ii, tileWater:height()*i) end end end refreshScreen() screenNeedUpdate = false end endWhat I want to do is only update the screen when it is necesarry. I wanted to do this by setting a flag, screenNeedUpdate, with the idea being when this flag is true, that piece of code is executed and if not it isn't. The problem is,when I set the flag to true it paints everything but when set to false everything but on tile in the upper left corner disappears as soon as another key (or anything) happens. [edit] they all disappear, the one staying there was because of wrongly placed code [edit2] solved
For recording/screenshots: You can also use nRemote to capture from your actual hardware: http://ourl.ca/16836 It doesn't work with ndless (at least not for me)
It boots up pretty fast. That's awesome. If it keeps going at this speed, the project will be done in no-time. Keep it up! Any chance of a snapshot download or anything, to show to everyone I know
(knowing it's practically impossible to crack the 2048 bits RSA keys to sign third-party OSes)
2048 bits o.0 On topic: No freaking way! This is so awesome, I don't even have words for it! Really hope this finishes. If only I could help in some way
Maybe with ndless USB support we can have a hook up a hard/flashdrive and use that as filesystem?
Oooh nice! I love mahjong Downloading this right now. Good job! And looking at the screenshots, it seems the problem of distinguishing tiles isn't a very big problem
As for the string, I know is a local joke here, but never cared to read what is really about...
*ElementCoder lost the game
The Game is a mental game in which you try to avoid thinking about The Game. The moment you realize you are playing The Game, you've thought about it and therefore lost. When you lose you have to tell everyone in you direct surroundings that you've lost The Game. The rules are quite simple: 1. Everyone in the world participates in The Game. You cannot not play The Game and you can never stop playing. 2. Whenever you think about The Game, you lose. 3. You have to tell people in your surroundings that you've lost the game.
Are OS 3.1 scripts completely compatible with 3.2? I know 3.0.x ones aren't. I think also instead of Luna you can use the TI-nspire Scripting Tools, but I haven't actually tried it myself.
I believe they are if you state "platform.apilevel = "1.0" on the top of your script, but correct me if i'm wrong.
Is the order of entered code (I am a newbie in Lua generally) important, too (e.g. of class definitions, variable definitions, event handlers)?
Sometimes it is, sometimes it isn't. Variables for example need to be declared before you use them. For example, you cannot do x+1 when you haven't said x=<value> before. But functions sometimes don't necessarily need to be declared before they are called.
InputField = class() -- a class I use to enter input variables
function InputField:init(name,x,y,init_value) self.name = name self.x = x self.y = y self.editor = D2Editor.newRichText() self.editor:move(x+30,y) self.editor:resize(100,28) self.editor:setBorder(1) self.editor:setText(var.recall(name) or (init_value or 0)) -- initially store at construction time: init_value (if defined) or 0 (if not defined) or already stored variable value (if the page is re-entered) var.store(name,self.editor:getText()) end
...
function InputField:storeVariable() -- called by clients like on.loseFocus() function var.store(self.name,self.editor:getText()) end
...
function on.construction() -- create "objects" ... field = {}
field[1] = InputField('er',2,4) field[2] = InputField('ev',2,34) ... end
function on.getFocus() field[1]:setFocus() end
function on.loseFocus() for i = 1, #field do field:storeVariable() end end
The on.construction() function is called once, namely when you open the document. For the other problem, if I understand correctly you'd want to do something like the following, right? users switches to other page>store all entered values>reset values on the other page The on.loseFocus() is called when user input focus is lost (I don't know when that is) May indeed be a bug like jim said, it works fine for me too. Personally if I'd wanted an event to fire when moving to a new page, I'd use on.deactivate() instead.
[edit] I also recommend having a look at the scripting api reference guide by TI http://bit.ly/P4dxnY [edit2] Aww jim you beat me (why did I have to go fetch a drink while typing this comment )