Can't <BlSpace> addChild: <BlSpartaMozCanvasBuilder>

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't <BlSpace> addChild: <BlSpartaMozCanvasBuilder>

David Richards
| canvas space node text |

. BlUniverse reset

. space := BlSpace new
. space show
. space title: 'Test Space'
. space extent: 800@400
. space root background: Color lightBlue 
. space position: 1@25
 
. canvas := BlSpartaMozCanvasBuilder extent: 400@250

. space root addChild: canvas

This fails.

Any ideas how to create a Sparta Canvas, to draw some text on?


Reply | Threaded
Open this post in threaded view
|

Re: Can't <BlSpace> addChild: <BlSpartaMozCanvasBuilder>

Tudor Girba-2
Hi,

addChild: expects a BlElement not a canvas. A BlElement draws on a canvas object that is passed to it.

SpartaCanvas is an abstract class. If you want to instantiate a canvas, pick one of the subclasses.

For example, for MozCanvas, see MozExamples.

Cheers,
Tudor



> On Feb 25, 2019, at 4:55 PM, David Richards <[hidden email]> wrote:
>
> | canvas space node text |
>
> . BlUniverse reset
>
> . space := BlSpace new
> . space show
> . space title: 'Test Space'
> . space extent: 800@400
> . space root background: Color lightBlue
> . space position: 1@25
>  
> . canvas := BlSpartaMozCanvasBuilder extent: 400@250
>
> . space root addChild: canvas
>
> This fails.
>
> Any ideas how to create a Sparta Canvas, to draw some text on?
>
>

--
www.feenk.com

"There are no old things, there are only old ways of looking at them."