Gamestudio Links
Zorro Links
Newest Posts
How to select between IB accounts by script?
by AndrewAMD. 06/13/26 15:44
Zorro tutorial ideas?
by AndrewAMD. 06/13/26 15:01
Zorro 3.01 recoded MMI function issue
by 11honza11. 06/13/26 11:40
Stooq now requires an API key
by AndrewAMD. 06/11/26 17:55
Z9 getting Error 058
by k_ivan. 06/10/26 14:38
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (AndrewAMD, monarch, Quad), 1,421 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 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