Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

MultilineStringMorph has undefined properties #3

Closed
bboe opened this Issue · 2 comments

2 participants

Bryce Boe blob8108
Bryce Boe
bboe commented

Added text to a sprite to get the following example:

In [44]: vars(s.stage.sprites[0].images[1])
Out[44]: 
{'fields': {'compositeForm': <ColorForm(140x129)>,
  'form': <ColorForm(140x129)>,
  'jpegBytes': None,
  'mediaName': 'costume2',
  'rotationCenter': Point(92, 73),
  'textBox': <MultilineStringMorph()>},
 'version': 4}

In [45]: vars(s.stage.sprites[0].images[1].textBox)
Out[45]: 
{'fields': {'bounds': Rectangle([0, 0, 55, 39]),
  'color': TranslucentColor(0, 0, 0, 0),
  'flags': 0,
  'owner': None,
  'properties': None,
  'submorphs': [],
  'undefined-10': Color(361, 621, 806),
  'undefined-11': [u'foo'],
  'undefined-6': 0,
  'undefined-7': Color(1023, 1023, 1023),
  'undefined-8': [<#Helvetica Bold>, 24, True],
  'undefined-9': Color(0, 0, 0)},
 'version': 1}
blob8108
Owner

Aha! I hadn't realised MultilineStringMorph was used for anything. "undefined" is kurt's way of dealing with fields it can't name, without losing the data. I'll fix this next time I sync.

Thanks for pointing this out!

Out of curiosity, how are you getting this output?

Bryce Boe
bboe commented

Out of curiosity, how are you getting this output?

The output is from ipython. The commands I ran are on the In [N]: lines and the return value is displayed after the corresponding Out [N]: lines.

If instead you meant, what did you do to the scratch project to generate this output, basically you need to go into the sprite editor, and add some sort of text to the sprite. That should cover it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.