er something of the sort... my problem is getting the darn file to save properly and then load it into another code.
What I've made so far is a 'test' program in an attempt to see what I can whip up. I want the program to save the 'x' and 'y' coordinates of each new object that I put on the edit screen.. then reload them into the loading program where it will place the graphics exactly where I placed them in the main editor..
If that didnt confuse you.. then let me go ahead and send the two pieces of code. Please note, I started coding this just yesturday.. so if it looks a bit newbish, please forgive me =P I'm still getting the hang of Blitz
The Editor:
the loader:
What I've made so far is a 'test' program in an attempt to see what I can whip up. I want the program to save the 'x' and 'y' coordinates of each new object that I put on the edit screen.. then reload them into the loading program where it will place the graphics exactly where I placed them in the main editor..
If that didnt confuse you.. then let me go ahead and send the two pieces of code. Please note, I started coding this just yesturday.. so if it looks a bit newbish, please forgive me =P I'm still getting the hang of Blitz
The Editor:
Graphics 400,400 Type tile Field ent Field x Field y End Type tile=CreateImage(20,20,1) SetBuffer ImageBuffer(tile) Color 0,0,100 Rect 0,0,20,20,1 Color 200,200,200 Rect 0,0,20,20,0 SetBuffer BackBuffer() While Not KeyHit(1) If MouseHit(1) Then ob=ob+1 t.tile=New tile t\ent=CopyImage(tile) DrawImage t\ent,MouseX(),MouseY(),0 t\x=MouseX() t\y=MouseY() EndIf If KeyHit(57) For t.tile= Each tile fileout=WriteFile("test3.dat") WriteInt(fileout,ob) WriteInt(fileout,t\x) WriteInt(fileout,t\y) CloseFile(fileout) Next EndIf Flip Wend
the loader:
Graphics 400,400 Type tile Field ent Field x Field y End Type tile=CreateImage(20,20,1) SetBuffer ImageBuffer(tile) Color 0,0,100 Rect 0,0,20,20,1 Color 200,200,200 Rect 0,0,20,20,0 SetBuffer BackBuffer() While Not KeyHit(1) filein=ReadFile("test3.dat") ob=ReadInt(filein) If ob>0 For tt=1 To ob t.tile=New tile t\ent=CopyImage(tile) t\x=ReadInt(filein) t\y=ReadInt(filein) DrawImage t\ent,t\x,t\y,0 ob=ob-1 Next EndIf Flip Wend