Quiest
I like turtles!
Okay, this is for all new Fenix coders, I`ll try to gather as much useful code snippets together, to show how commands work, basic things like backgrounds, scrolling, layers, stuff that makes Fenix coding easier for you.
For how to set everything up and start coding, look at Racemaniacs post here.
It has links to tutorials and the programs needed.
Feel free to contribute, I try to keep everything in this first post, so I`ll add/update things here now and then
Loading fpg/music/sound/fonts into memory:
Unloading fpg/music/sound/fonts from memory:
Using the stuff you loaded:
Setting backgrounds:
Using "layers":
Proper use of the write command:
For how to set everything up and start coding, look at Racemaniacs post here.
It has links to tutorials and the programs needed.
Feel free to contribute, I try to keep everything in this first post, so I`ll add/update things here now and then
Loading fpg/music/sound/fonts into memory:
Code:
global
fpg1; song1; sound1; font1; //These are the IDs used for loading
begin
fpg1=load_fpg("fpg1.fpg");
song1=load_song("song1.mod");
sound1=load_wav("sound1.wav");
font1=load_fnt("font1.fnt");
end;
Code:
unload_fpg(fpg1); //you can use the IDs to unload
unload_song(song1);
unload_wav(sound1);
unload_fnt(font1);
Code:
file=fpg1; //tells a process which fpg to use
play_song(song1,#);
play_wav(sound1,#);
//# is the number of loops, -1==infinite loop, 0==play it once, 1==repeat it once,...
Code:
put_screen("fpg1.fpg",#);
//For some reason, IDs don`t work here, you have to use the full filename for this
//# is the number of the graphic inside the fpg
Code:
z=#;
//this is a value every process has, # can be 1 to 255 (I believe)
//1 is the top layer, the bigger it get, the lower the layer
drawing_z(#);
//the same value except it is not used for processes but for draw commands
Code:
write(*,x,y,#, "text"); //displaying text
write(*,x,y,#, string); //displaying a string variable
write_int(*,x,y,#, &integer); //displaying a integer variable
write_float(*,x,y,#, &float); //displaying a float variable
//* = ID of the loaded font (font1 for example); 0 for standart font
//x,y = the coordinates, where the text should be written
//# = the alignment of the font
//0==Left superior corner; 1==Superior center; 2==Right superior corner; 3==Left center;
//4==Center; 5==Right center; 6==Left inferior corner; 7==Inferior center; 8==Inferior corner right
Last edited by a moderator: