2 registered members (VoroneTZ, AndrewAMD),
779
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Why wont this work?
#270793
06/10/09 01:27
06/10/09 01:27
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
hi, im trying to put a button on my background image, but nothing is there. heres the code im using and advice would be greatly appreciated!
//////////////////////////////////////////////////////////////////// #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(-270, -100, "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 quit_program() { while (key_any) {wait (1);} sys_exit(NULL); }
Last edited by gamingfan101; 06/10/09 02:15.
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: Why wont this work?
[Re: Widi]
#270843
06/10/09 09:42
06/10/09 09:42
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
yea, don't use negative values for panel elements the element wont be visible if it's not inside the panel
Ubi bene, ibi Patria.
|
|
|
Re: Why wont this work?
[Re: croman]
#270960
06/10/09 18:00
06/10/09 18:00
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
im not sure what happaned, everything but the button shows up where i want it.
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: Why wont this work?
[Re: gamingfan101]
#270963
06/10/09 18:01
06/10/09 18:01
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
ok, i changed the negative numbers, and it shows up now, but it doesnt doing anything when i click on it.
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: Why wont this work?
[Re: alibaba]
#270976
06/10/09 18:30
06/10/09 18:30
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
ok, but the button still doesnt work, i click on it and it does nothing
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: Why wont this work?
[Re: Joozey]
#270986
06/10/09 18:46
06/10/09 18:46
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
ok, i did, but the button still wont work.
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: Why wont this work?
[Re: gamingfan101]
#270988
06/10/09 18:52
06/10/09 18:52
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
Expert
|
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
Oh, sorry, I realise you don't have a mouse yet. Create a mouse first so clicks and touches can be registrated by the engine. function mouse() {
mouse_mode = 1;
while(1) {
vec_set( mouse_pos, mouse_cursor );
wait(1);
}
} No need for the wait after sys_exit.
Last edited by Joozey; 06/10/09 18:56.
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
|