This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - flyingfisch
Pages: 1 ... 56 57 [58] 59 60 ... 119
856
« on: January 06, 2012, 12:27:41 pm »
ow, nice, i was already like O.o, Y U numbers no align??? thanks
test
You're welcome I figured the work-around out a couple days ago.
857
« on: January 06, 2012, 12:01:08 pm »
Oh, ok. So On- Calc lua. ok
858
« on: January 06, 2012, 11:59:46 am »
I have found that if you use code that looks like this: [ code]some code[ /code]
or this: [ code] some code[ /code]
The numbers will turn out wrong. However, doing this type of code: [ code] some code [ /code]
Makes the number aligned, but also adds a new line to the end of the codeblock. Just thought that information would be useful
859
« on: January 06, 2012, 11:42:27 am »
I guess this is why luaFX is called beta right now. I'll have to ask eiyeron to talk to veb about it for me.
860
« on: January 06, 2012, 11:26:25 am »
oclua?
861
« on: January 06, 2012, 11:25:22 am »
Last year I replaced all the windows in my house with that expensive, double-pane, energy efficient kind, and today, I got a call from the contractor who installed them. He was complaining that the work had been completed a whole year ago and I still hadn't paid for them. Just because I'm blonde doesn't mean that I am automatically stupid. So, I told him just what his fast talking sales guy had told me last year, that in ONE YEAR these windows would pay for themselves! Helllooooo? It's been a year! I told him. There was only silence at the other end of the line, so I finally just hung up.He never called back. I bet he felt like an idiot.
862
« on: January 06, 2012, 11:16:45 am »
Well, apparently it did not like the dashes. But now I get another error with this code local print = graydraw.print
class = function(prototype) local derived = {} local derivedMT = { __index = prototype, __call = function(proto, ...) local instance = {} local instanceMT = { __index = derived, __call = function() return nil, "ERROR: Attempt to invoke an instance of a class" end, } setmetatable(instance, instanceMT) if instance.init then instance:init(...) end return instance end, } setmetatable(derived, derivedMT) return derived end
car = class()
function car: init(power, type, lights, etc) self.power = power self.type = type self.lights = lights*2 self.options = etc end
jeep = car(60, "4x4", 12, {airconditioning = false,trailerhook = true}) if jeep.trailerhook then print("The jeep can have a trailer") else print("No trailer for you :(") end
Error message: [string 'experiment.lua']:22: Attempt to call global 'setmetatable', a nil value
863
« on: January 06, 2012, 11:05:07 am »
Bug report!
After procrastinating for a day, i decided to test the lua classes code with this program:
local print = graydraw.print
class = function(prototype) local derived = {} local derivedMT = { __index = prototype, __call = function(proto, ...) local instance = {} local instanceMT = { __index = derived, __call = function() return nil, "ERROR: Attempt to invoke an instance of a class" end, } setmetatable(instance, instanceMT) if instance.init then instance:init(...) end return instance end, } setmetatable(derived, derivedMT) return derived end
car = class()
function car: init(power, type, lights, etc) self.power = power self.type = type self.lights = lights*2 self.options = etc end
jeep = car(60, "4x4", 12, {air-conditioning = False, trailer-hook = True})
if jeep.options.trailer-hook then print("The jeep can have a trailer") else print("No trailer for you :(") end
And....I get an error:
[string 'experiment.lua']:35: '}' expected near '='
So is there a problem with my code, luaFX, or the lua class code?
864
« on: January 06, 2012, 10:33:16 am »
LuaFX is almost exactly the same as lua 5.1. I guess you could make it event based somehow...But yeah, I think you have to do loops
865
« on: January 06, 2012, 10:14:10 am »
certainly, you will only have to use loops to determine if a function needs to be called or not.. luaFX is in loops, isn't it?
As in, it supports loops?
866
« on: January 06, 2012, 10:11:43 am »
i thought he meant functions from your gui jwalker.. here are all the functions standard in nspire lua
Function name Arguments Called when on.paint(gc) GC is the graphical context (explained later) platform.window:invalidate() is called on.arrowKey(arrow) Arrow returns ‘left’,’right’,’up’ or ‘down’ An arrow key had been pressed on.arrowLeft() - The left arrow key has been pressed on.arrowRight() - The right arrow key has been pressed on.arrowUp() - The up arrow key has been pressed on.arrowDown() - The down arrow key has been pressed on.enterKey() - The enter key has been pressed on.escapeKey() - The escape key has been pressed on.tabKey() - The tab key has been pressed on.charIn(char) Char can return any char, e.g. char = ‘+’ Any character key has been pressed on.mouseMove(x,y) x and y return the position of the mouse The mouse moves on.mouseDown(x,y) x and y return the position of the mouse The mouse has been pressed on.mouseUp(x,y) x and y return the position of the mouse The mouse has been released on.create() - The file gets opened (made) on.destroy() - The file gets closed (destroyed) on.resize() - The screen is resized (when in the pc software) on.timer() - The timer is called on.deleteKey() - The delete key has been pressed on.backspaceKey() - The backspace key has been pressed on.returnKey() - The return key has been pressed on.contextMenu() - The [ctrl][menu] key has been pressed on.help() - The [ctrl][trig] has been pressed on.clearKey() - The clear key has been pressed on.activate() - The tab/page gets activated on.deactivate() - The tab/page gets inactivated on.blink() - The focus gets lost on the page
or just go here it's the events part
So yeah, this should be pretty easy to do with classes, right?
867
« on: January 06, 2012, 09:26:40 am »
thats a good idea too, my code only uses one instance of inheritance though, in the form class, do to the fact that the lib is quit large and poeple should be able to choose what code they need and take the other stuff out. this way if they take out some class and some other class had to inherit from it there would be errors. also i might add a control class for the controls to inherit from, but i may not do to the fact im trying to make it smaller and more optimized
OK. Is there a list of on events and their usage?
868
« on: January 06, 2012, 09:19:32 am »
I'm gonna have to take another look at jimbauwens explanation of classes
869
« on: January 06, 2012, 09:18:17 am »
I'm going to take a look at that code
870
« on: January 06, 2012, 09:16:31 am »
im actualy about to upload a prerelease version right now, check in a few miniutes, im using an old crappy school computer so it might take some time
OK. just do
cursortypes = { *cursor image data here* } cursor:init(x,y,type) self.x = x self.y = y self.type = cursortypes[type] end Cursor = cursor(50,50,*number here*)
this way you can add different cursor like we have in nspire, which you can find here it contains a zip with all the cursors in a different image ...
OK, does that code use classes or what? (This is my first major program with lua so please bear with me )
Pages: 1 ... 56 57 [58] 59 60 ... 119
|