Ok, I'm trying to create a tilemap editor. I know how to code one but the problem I am having now is that when I try to use offsets, i.e if I want the map to start at say 100,200 I can get the map to start from there. What happens though is that the actual function to place the tile in the map doesnt appear to want to work.
The two functions below draw the map to screen and place the current tile. I get an error with the second function telling me I am out of the bouds of the array.
As you'll notice above Fxoff and Fyoff are the positions where the map starts.
Below is the 2 lines of code that draw the curser to the screen at 64*64 positions.
ANy help would be great. :) If you need me to post all the code I will but I wont post the images needed.
[edit] I fixed the second function. I still get an array out of bounds error.
The two functions below draw the map to screen and place the current tile. I get an error with the second function telling me I am out of the bouds of the array.
Function factory_drawmap() For Local x:Int = 0 To mapx-1 For Local y:Int = 0 To mapy-1 DrawImage squares,Fxoff+x*64,Fyoff+y*64,Fmap[x,y] Next Next End Function 'The function below draws the tile in the map Function factory_placetile() If MouseDown(KEY_MOUSELEFT) And MouseX() >= Fxoff And MouseY() >= Fyoff Fmap[MouseX()/64,MouseY()/64] = Fcurtile 'I'm trying to draw the current tile in the array posotion. EndIf End Function
As you'll notice above Fxoff and Fyoff are the positions where the map starts.
Below is the 2 lines of code that draw the curser to the screen at 64*64 positions.
mx:Int = MouseX()/64*64 my:Int = MouseY()/64*64
ANy help would be great. :) If you need me to post all the code I will but I wont post the images needed.
[edit] I fixed the second function. I still get an array out of bounds error.
