|
Re: Why wont this work?
[Re: Joozey]
#270990
06/10/09 18:54
06/10/09 18:54
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
wait, would i create it using a paint program? and what code would i use?
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: Why wont this work?
[Re: Joozey]
#270994
06/10/09 19:09
06/10/09 19:09
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
Well, i used the code, but it still doesnt work. Here's the full code im using.
//////////////////////////////////////////////////////////////////// #include <acknex.h> #include <default.c> ////////////////////////////////////////////////////////////////////
BMAP* firebackground = "awesome-fire-dragon-ablaze.jpg"; // dragon fire background with button on it
PANEL* first_pan = // my first panel { pos_x = -40; pos_y = 0; layer = 1; bmap = firebackground; button(300, 0, "stopclicked.jpg", "stopnormal.jpg", "stopnormal.jpg", quit_program, NULL, NULL); flags = OVERLAY | VISIBLE; } BMAP* pngRobot = "LDDScreenShot1.png"; // robot in foreground
PANEL* second_panel = { pos_x = -270; pos_y = -100; layer = 2; bmap = pngRobot; flags = OVERLAY | VISIBLE; }
/////////////////////////////////////////////////////////////////////
function main() { video_mode = 7; screen_color.red = 100; }
function mouse() { mouse mode = 1; while (1); { vec_set(mouse_pos, mouse_cursor); wait(1); } }
function quit_program() { while (key_any) {wait (1);} sys_exit(NULL); }
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: Why wont this work?
[Re: gamingfan101]
#271000
06/10/09 19:31
06/10/09 19:31
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
try changine sys_exit(NULL); to be sys_exit("");
If that doesnt help, put a beep(); into "quit_program" to see if the button is even registering the click. Can you see button image change from "stopclicked.jpg" to "stopnormal.jpg" when the mouse hovers over it?
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Why wont this work?
[Re: EvilSOB]
#271003
06/10/09 19:47
06/10/09 19:47
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
no, i cant see any change, i dont know what im doing wrong. the button shows up, but i cant click it or anything.
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: Why wont this work?
[Re: gamingfan101]
#271004
06/10/09 19:57
06/10/09 19:57
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Try commenting out the definition of "second_panel" as a test.
Also what version of 3DGS are you using? If you are using A7.63 or higher, you should be using the SHOW flag on the panels, not VISIBLE as it was changed to SHOW in A7.63
[EDIT] Hehehe, good point Joozey. I didnt notice that the mouse never gets turned on cause the mouse action is never actually called...
Last edited by EvilSOB; 06/10/09 20:02.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Why wont this work?
[Re: Joozey]
#271007
06/10/09 20:04
06/10/09 20:04
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
the mouse function has been called hasnt it?
function mouse() { mouse mode = 1; while (1); { vec_set(mouse_pos, mouse_cursor); wait(1); } }
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: Why wont this work?
[Re: KiwiBoy]
#271011
06/10/09 20:19
06/10/09 20:19
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
Well, now the engine wont start the script. Heres the full code.
//////////////////////////////////////////////////////////////////// #include <acknex.h> #include <default.c> ////////////////////////////////////////////////////////////////////
BMAP* firebackground = "awesome-fire-dragon-ablaze.jpg"; // dragon fire background with button on it
PANEL* first_pan = // my first panel { pos_x = -40; pos_y = 0; layer = 1; bmap = firebackground; button(300, 0, "stopclicked.jpg", "stopnormal.jpg", "stopnormal.jpg", quit_program, NULL, NULL); flags = OVERLAY | VISIBLE; } BMAP* pngRobot = "LDDScreenShot1.png"; // robot in foreground
PANEL* second_panel = { pos_x = -270; pos_y = -100; layer = 2; bmap = pngRobot; flags = OVERLAY | VISIBLE; }
/////////////////////////////////////////////////////////////////////
function main() { video_mode = 7; screen_color.red = 100; }
function mouse_startup() { mouse_mode = 1; while (1); { vec_set(mouse_pos, mouse_cursor); wait(1); } }
function quit_program() { while (key_any) {wait (1);} sys_exit(""); }
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
|