This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-06-28 11:22:18

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Changing default sprite in source

I would like to change the default sprite (the orange cat) that shows up in the middle of the stage when you run the scratch image with the Squeak VM.

Is there anyone knowing how this can be done?

Offline

 

#2 2008-06-29 13:12:53

andresmh
Scratch Team at MIT
Registered: 2007-03-05
Posts: 1000+

Re: Changing default sprite in source

I believe this one of the features in the next version.


Andres Monroy-Hernandez | Scratch Team at the MIT Media Lab
on identi.ca and  twitter

Offline

 

#3 2008-06-29 15:34:42

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: Changing default sprite in source

And when the next version will be out Andrè? I'm eager to see what new features will be available! Is there no "what will be in the nex version" list available somewhere?

Anyway it would be fine to me even if someone will point me to a way to get this by hacking the source code.

Offline

 

#4 2008-07-04 10:26:03

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: Changing default sprite in source

As no one answered, I digged the code myself and found that you can change the default sprite by hard-coding its name into the startup code (I'm a real newbie at SmallTalk and Squeak, so as I couldn't find where the current default sprite name is hard-coded, I just found a place where I could hard-code it myself).

If someone wants to try it themselves, you can follow the general istructions on how to work on Scratch's source code at http://scratch.mit.edu/forums/viewtopic.php?pid=50005#p50005 and then, instead of doing the step "create a new block by defining a command spec", do the following:

1. In the System Browser, with "instance" selected, look for Scratch-UI-Panes > ScratchFrameMorph > initialization > startup
2. go down the "startup" method and replace the following lines

Code:

    fileName <- startupFileNames
        detect: [:fn | fn asLowercase endsWith: '.sprite']
        ifNone: [^ self].

with

Code:

    fileName <- 'turtle.sprite'.

In this example I suppose that my new default sprite is named "turtle.sprite" and it is in the same folder than the source code. Have fun customizing Scratch as you like!

Last edited by s_federici (2008-07-04 10:27:36)

Offline

 

#5 2008-07-05 16:37:52

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: Changing default sprite in source

Hmmm, great tip. I have no reason to want to change the default sprite, but sometimes I'd like start up with a completely blank project.

Last edited by fullmoon (2008-07-05 16:39:12)


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#6 2008-07-06 04:14:27

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: Changing default sprite in source

fullmoon wrote:

Hmmm, great tip. I have no reason to want to change the default sprite, but sometimes I'd like start up with a completely blank project.

Thanks. I would like to know much more about Scartch's source code, even a general explanation about how the code is organized would be very useful to me. But maybe I'm not getting the most from the code as I don't know much of how SmallTalk programmers usually organize their code.

Offline

 

Board footer