Xojo Conferences
XDCMay2019MiamiUSA

Sprite Surface Question (Real Studio games Mailinglist archive)

Back to the thread list
Previous thread: SpriteSurface Out of bounds message
Next thread: [ANN] Quesa Wrappers v0.6.2f (RB3D Extensions)


[ANN] Preview of RBD 2.4   -   Marc Zeedar
  Sprite Surface Question   -   Mark Barnett
   Re: Sprite Surface Question   -   joe strout.net
    Re: Sprite Surface Question   -   Mark Barnett
     Re: Sprite Surface Question   -   joe strout.net

Sprite Surface Question
Date: 22.01.07 20:35 (Mon, 22 Jan 2007 14:35:27 -0500)
From: Mark Barnett
I am making a game using the sprite surface. I want the map of this
game to be randomly generated (I have this part done) and then applied
to the sprite surface. I have the map created in memory as a list of
locations with x, y coordinates.
What is a smarter approach to have the map applied to the
SpriteSurface, as a map or as spritewrappers for each of the 80+ x 80+
map. I would like to animate these surfaces, is that recommended or
not? And if it is a map background, how would I be able to tell the
player "This is your land" or "This is NOT you land" by highlighting
groups of these pieces? I am looking for speed/performance for this
project.
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: Sprite Surface Question
Date: 22.01.07 21:50 (Mon, 22 Jan 2007 13:50:01 -0700)
From: joe strout.net
On Jan 22, 2007, at 19:35 UTC, Mark Barnett wrote:

> What is a smarter approach to have the map applied to the
> SpriteSurface, as a map or as spritewrappers for each of the 80+ x
> 80+ map.

I'd just draw the map parts in the PaintTile event, or if you prefer,
compose it all into a big picture and set that as the background.

> I would like to animate these surfaces, is that recommended
> or not?

Well, certainly not on every frame, since that would require redrawing
the entire screen on every frame. If you're going to do that, the
SpriteSurface isn't gaining you anything, and you might as well draw it
yourself in a Canvas. But you won't get a very high framerate that
way. (To get a high framerate for a display like that would require
hardware acceleration, e.g. using a RB3DSpace instead of a
SpriteSurface.)

But if you are only animating some of the map tiles, or only changing
their images every now and then, then this would be fine.

> And if it is a map background, how would I be able to tell
> the player "This is your land" or "This is NOT you land" by
> highlighting groups of these pieces?

Well, you'd call PaintTile with the coordinates of the background tiles
that need to be refreshed, and then in your PaintTile event, draw them
with the highlighting.

HTH,
- Joe

Re: Sprite Surface Question
Date: 23.01.07 04:40 (Mon, 22 Jan 2007 22:40:48 -0500)
From: Mark Barnett
So you recommend this:
Tiles not background picture
Tile paint instead of sprites
Highlighting/Dehighlighting using the PaintTile Event of the
spritesurface
(and even if this is done to multiple adjoining tiles)

Yes?
Mark

On Jan 22, 2007, at 3:50 PM, <email address removed> wrote:

> On Jan 22, 2007, at 19:35 UTC, Mark Barnett wrote:
>
>> What is a smarter approach to have the map applied to the
>> SpriteSurface, as a map or as spritewrappers for each of the 80+ x
>> 80+ map.
>
> I'd just draw the map parts in the PaintTile event, or if you prefer,
> compose it all into a big picture and set that as the background.
>
>> I would like to animate these surfaces, is that recommended
>> or not?
>
> Well, certainly not on every frame, since that would require redrawing
> the entire screen on every frame. If you're going to do that, the
> SpriteSurface isn't gaining you anything, and you might as well draw it
> yourself in a Canvas. But you won't get a very high framerate that
> way. (To get a high framerate for a display like that would require
> hardware acceleration, e.g. using a RB3DSpace instead of a
> SpriteSurface.)
>
> But if you are only animating some of the map tiles, or only changing
> their images every now and then, then this would be fine.
>
>> And if it is a map background, how would I be able to tell
>> the player "This is your land" or "This is NOT you land" by
>> highlighting groups of these pieces?
>
> Well, you'd call PaintTile with the coordinates of the background tiles
> that need to be refreshed, and then in your PaintTile event, draw them
> with the highlighting.
>
> HTH,
> - 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>

_______________________________________________
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: Sprite Surface Question
Date: 23.01.07 16:20 (Tue, 23 Jan 2007 08:20:39 -0700)
From: joe strout.net
On Jan 23, 2007, at 03:40 UTC, Mark Barnett wrote:

> So you recommend this:
> Tiles not background picture
> Tile paint instead of sprites
> Highlighting/Dehighlighting using the PaintTile Event of the
> spritesurface
> (and even if this is done to multiple adjoining tiles)
>
> Yes?

Yes.

Best,
- Joe