Show Posts

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 - hoffa

Pages: 1 ... 17 18 [19] 20 21 22
271
TI-Nspire / Re: Hyena: a simple (Lua) GUI library for the TI-Nspire
« on: August 19, 2011, 12:20:44 pm »
Hmmm, I don't know how I missed this the first time.
Regardless, it looks really epic :)
Any chance you could upload your library code to pastebin or something like that and give us a link to that sometime soon, because, if it's alright with you, I would really love to implement this in Pacman :D
I'll post the current code in less than an hour, got to do some housekeeping and add a few functions. :)

Pretty cool, I might also try a basic window GUI library like this as well.
Also, dragging windows looks rather difficult on the touchpad, maybe you could change instead to holding a button like "ctrl", and pressing 4, 8, 6, or 2 will move the focused window left, up, right or down respectively ?
/suggestion
Actually it's not that difficult to move them around. It looked painful because I moved the window so slowly, and that was because of a small issue (if I moved the cursor too fast, it would ungrab the window). It's fixed now and works pretty well:

272
TI-Nspire / Re: Hyena: a simple (Lua) GUI library for the TI-Nspire
« on: August 19, 2011, 11:41:34 am »
Alright so now I've rewritten a few parts and restructured my code and done other such things.

Here's a small example of a program, it should be pretty straightforward:
Code: [Select]
function win_1_f()
    hyena:drawImage(win_1, hyenaImage, 0, 0)
    hyena:drawString(win_1, "Hello, hyena!", 0, 50)
end

function win_2_f()
    hyena:drawString(win_2, "LOOK AT THESE GODDAMN ANTS", 0, 0)
end

function on.mouseDown(x, y)
    hyena:mouseDown(x, y)
end

function on.mouseUp(x, y)
    hyena:mouseUp(x, y)
end

function on.mouseMove(x, y)
    hyena:mouseMove(x, y)
end

function on.timer()
    timer.stop()
    platform.window:invalidate()
end

initialized = false
function on.paint(gc)
    if not initialized then
        hyena = Hyena(gc)
        win_1 = hyena:createWindow("First window, yay!", 0, 0, 128, 96)
        win_2 = hyena:createWindow("FEELS GOOD MAN", 80, 40, 100, 100)
        hyena:setWindowContentFunction(win_1, win_1_f)
        hyena:setWindowContentFunction(win_2, win_2_f)
        initialized = true
    end
    hyena:drawWindows()
    timer.start(0.01)
end

Which gives (it isn't rendered exactly like that on calc, there are a few very minor differences):

273
TI-Nspire / Re: Hyena: a simple (Lua) GUI library for the TI-Nspire
« on: August 17, 2011, 03:25:49 pm »
Heya Hoffa where have you been? O.O I noticed you stopped posting for over a month recently. D: Nice to see you back now. Also this looks nice. :D
I was working for nearly two months in a landfill in Finland. I was doing the evening shift and spent nearly the whole day shoveling waste over there. Didn't have much nor did I spend much time on the computer during that time.

Great !

You know, you can use a cursor.set("grab") <-- or something like that, I don't remember exactly
when grabbing windows ...

it's all on http://wiki.inspired-lua.org/cursor.set
That's great, didn't know about that. Thanks!

274
TI-Nspire / Re: Hyena: a simple (Lua) GUI library for the TI-Nspire
« on: August 17, 2011, 03:14:05 pm »
I added a short video to show how it works and runs. I can now move and close the windows, and added some content to one of them.

275
TI-Nspire / Hyena: a simple (Lua) GUI library for the TI-Nspire
« on: August 17, 2011, 08:10:29 am »
Hello,

I started a small project of writing in Lua a GUI library for the TI-Nspire. At the moment there's not much; the windows are clickable and the general floating windows thing works.
As everybody loves screenshots, I give you a screenshot:



Also here's a very early video with some content in one of the windows. I can move windows around and close them also (forgot to show that, but it works).



I'm not even sure if it will actually be that useful when I eventually manage to make something usable, but we'll see about that later.
Well that's about it for the moment. :3

276
Lua / Re: window.invalidate
« on: June 17, 2011, 10:02:33 am »
Actually it's not a very practical function, but it's the only way to refresh the screen. It eventually calls on.paint(), meaning it can get quite frustrating if your program needs a lot of refreshes at specific moments.

277
This was quick, but it's going 1.0 now. I fixed a small bug in the title screen (pressing the up arrow in the menu would make the "pixel" in the game change position) that Scout pointed out. The dot is now controlled using either tab or enter (which also means that doing sharp rises when both are pressed is possible), because the arrow key is useless. I initially wanted the player to be able to hold the key, but because the way the OS deals with key signals is crap, it has no advantage. After all tab or enter are also more comfortable and precise. Now the player can return to the title screen at any moment by pressing ctrl + menu. I made some other minor changes and slightly changed the code. This way I have a stable and clean version to work on later. The new download links are on the website.

278
hoffa, could you release the source please? I'd be delighted.
Sorry, didn't notice your message. Sure I will. I also updated the game, so it's up to 0.9 now (fine-tuned the settings some more, made the ranks realistically achievable, now the high score is saved as soon as the pixel hits a wall, added a small readme.txt file). I edited my first post, the new download link is on the website. I also released the source code, as you wished. :)

