Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 984 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
Why wont this work? #270793
06/10/09 01:27
06/10/09 01:27
Joined: Jun 2009
Posts: 148
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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: gamingfan101] #270841
06/10/09 09:37
06/10/09 09:37
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Why you use -270? So the Button is outside from the Panel !!!

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 Offline
Serious User
croman  Offline
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
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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: gamingfan101] #270970
06/10/09 18:13
06/10/09 18:13
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Online
Expert
alibaba  Online
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
remove this you dont need it:
while (key_any) {wait (1);}


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Why wont this work? [Re: alibaba] #270976
06/10/09 18:30
06/10/09 18:30
Joined: Jun 2009
Posts: 148
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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: gamingfan101] #270982
06/10/09 18:43
06/10/09 18:43
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Add a wait(1) after the sys_exit()


Click and join the 3dgs irc community!
Room: #3dgs
Re: Why wont this work? [Re: Joozey] #270986
06/10/09 18:46
06/10/09 18:46
Joined: Jun 2009
Posts: 148
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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 Offline
Expert
Joozey  Offline
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.

Code:
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
Page 1 of 4 1 2 3 4

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1