realbasic-nug
[Top] [All Lists]

Re: Generating new instances of a SpriteSurface

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Generating new instances of a SpriteSurface
From: "Joseph J. Strout" <joe at strout dot net>
Date: Fri, 31 Mar 2006 13:17:49 -0700
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <OMEMIIPCHEKAIIJNFBAAKEGPCHAA dot opto at whidbey dot com>
At 11:46 AM -0800 3/31/06, Paul Mathews wrote:

Now, I'd like to be able to generate additional SpriteSurfaces at runtime
(e.g., ssDicePair(1), ssDicePair(2), etc), arranged around Window1. I want
to instantiate the new SpriteSurfaces and set their left, top, height, and
width. After that, I'm expecting that each Open method would run. However, I
can't seem to get the syntax right.

You just use

  Dim ss as SpriteSurface = New ssDicePair

to create a new instance of your existing control (this is known as "cloning" a control). Then assign to ss.top, ss.left, etc.

However, the SpriteSurface seems a bit awkward and overpowered to me for this task -- I'd just use canvases (or perhaps, one big canvas) instead.

Best,
- Joe

--

Joseph J. Strout
joe at strout dot net
_______________________________________________
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>