Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (3run, AndrewAMD), 667 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: how to convert STRING to ENTITY [Re: frankjiang] #336670
08/05/10 17:19
08/05/10 17:19
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
looks good, but what is "gv"
this code works fine, but you have one problem:
How to know which variable is behin a specific index?

Think about it!

Use array, if you have very much variables of the same type and use, not only use
example:
levelfiles - store in array
panels + bitmaps - store in single variables if not used for map buildung (2D-Games)
...


Visit my site: www.masterq32.de
Re: how to convert STRING to ENTITY [Re: frankjiang] #336762
08/06/10 00:45
08/06/10 00:45
Joined: Dec 2009
Posts: 128
China
frankjiang Offline OP
Member
frankjiang  Offline OP
Member

Joined: Dec 2009
Posts: 128
China
sorry,i lost this code: var gv;// global test var.
Code:
STRING* gs[10];
ENTITY* ge[10];
BMAP*   gb[10];
PANEL*  gp[10];
var gv;/gv is test var
function buttonpro(var i){
	var x = mouse_pos.x;
	var y = mouse_pos.y;
	if(x>=0&&x<=40){
		if(y>=0&&y<=20){//btn1
			gv = 20;
		}
		if(y>=40&&y<=60){//btn2
			gv = 60;
		}
	}	
}
void initgv(){
	//STRING
	gs[0]=str_create("level.wmb");
	gs[1]=str_create("resourceflod/baul_armed.mdl");//character file
	



	
	//BMAP----------------------------------------------------------------------------
	gb[0]=bmap_create("resourceflod/mouse.png");//mouse bmap
	//button map	
	gb[1]=bmap_create("resourceflod/bmapon.png");
	gb[2]=bmap_create("resourceflod/bmapover.png");
	gb[3]=bmap_create("resourceflod/bmapoff.png");
	//slider map,slider_arrow
	gb[4]=bmap_create("resourceflod/slider.png");
	gb[5]=bmap_create("resourceflod/slider_arrow.png");
	



	//PANEL---------------------------------------------------------------------------
	gp[0]=pan_create("bmap = panel_1.png",1);
	gp[0].flags = SHOW;
	pan_setbutton(gp[0],0,1,0,0,gb[1],gb[2],gb[3],NULL,buttonpro,NULL,NULL); //btn1
	pan_setbutton(gp[0],0,1,0,40,gb[1],gb[2],gb[3],NULL,buttonpro,NULL,NULL);//btn2 
	//pan_setslider



}




Last edited by frankjiang; 08/06/10 00:49.

development 3d game is interesting!
Page 2 of 2 1 2

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