Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
400 free seamless texture pack downl. here !
by NeoDumont. 04/08/26 19:55
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (AndrewAMD), 3,675 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
valino, juergenwue, VladMak, Geir, ondrej
19209 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
change the position of a button #283993
08/11/09 07:41
08/11/09 07:41
Joined: Apr 2009
Posts: 138
Germany
T
Toryno Offline OP
Member
Toryno  Offline OP
Member
T

Joined: Apr 2009
Posts: 138
Germany
Hi, how can the position(just x & y) of a button be changed without this big-sized function? My code becomes very confusing when i use it grin

Code:
pan_setbutton(PANEL*, var num, var type, var x, var y, BMAP* bmapOn, BMAP* bmapOff, BMAP* bmapOver, BMAP* bmapOverOff, void* functionClick, void* functionLeave, void* functionOver);




Thanks for reading, thinking, answering wink
Re: change the position of a button [Re: Toryno] #284009
08/11/09 09:02
08/11/09 09:02
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
u dont need to use this funtion again once the button is created.

U can just modify the x and y values of the button directly instead of using this funtion with all these parameters (assuming the button is created).


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: change the position of a button [Re: delinkx] #284011
08/11/09 09:19
08/11/09 09:19
Joined: Apr 2009
Posts: 138
Germany
T
Toryno Offline OP
Member
Toryno  Offline OP
Member
T

Joined: Apr 2009
Posts: 138
Germany
Ok but how?
Can you just correct me this please? wink
Code:
building_menue.button1.pos_x += 20;




Thanks for reading, thinking, answering wink
Re: change the position of a button [Re: Toryno] #284029
08/11/09 10:30
08/11/09 10:30
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
sorry.. my mistake. i read the post wrongly. for button, u will need to use the pan_setbutton() function.

we cant access the button directly as the manual doesnt mention what datatype the button() function returns. else could hv assigned a handle to tat and use tat.

maybe there is some way.. anyone ?


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: change the position of a button [Re: delinkx] #284037
08/11/09 11:07
08/11/09 11:07
Joined: Dec 2008
Posts: 271
Saturnus Offline
Member
Saturnus  Offline
Member

Joined: Dec 2008
Posts: 271
To change the position of a button you can also use pan_setpos() which has less arguments.

Re: change the position of a button [Re: Saturnus] #284038
08/11/09 11:14
08/11/09 11:14
Joined: Apr 2009
Posts: 138
Germany
T
Toryno Offline OP
Member
Toryno  Offline OP
Member
T

Joined: Apr 2009
Posts: 138
Germany
pan_setpos() woud be possible if only the button is in the panel but i have more there wink so i need to change only the button wink so pan_setpos() is no way.
My idea again:
building_menue.button1.pos_x += 20;
this is wrong syntax but is there a correct way like this?


Thanks for reading, thinking, answering wink
Re: change the position of a button [Re: Toryno] #284062
08/11/09 14:01
08/11/09 14:01
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
You should take a closer look at the pan_setpos function again.
As this is exactly what you need (as Kombucha already pointed out)

Quote:

pan_setpos(PANEL*, var type, var num, VECTOR* xy)
Changes the xy position of a panel element.

Parameters:
PANEL* Panel pointer.
type Element type:
1 = digits
3 = button, toggle
4 = slider
5 = window
6 = needle
num Number of the element, starting with 1.
xy Vector containing the element's new x and y values

http://www.conitec.net/beta/apan_setpos.htm

Re: change the position of a button [Re: Xarthor] #284123
08/11/09 19:47
08/11/09 19:47
Joined: Apr 2009
Posts: 138
Germany
T
Toryno Offline OP
Member
Toryno  Offline OP
Member
T

Joined: Apr 2009
Posts: 138
Germany
0oh sorry I should read the manual befor thinking pan_setpos(); changes the pos of the hole panel grin
sorry for that and thanks wink


Thanks for reading, thinking, answering wink
Re: change the position of a button [Re: Toryno] #284176
08/12/09 03:04
08/12/09 03:04
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
This doesn't work.
Quote:

My idea again:
building_menue.button1.pos_x += 20;
this is wrong syntax but is there a correct way like this?


As suggested above, pan_setpos() is better, as it has less arguments and will make ur confusions less.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook

Gamestudio download | 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