realbasic-games
[Top] [All Lists]

SpriteSurface Out of bounds message

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: SpriteSurface Out of bounds message
From: Mark Barnett <albadar at verizon dot net>
Date: Tue, 23 Jan 2007 13:40:45 -0500
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-games at lists dot realsoftware dot com
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 -1=Xpos and -1=Ypos and I have gotten a 81=Xpos 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>


From  Tue 23 Jan 2007 11:51:48 -0700
Return-Path: <realbasic-games-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
        id 79DCC17E33C4; Tue, 23 Jan 2007 10:52:08 -0800 (PST)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on www.realsoftware.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=4.5 tests=AWL,BAYES_00,NO_REAL_NAME autolearn=no version=3.1.1
Received: from lists.realsoftware.com (lists.realsoftware.com [209.198.132.125])
        by xmail.realsoftware.com (Postfix) with ESMTP id 030C917E338B;
        Tue, 23 Jan 2007 10:51:59 -0800 (PST)
Received: from lists.realsoftware.com (localhost [127.0.0.1])
        by lists.realsoftware.com (Postfix) with ESMTP
        id 4AEDD185F563; Tue, 23 Jan 2007 12:51:52 -0600 (CST)
X-Original-To: realbasic-games at lists dot realsoftware dot com
Delivered-To: realbasic-games at lists dot realsoftware dot com
Received: from mail.verex.com (mail.verex.com [66.116.103.197])
        by lists.realsoftware.com (Postfix) with ESMTP id 652EA185F556
        for <realbasic-games at lists dot realsoftware dot com>;
        Tue, 23 Jan 2007 12:51:48 -0600 (CST)
Received: from [66.116.103.197] (localhost [127.0.0.1])
        by mail.verex.com (Postfix) with SMTP id 113D06DAEFE
        for <realbasic-games at lists dot realsoftware dot com>;
        Tue, 23 Jan 2007 11:51:48 -0700 (MST)
Date: Tue, 23 Jan 2007 11:51:48 -0700
From: joe at strout dot net
To: realbasic-games at lists dot realsoftware dot com
In-Reply-To: <7abb741bbbf7f28c5e60a045268e620b at verizon dot net>
X-Mailer: VerEx Email Gateway
Content-type: text/plain;
Content-transfer-encoding: 7bit
Message-Id: <20070123185148 dot 113D06DAEFE at mail dot verex dot com>
Subject: Re: SpriteSurface Out of bounds message
X-BeenThere: realbasic-games at lists dot realsoftware dot com
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Sender: realbasic-games-bounces at lists dot realsoftware dot com
Errors-To: realbasic-games-bounces at lists dot realsoftware dot com

On Jan 23, 2007, at 18:40 UTC, Mark Barnett wrote:

But something is asking for -1=Xpos and -1=Ypos and I have gotten a 81=Xpos 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 -- joe at strout dot net
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>


<Prev in Thread] Current Thread [Next in Thread>