Gamestudio Links
Zorro Links
Newest Posts
blogherenowcenter
by 3s05bmmc. 06/05/24 06:08
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (VoroneTZ, AndrewAMD), 779 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19057 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Browser für Player errichten [Re: atari98] #286414
08/25/09 08:34
08/25/09 08:34
Joined: Apr 2009
Posts: 274
atari98 Offline OP
Member
atari98  Offline OP
Member

Joined: Apr 2009
Posts: 274
Originally Posted By: atari98
Äh stimmt das so??


Code:

///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////

var slider = 100;
//////////////////////////////

function quit_program()
{
while (key_any) { wait (1); }
sys_exit(NULL);
}


SOUND* playme;

function call_music()
{
OPENFILENAME my_file;
char buf[256];
FillMemory (&my_file,sizeof(my_file),0);
FillMemory (buf,256,0);
my_file.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST;
my_file.lStructSize = sizeof(my_file);
my_file.hwndOwner = hWnd;
my_file.lpstrFilter = "Musicfiles (*.mp3; *.wav; *.mid; *.ogg) \0*.mp3;*.ogg;*.wav;*.mid\0\0";
my_file.lpstrInitialDir = _chr(OB_E_PFAD_STR);
my_file.lpstrFile = buf;
my_file.nMaxFile = 255;
my_file.lpstrTitle = "Load Musicfile:";

while (key_any) wait(1);

if (GetOpenFileName(&my_file))
{
str_cpy (OB_E_NAME_STR,my_file.lpstrFile);
// add here the things to play the music. OB_E_NAME_STR is the name of the file. Example:
// playme = snd_create(OB_E_NAME_STR); shandle = snd_play(...);
}
}



BMAP* hhhhh = "play.tga";
PANEL* Play =
{
bmap = hhhhh;
flags = SHOW;
}


BMAP* hhhh = "stop.tga";
PANEL* stop =
{
bmap = hhhh;
flags = SHOW;
}

BMAP* hhh = "pause.tga";
PANEL* pause =
{
bmap = hhh;
flags = SHOW;
}

BMAP* hh = "vor.tga";
PANEL* vor =
{
bmap = hh;
flags = SHOW;
}

BMAP* h = "rueck.tga";
PANEL* rueck =
{
bmap = h;
flags = SHOW;
}

BMAP* gg = "Obereleiste.tga";
PANEL* rueckggg =
{
bmap = gg;
flags = SHOW;
}
BMAP* ggfgg = "Obereleiste.tga";
PANEL* leiste =
{
bmap = ggfgg;
flags = SHOW;
}

PANEL* Sliderbutton =
{
flags = SHOW;
button(2,1, "1o.tga", "1.tga", "1o.tga",quit_program, NULL, NULL);
}


PANEL* Sliderbutton2 =
{
button(2,0, "2o.tga", "2.tga", "2o.tga",quit_program, NULL, NULL);
flags = SHOW;
}


PANEL* Sliderbutton3 =
{
button(2,0, "3o.tga", "3.tga", "3o.tga",quit_program, NULL, NULL);
flags = SHOW;
}

PANEL* slider =
{
pos_x = 600;
pos_y = 470;
bmap = "Slider02.tga";
hslider(22,6,45,"Sliderbutton.tga",6,10, slider);
flags = OVERLAY | VISIBLE;
}




function main()
{
vec_set(screen_size,vector(800,800,0));
vec_set(sky_color,vector(255,255,255)); // dark blue
vec_set(camera.x,vector(-250,0,50));
vec_set(camera.pan,vector(0,-15,0));
mouse_mode = 2;
while (1)
{
mouse_pos.x = mouse_cursor.x;
mouse_pos.y = mouse_cursor.y;
wait (1);



Play.pos_x = 330; // gewünschte Position
Play.pos_y = 480;

stop.pos_x = 210; // gewünschte Position
stop.pos_y = 490;

pause.pos_x = 490; // gewünschte Position
pause.pos_y = 494;

vor.pos_x = 610; // gewünschte Position
vor.pos_y = 494;


rueck.pos_x = 90; // gewünschte Position
rueck.pos_y = 490;

slider.pos_x = 590; // gewünschte Position
slider.pos_y = 450;


Sliderbutton.pos_x = 0; // gewünschte Position
Sliderbutton.pos_y = 1;

Sliderbutton2.pos_x = 90; // gewünschte Position
Sliderbutton2.pos_y = 2;

Sliderbutton3.pos_x = 140; // gewünschte Position
Sliderbutton3.pos_y = 2.9 ;

leiste.pos_x = 0; // gewünschte Position
leiste.pos_y = 420;

}

}





