SpriteSurface Out of bounds message (REALbasic games Mailinglist archive)
Back to the thread list
Previous thread: Movement
Next thread: Sprite Surface Question
| SpriteSurface Out of bounds message |
| Date: 23.01.07 19:40 (Tue, 23 Jan 2007 13:40:45 -0500) |
| From: Mark Barnett |
|
I am getting calls from somewhere that are asking for information that
i haven't got in my map. I have the map set at 80 x 80 (each at 64x64 pixels) and the map size has been changed to hold all the pictures across and down. But something is asking for -1eos and -1dos and I have gotten a 81nos too. Here is the modified code for my PaintTile event in the SpriteSurface. <code> g.DrawPicture app.mBgTile(app.Piece(Xpos,Ypos).PictNum),0,0,64,64 <end code> app.Piece is the array of x,y I have that hold the information about that piece of land. app.mBgTile is the array of 10 pictures, that is used in the RPG demo for background tiles. It doesn't include any of the highlighting yet. So this is all thats in there. Mark _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html> |
| Re: SpriteSurface Out of bounds message |
| Date: 23.01.07 19:51 (Tue, 23 Jan 2007 11:51:48 -0700) |
| From: joe strout.net |
|
On Jan 23, 2007, at 18:40 UTC, Mark Barnett wrote:
> But something is asking for -1oos and > -1eos and I have gotten a 81(os too. Well, sure, the SpriteSurface does that. It often needs you to paint tiles that aren't on the screen yet, in case they are scrolled into view. Just modify your code to check that the Xpos and Ypos are in the bounds of your array before you attempt to use them. Best, - Joe |
| Re: SpriteSurface Out of bounds message |
| Date: 23.01.07 20:09 (Tue, 23 Jan 2007 14:09:31 -0500) |
| From: Mark Barnett |
|
Done! Now it takes longer for the map to show up but it's okay, I
guess. How do I move the screen just a few pixels at a time in any direction. I have the arrow keys loaded in NextFrame event. But each time I try to move the map, it won't update with the new coordinates. I am so lost how he did that in the RPG. It still doesn't make any sense to me. And I really appreciate your help on this. Mark On Jan 23, 2007, at 1:51 PM, <email address removed> wrote: > On Jan 23, 2007, at 18:40 UTC, Mark Barnett wrote: >> But something is asking for -15os and >> -1Kos and I have gotten a 81Pos too. > Well, sure, the SpriteSurface does that. It often needs you to paint > tiles that aren't on the screen yet, in case they are scrolled into > view. Just modify your code to check that the Xpos and Ypos are in the > bounds of your array before you attempt to use them. > Best, > - Joe > -- > Joe Strout -- <email address removed> > Verified Express, LLC "Making the Internet a Better Place" > http://www.verex.com/ _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html> |
| Re: SpriteSurface Out of bounds message |
| Date: 23.01.07 21:11 (Tue, 23 Jan 2007 13:11:56 -0700) |
| From: joe strout.net |
|
On Jan 23, 2007, at 19:09 UTC, Mark Barnett wrote:
> Done! Now it takes longer for the map to show up but it's okay, I > guess. How do I move the screen just a few pixels at a time in any > direction. I have the arrow keys loaded in NextFrame event. But each > time I try to move the map, it won't update with the new coordinates. I don't understand what you mean by that. You scroll the screen just by calling me.Scroll. > I am so lost how he did that in the RPG. Who did what in which RPG? Are you talking about my old RPG SpritSurface demo? > It still doesn't make any sense to me. You just scroll the SpriteSurface (with the Scroll method). Let it worry about which map tiles need to be drawn; just draw whatever it tells you to. > And I really appreciate your help on this. Happy to -- can't wait to see your project! Best, - Joe |
Links
MBS Realbasic Plugins - JUZ Nickenich