[futurebasic] Re: [FB] Gworld Newbie

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 1999 : Group Archive : Group : All Groups

From: "Phil Yates" <phil.yates@...>
Date: Mon, 02 Aug 1999 21:58:39 +0600
> Today's question: Should I use a G-World?
> 
> The reason I'm thinking of a gworld is so I don't have to use up so much
> time redrawing all these cells. I'm thinking if I make the whole thing a
> G-world, then as the user scrolls around, I can just let different parts
> of the g-world "show" in the window.
>
> Is this how they can work? Be gentle, the only place I have ever
> experienced gworlds is by reading this list.
>
> Here is how I see it:
>
> Redraw the cells in the gworld if the user changes the size of one of them.
>
> Move the "visible" part of the gworld based on any scrolling the user
> does. My first idea was to redraw for each scroll event, but I quickly
> figured that's a heck of a lot of redrawing.

A while ago, I wanted to allow the user to view any part of a large (5400 x
3600) pixel map.

It was very easy to generate a gWorld of this size (providing I used 8-bit
colour), and then whack the viewable area over to the screen. Using the numeric
pad keys to control the scroll in 8 directions, even on a slowish machine
(7300/132) and moving ALL the onscreen (1152 x 870) area across, you can get the
map to scroll so fast you have to slow it down to make it usable. Just make the
scroll something like 50 pixels at a time, and if that's too fast, change the
scroll value to 25 or 20.

All I would suggest is that you check the memory available carefully, to make
sure you've got enough for your gWorld. The rest is pretty easy - just react to
a dialog event and move the co-ordinates you want on the gWorld.

The real pig in my program was scaling, but this shouldn't worry you too much.

Download the "Base Program" from my web site at :

http://www.hawk.ndirect.co.uk

To get a full working program with gWorlds. But be quick - the
site'll go off line very shortly as I move ISPs.

HTH,

Phil.