Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / GUI several images

Author
Message
kayser2008
12
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 30th Aug 2013 20:30
Hy to all
I´m new at DBP and i´m tryng to make a GUI with several images, and then highlight those images when "left" , "right" , "up" , "down" arrow is moved and when "enter" key is pressed in the highlighted image do a task .

I have allready manage to load several images in the GUI but only appears one image per time as i press the left and right arrow

Hope someone can help me and sorry for my English.

Best Regards
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 31st Aug 2013 12:49
If you would post the code you currently have it would be much easier to help

Basically you would want two images per part (buttons or whatever it now is; one "normal" and one "highlighted"). When the desired key is pressed you hide one image and show the other and then do the opposite when the key is released.


"Why do programmers get Halloween and Christmas mixed up?"
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 31st Aug 2013 13:25 Edited at: 31st Aug 2013 13:25
After searching the codebase, perhaps this can help?

Or at least start you off.

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 31st Aug 2013 23:32 Edited at: 2nd Sep 2013 19:10
I felt like making a quick tutorial for this as it's a very common question.





Formerly OBese87.
kayser2008
12
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 1st Sep 2013 14:37
thanks Libervurto

i will try if i can do something .

ps- keeps give me this error in line 52

COMPILER ERROR
"Array must include a set of square brackets at line 52. "
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 2nd Sep 2013 01:23
Are you coding in AppGameKit?

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 2nd Sep 2013 02:36
Arrays use square brackets in AppGameKit???? How... sensible!



Formerly OBese87.
kayser2008
12
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 2nd Sep 2013 15:43
yes i wose using AppGameKit isant the same as coding in to DBP?

i also have compiled with DBP and gives me this error;

Could not determine parameter of
3&(oldstate*2,trigger) at line 146
compilation failed (Syntax Errors)
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 2nd Sep 2013 19:10
Quote: "isant the same as coding in to DBP?"


Nope, DBP is different entirely. You'll have more luck asking this stuff on the AppGameKit boards.

TheComet

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 2nd Sep 2013 19:17
Quote: "Could not determine parameter of
3&(oldstate*2,trigger) at line 146
compilation failed (Syntax Errors)"

That is just because I forgot to changed the bitwise '&' (AND) to '&&' for DBP — it is single '&' in DBC. Code updated.

You don't really need the code to run to learn from it though, there are a lot of comments to help you understand.



Formerly OBese87.

Login to post a reply

Server time is: 2026-07-07 01:54:17
Your offset time is: 2026-07-07 01:54:17