realbasic-games
[Top] [All Lists]

Re: How to find a Group3D in a RB3DSpace

To: realbasic-games at lists dot realsoftware dot com
Subject: Re: How to find a Group3D in a RB3DSpace
From: "Heinz J. Gattringer" <heinzjos at uio dot satnet dot net>
Date: Sat, 19 Feb 2005 11:17:07 -0500
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <20050218180020 dot DDDD573556F at lists dot realsoftware dot com>
On Feb 18, 2005, at 1:00 PM, realbasic-games-request at lists dot realsoftware dot com wrote:

   which = me.FindObject(x,y)
   if which IsA MyObjects then
     MyObjects(which).HandleMouseUp x,y
   end if

or whatever you want to call the "HandleMouseUp" function in your
MyObjects class.

And in general, you should write your code in such a way that this
*is* all you have to do -- the index of an object in some global
array really shouldn't matter.

But again, I'm suspecting that you really don't need to care what the
indexes are anyway -- you should just see if the thing clicked is one
of your custom object types, typecast it accordingly, and invoke a
method on it.

Yes, I read that all the time and see it in code examples. The thing is, I kind of learned programming on my own in NOT object-oriented BASIC on way back older machines. So I tend to write my code in a book like fashion, where you are in one page and go through a long chunk of text at a time. Granted, that type of code is hard to mantain and has many other disadvantages. But I find it easier to debug than jumping all over the place with subroutines and passed parameters (That would be like constantly fliping from one page to another in a book, always reading just a few sentences on a page).

But I am working towards that goal as I get more familiar with RealBasic and its technics, so bear with me a while.

Thanks,
Heinz Jose

_______________________________________________
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>