Warum funktioniert das nicht?


Kann keiner helfen?



Meine Fun Websiten
www.free4-fun.de.tl

www.gamer-liga-live.de.tl

Meine Game-Projekt Websiten
www.gamer-projects.de.tl
Re: Browser für Player errichten [Re: atari98] #286417
08/25/09 09:00
08/25/09 09:00
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Folgender Code funktioniert einwandfrei bei mir:
Code:
#include <acknex.h>
#include <windows.h>
#include <default.c>


SOUND* playme;
STRING* OB_E_NAME_STR;

function call_music()
{
	OPENFILENAME my_file;
	char buf[256];
	FillMemory (&my_file,sizeof(my_file),0);
	FillMemory (buf,256,0);
	my_file.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST;
	my_file.lStructSize = sizeof(my_file);
	my_file.hwndOwner = hWnd;	
	my_file.lpstrFilter = "Musicfiles (*.mp3; *.wav; *.mid; *.ogg)	\0*.mp3;*.ogg;*.wav;*.mid\0\0";
	my_file.lpstrInitialDir = _chr("");
	my_file.lpstrFile = buf;
	my_file.nMaxFile = 255;	
	my_file.lpstrTitle = "Load Musicfile:";
	
	while (key_any)   wait(1);
	
	if (GetOpenFileName(&my_file))
	{
		str_cpy (OB_E_NAME_STR,my_file.lpstrFile);
	// add here the things to play the music. OB_E_NAME_STR is the name of the file. Example:
	// playme = snd_create(OB_E_NAME_STR); shandle = snd_play(...);
	}
}


void main()
{
	level_load(NULL);
	
	on_o = call_music;
}


Mit der der o-Taste (O wie Omega) lässt sich nun ein Datei-Öffnen Dialog öffnen.
Die Startposition legt diese Zeile fest:
my_file.lpstrInitialDir = _chr("");

Wenn du dort einen leeren String reinschreibst (wie im Beispiel) dann wird der Ordner "Eigene Dateien" geöffnet.
Alternativ kannst du einen beliebigen Pfad angeben.
Falls du den Ordner nutzen willst in dem dein Programm liegt solltest du dir
work_dir: http://www.conitec.net/beta/awork_dir.htm
oder
exe_dir: http://www.conitec.net/beta/aexe_dir.htm
anschauen und nutzen.

Re: Browser für Player errichten [Re: Xarthor] #286433
08/25/09 10:26
08/25/09 10:26
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Noch was: Funktioniert NICHT im Vollbildmodus, da werden alle Windows - Funktionen "unterdrückt".

Re: Browser für Player errichten [Re: Widi] #286476
08/25/09 13:14
08/25/09 13:14
Joined: Apr 2009
Posts: 274
atari98 Offline OP
Member
atari98  Offline OP
Member

Joined: Apr 2009
Posts: 274
Ja der Code funktioniert, aber wenn ich "o" drücke passiert nichts.Was nun?

Code:
#include <acknex.h>
#include <windows.h>
#include <default.c>


SOUND* playme;
STRING* OB_E_NAME_STR;

function call_music()
{
	OPENFILENAME my_file;
	char buf[256];
	FillMemory (&my_file,sizeof(my_file),0);
	FillMemory (buf,256,0);
	my_file.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST;
	my_file.lStructSize = sizeof(my_file);
	my_file.hwndOwner = hWnd;	
	my_file.lpstrFilter = "Musicfiles (*.mp3; *.wav; *.mid; *.ogg)	\0*.mp3;*.ogg;*.wav;*.mid\0\0";
	my_file.lpstrInitialDir = _chr("");
	my_file.lpstrFile = buf;
	my_file.nMaxFile = 255;	
	my_file.lpstrTitle = "Load Musicfile:";
	
	while (key_any)   wait(1);
	
	if (GetOpenFileName(&my_file))
	{
		str_cpy (OB_E_NAME_STR,my_file.lpstrFile);
	// add here the things to play the music. OB_E_NAME_STR is the name of the file. Example:
	// playme = snd_create(OB_E_NAME_STR); shandle = snd_play(...);
	}
}

function quit_program()
{
  while (key_any) { wait (1); }
  sys_exit(NULL);
}


