Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
multiple dynamic panels #251622
02/14/09 08:52
02/14/09 08:52
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
hey there, can someone point out how i can create a bunch of panels on the fly? i want to create panels for certain entities, thus each of the panels need to be somehow connected to the according entity so i can keep the panels position near the entitie and for example let a panel blink if the entitie wants something...

i guess it should be something like
Code:
 
myPanel = createPanel(bitmap);
...
maPanel.pos_x = ..
myPanel.pos_y = ..
myPanel.bmap = ..
set(myPanel,SHOW);
...


any ideas are more that welcome smile

cheers,
ello


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: multiple dynamic panels [Re: ello] #251624
02/14/09 08:57
02/14/09 08:57
Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Ralph Offline
Senior Member
Ralph  Offline
Senior Member

Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Easy!
Code:
PANEL* mypanls[100];
//....
var i=0;
for(y=0;y<10;y++){
  for(x=0;x<10;x++){
    mypanels[i]=pan_create("flags=VISIBLE;",1);
    mypanels[i].pos_x=x*20; mypanels[i].pos_y=y*20;
    mypanels[i].bmap=bitmap;
    //...
    i++;
  }
}

Thats what I do, when I want to create a bunch of Panels.

Greetings Ralph

Re: multiple dynamic panels [Re: ello] #251626
02/14/09 09:03
02/14/09 09:03
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
For creating panels on the fly, look in the manual under pan_create(...)

And for attaching them to entities you could use "something like"
MyEnt.skill99 = (void*)pan_create("bmap=bitmap; pos_x=1; etc", layer); //to create (tested)
and
((PANEL*)(MyEnt.skill99)).pos_x = 25; //to modify (untested. Brackets may need juggling)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: multiple dynamic panels [Re: EvilSOB] #251648
02/14/09 12:33
02/14/09 12:33
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
hey thank you both very much!


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.

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