Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,546 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Structs and Panels #297125
11/05/09 10:14
11/05/09 10:14
Joined: Aug 2009
Posts: 26
Goiânia - Brazil
D
dmBlack Offline OP
Newbie
dmBlack  Offline OP
Newbie
D

Joined: Aug 2009
Posts: 26
Goiânia - Brazil
Hi there,

I was wondering if you guys know how to make a struct somehow related with a specific panel, I mean if that is even possible...? Should I use a panel pointer as one of the structs atributes? Or are there any other options?

Thanks!

Re: Structs and Panels [Re: dmBlack] #297546
11/08/09 06:20
11/08/09 06:20
Joined: Apr 2009
Posts: 248
Philippines
seecah Offline
Member
seecah  Offline
Member

Joined: Apr 2009
Posts: 248
Philippines
Hi,

Take this as your reference..

http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=277335

you can try it by having an panel pointer attribute..



Can't is not an option™
Re: Structs and Panels [Re: seecah] #297549
11/08/09 07:02
11/08/09 07:02
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Would you prefer to have the struct 'embedded' in the panel?
If so, this may give you some ideas...
Code:
typedef struct 
{
   var health;
   var whataver;
}DETAILS;

PANEL* player_pan;

function build_player()
{
   player_pan = pan_create(...);
   player_pan.skill_x = sys_malloc(sizeof(DETAILS));
   ((DETAILS*)player_pan.skill_x).health = 100;
   ...
}

function player_hurt()
{
   ((DETAILS*)player_pan.skill_x).health -= 5;
   ...
}




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Structs and Panels [Re: EvilSOB] #297552
11/08/09 07:30
11/08/09 07:30
Joined: Apr 2009
Posts: 248
Philippines
seecah Offline
Member
seecah  Offline
Member

Joined: Apr 2009
Posts: 248
Philippines
Cool.. very useful stuff..



Can't is not an option™

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

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