void main()
{
	level_load(NULL);
	
	on_o = call_music;
}





BMAP* hhhhh = "play.tga";
PANEL* Play =
{
bmap = hhhhh;
flags = SHOW;
}


BMAP* hhhh = "stop.tga";
PANEL* stop =
{
bmap = hhhh;
flags = SHOW;
}

BMAP* hhh = "pause.tga";
PANEL* pause =
{
bmap = hhh;
flags = SHOW;
}

BMAP* hh = "vor.tga";
PANEL* vor =
{
bmap = hh;
flags = SHOW;
}

BMAP* h = "rueck.tga";
PANEL* rueck =
{
bmap = h;
flags = SHOW;
}

BMAP* gg = "Obereleiste.tga";
PANEL* rueckggg =
{
bmap = gg;
flags = SHOW;
}
BMAP* ggfgg = "Obereleiste.tga";
PANEL* leiste =
{
bmap = ggfgg;
flags = SHOW;
}

PANEL* Sliderbutton =
{
flags = SHOW;
button(2,1, "1o.tga", "1.tga", "1o.tga",quit_program, NULL, NULL); 
}


PANEL* Sliderbutton2 =
{
button(2,0, "2o.tga", "2.tga", "2o.tga",quit_program, NULL, NULL); 
flags = SHOW;
}


PANEL* Sliderbutton3 =
{
button(2,0, "3o.tga", "3.tga", "3o.tga",quit_program, NULL, NULL); 
flags = SHOW;
}

PANEL* slider =
{
	pos_x = 600;
	pos_y = 470;
   bmap = "Slider02.tga";
   hslider(22,6,45,"Sliderbutton.tga",6,10, slider); 
   flags = OVERLAY | VISIBLE;
}




function main()
{
  vec_set(screen_size,vector(800,800,0));
  vec_set(sky_color,vector(255,255,255)); // dark blue
  vec_set(camera.x,vector(-250,0,50));
  vec_set(camera.pan,vector(0,-15,0));
  mouse_mode = 2;
  while (1)
	{
		mouse_pos.x = mouse_cursor.x;
		mouse_pos.y = mouse_cursor.y;
		wait (1);
	
	
	
  Play.pos_x = 330; // gewünschte Position
  Play.pos_y = 480;

  stop.pos_x = 210; // gewünschte Position
  stop.pos_y = 490;

  pause.pos_x = 490; // gewünschte Position
  pause.pos_y = 494;

  vor.pos_x = 610; // gewünschte Position
  vor.pos_y = 494;


  rueck.pos_x = 90; // gewünschte Position
  rueck.pos_y = 490;
  
  slider.pos_x = 590; // gewünschte Position
  slider.pos_y = 450;
  
  
  Sliderbutton.pos_x = 0; // gewünschte Position
  Sliderbutton.pos_y = 1;
  
  Sliderbutton2.pos_x = 90; // gewünschte Position
  Sliderbutton2.pos_y = 2;

  Sliderbutton3.pos_x = 140; // gewünschte Position
  Sliderbutton3.pos_y = 2.9 ;
 
  leiste.pos_x = 0; // gewünschte Position
  leiste.pos_y = 420;
 
 }
 
}



Last edited by atari98; 08/25/09 13:15.

Meine Fun Websiten
www.free4-fun.de.tl

www.gamer-liga-live.de.tl

Meine Game-Projekt Websiten
www.gamer-projects.de.tl
Re: Browser für Player errichten [Re: atari98] #286489
08/25/09 14:10
08/25/09 14:10
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Typischer Copy&Paste fehler:
Du hast zwei main funktionen, in deiner zweiten steht die tasten zuweisung nicht drin.
Solltest du also selbst beheben können.

Re: Browser für Player errichten [Re: Xarthor] #286615
08/26/09 07:58
08/26/09 07:58
Joined: Apr 2009
Posts: 274
atari98 Offline OP
Member
atari98  Offline OP
Member

Joined: Apr 2009
Posts: 274
Originally Posted By: Xarthor
Typischer Copy&Paste fehler:
Du hast zwei main funktionen, in deiner zweiten steht die tasten zuweisung nicht drin.
Solltest du also selbst beheben können.


Danke


Meine Fun Websiten
www.free4-fun.de.tl

www.gamer-liga-live.de.tl

Meine Game-Projekt Websiten
www.gamer-projects.de.tl
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