279
News / Re: Contest Part 2 starts: TI-Nspire Game
« on: June 15, 2011, 09:10:11 am »
Yes, this pleases me, I'm in! I'll start working on my 3D RPG written in Lua right away. o/

280
Lua / Re: Starting Nspire Lua
« on: June 13, 2011, 05:10:44 pm »
Just use the official tool: http://education.ti.com/calculators/downloads/US/Software/Download/en/6840/7896/TI-NspireScriptingTools.zip

Hello world:
Code: [Select]
function on.paint(gc)
    gc:drawString("Hello world!", 0, 0, "top")
end

Here's the documentation for the built-in Nspire functions: http://education.ti.com/downloads/guidebooks/ti-nspire/scripting/TI-NspireScriptingInterface.pdf

It's just stripped-down Lua with some added functions, so it shouldn't be new to you.

If you want sprites, you'll have to convert the images to a special string sequence (their so-called TI.Image format). You can use the 'official' converter (the image serialization button on their scripting tools).

281
You double posted? O.O

But yeah I didn,t notice it, as I didn't see any edit in your other post x.x (and double-posting within 6 hours of the last post is normally not allowed :P).

Thanks for the advice, though. I decided to just mash the key over and over, since it's easier that way. By the way I love the game :D. I planned posting a news soon, but I was busy trying two other calc games as well, which kinda slowed me down, not to mention yesterday I worked 12 hours in a row and had two other news to post X.x
Yeah, sorry my bad. Won't happen again. :)

by me the saving of the highscore still doesn't work... I am not if i am doing something wrong or if its the calculator(CX) or the game itself.
Try quitting the document using Ctrl + W (which is actually the way you really quit a document), it should then ask to save it.

282
Ah ok good.

What about the bug mentionned in my post edit above? (up arrow no longer responds after releasing it the first time). Basically the farthest I can even go is about 20 points or so, because after I moved up once, I can no longer do so again because the game no longer responds to my keypresses.

ActuallY nevemind, I just realized we still had to spam the up arrow to stay somewhat up. Holding it down is less responsive x.x
I somehow feel that you didn't notice my previous message. :*

283
EDIT: Bug report, I can only press the up arrow once. If I release the key, afterward it never detects anymore arrow key holding down again so after my first jump I fall down and die, no matter if I keep the up arrow pressed. ???
You mean when holding the key down? If yes, well then it hasn't got much to do with the program itself, but rather the way the whole OS has been made (or whatever that deals with the key presses). It only starts sending the key signals while you hold the button down after a short delay, and there is, as far as I know, no practical and accurate way of knowing when the button is held down. The controls should be quite sensitive, so just try to get used to pressing the button rather than holding it down (at least until I find a nice way to deal with the issue).

284
This looks nice! Also I like how you use different text fonts for the numbers at the bottom.

Also since the title screen is 16 level grayscale in the first screenshot, how large is it on calc? Somehow I think it must be larger than the entire game, but I could be wrong O.O
Well once the game has been saved, it takes about 16K of space, which is practically nothing. The ZIP compression their format uses does a good job in compressing the picture (and anything for that matter), so no worries there.

285
Okay new update. First of all I changed that depressive title screen into a less depressive one (long live monochrome displays! :3), and now the high score shows up there also. Then I added the "floating walls" to spice up the game, just cruising straight forward in the cave won't be enough anymore. I fine-tuned the settings and cleaned up the chamber of horrors (i.e. source code) into a polished piece of art. Also some slight performance improvements were made. Download link's there now.

Yes it does look good, but it's only decorative.
Of course I prefer games with wonderful graphics rather than text-only games.
The picture is heavier than the code, and I think that's strange... But this is not a big problem.
Well the whole point of graphics is that it's just eye candy. A well-decorated and good-looking dish is always better than the same food in a rusty old barrel.

Pages: 1 ... 17 18 [19] 20 21 22