![]() |
keys/game library
Hi,
I'm using "keys" lib. As far as i know, it is the same as 'game' lib, or at least very similar. Now i have a fallowing problem: some old commands like repaint; or GetKeyClicked; doesn't work any longer. How to fix that? And what exactly does [lib].init and [lib].show commands? Thanks. |
Ответ: keys/game library
Use Lib_keys, which is placed here
http://forum.boolean.name/showpost.p...93&postcount=2 It use standard MP canvas, so standard graphic functions must work. Note that this library work only in MIDP 2.0 FullScreen mode. |
Ответ: keys/game library
Didn't work.
Using this lib, the game don't even run. |
Ответ: keys/game library
Set MIDlet type: MIDP2.0 Fullscreen to fix this problem.
|
Ответ: keys/game library
Already got it :/ Nothing. Should I add lib_keys.java file to project resources as well?
What about that "GetKeyClicked" things? Any idea how to fix that? |
Ответ: keys/game library
Adding lib_keys.java to project is not necessary, this is just library source file.
Possible, there is another errors in your code, because this library work (I successfully built and run simple test project using this library). |
Ответ: keys/game library
I don't know. What version of MIDletPascal you use? I'm working with 3.1.
I'll try to be more precise: When using "my" lib_keys (1,91KB ) - game complies, and run. Some commands like GetKeyKlicked or Repaint does nothing however. In some cases they can be replaced. For example, Repaint can be easily replaced with keys.refresh, but the original function just do nothing. When using "your" lib_keys (310B )- game complies, and run. However i have blank white screen only. |
Ответ: keys/game library
MP 3.1 is very unstable yet, so that use MP 2.0.2 version.
Please attach your lib_keys.class file. |
Ответ: keys/game library
Here you go:
http://www.sendspace.com/file/k7ihyn As i said before. All i need is to make those "standard" commands like GetKeyClicked; or Repaint; working. On all other sides, the lib works fine. |
Ответ: keys/game library
This version uses its own canvas, so standard canvas functions are not available. You should use Lib_keys.refresh() method to update display buffer instead of standard repaint function. Functions GetKeyClicked and GetKeyPressed are not available for the same reason. But standard drawing functions (i.e. DrawText) must work.
|
Ответ: keys/game library
I understand. What are you proposing me to do then? I can switch lib for that 310B instead of my 1,91KB, but as i said - i have blank screen then, for unknown reason. It looks like once executed the program freeze when reaching keys.init; keys.show; lines. Are instructions before that lines works fine.
|
Ответ: keys/game library
Use 1,91KB version, replacing Repaint by refresh.
|
Ответ: keys/game library
What about GetKeyClicked? I critically need it.
lib_keys allow me only to do this: key:integer; if (keys.get_bit(key, FIRE_PRESSED) <> 0) then pause; but that function is checking if the button is PRESSED, not CLICKED. For example: I set the game to "pause" by clicking FIRE, and when paused - second click to "unpause". The effect is, that when i press FIRE (for 0.5s) the game begin to RAPIDLY pause,unpause,pause,unpause :/ Other example: I made a slide-show intro, when slides are changed by clicking fire (1 click - 1 slide). But when i press it just for a half of second, i rapidly skip all of them. One more thing: As far as I know (might me wrong however) lib_keys doesn't support softkeys, and 1,3,7,9 corner keys. And: I cannot make any 'press any key' event, cause lib seems to support only one button per function. Because of that i just.. NEED something that would check 'clicking' instead of 'being pressed', as well as detecting ALL buttons. GetKeyClicked is good, but it doesn't work.. Help me fix that and i will die happy. |
Ответ: keys/game library
Цитата:
P.S. Note, that MP is very limited language, so that some algorithms can not be implemented (i.e. using GetKeyClicked/GetKeyPressed functions on external canvas) without writing special libraries, or can't be implemented anyway. |
Ответ: keys/game library
Вложений: 1
Try this version of lib_keys.
If has 2 functions: get_key_states and get_bit. Also it doesn't block repaint and getkeypressed or getkeyclicked |
Часовой пояс GMT +4, время: 19:34. |
vBulletin® Version 3.6.5.
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Перевод: zCarot