Discuss Scratch

simple_schoolteacher
New to Scratch
11 posts

Snap! user discussion

bharvey wrote:

simple_schoolteacher wrote:

Snap! you can change the size of Stage, but in presentation mode its size is still adjusted to the size of the screen. Is there a way to show stage in its “native” size?
The whole point of presentation mode is to fill the screen with the stage! Snap! will preserve the aspect ratio of your changed stage size, but not the absolute size.
It is something good and something not. My students are trying to make games (arcade+quests) on Snap! and put them on the site, so would like to make their projects look like they painted them, not blurred spots. Is there a way around this limitation?
comp09
Scratcher
1000+ posts

Snap! user discussion

Jonathan50 wrote:

s_federici wrote:

No, sorry. You can't do that. I thought you had Scratch 2 projects you wanted to run in a webpage without using Flash.

But, if you don't mind giving it a try, you can test “Desnapifier” (https://github.com/Jonathan50/desnapifier), a python script that will convert Snap! projects to Scratch 2. I never tested it myself, but the webpage says “desnapifier is currently only able to convert very simple Snap! projects”.
It doesn't even convert custom blocks yet (and I haven't looked at it in ages) so it probably won't do what you want…
Snap! is so complex it might be easier to write a Snap! LLVM frontend and a Scratch backend to achieve that…


Visit the website of Andrew Sun!


Jens
Scratcher
100+ posts

Snap! user discussion

simple_schoolteacher wrote:

[My students (…) would like to make their projects look like they painted them, not blurred spots. Is there a way around this limitation?

You can create or import vector graphics, that'll always look crisp. Simply import SVGs into Snap for this (you can drag them into the IDE). Upcoming in the next version of Snap will be a simple vector paint editor. You can already preview it here: https://snap.berkeley.edu/snapsource/dev/snap.html
Jonathan50
Scratcher
1000+ posts

Snap! user discussion

comp09 wrote:

Snap! is so complex it might be easier to write a Snap! LLVM frontend and a Scratch backend to achieve that…
It would be a lot easier to use codification, but that won't convert sprites and backdrops for you…

(Edit: And you have to make a header and code mapping for each custom block.)

Last edited by Jonathan50 (April 4, 2018 01:48:04)


Not yet a Knight of the Mu Calculus.
bobbybee
Scratcher
1000+ posts

Snap! user discussion

@comp09

As the pobrecita who wrote scratch-llvm, I vehemently disagree with that statement

“Ooo, can I call you Señorita Bee?” ~Chibi-Matoran
s_federici
Scratcher
500+ posts

Snap! user discussion

Jens wrote:

upcoming in the next version of Snap will be a simple vector paint editor[https://snap.berkeley.edu/snapsource/dev/snap.html
Simple, but really cool!
simple_schoolteacher
New to Scratch
11 posts

Snap! user discussion

Jens wrote:

simple_schoolteacher wrote:

[My students (…) would like to make their projects look like they painted them, not blurred spots. Is there a way around this limitation?

You can create or import vector graphics, that'll always look crisp. Simply import SVGs into Snap for this (you can drag them into the IDE). Upcoming in the next version of Snap will be a simple vector paint editor. You can already preview it here: https://snap.berkeley.edu/snapsource/dev/snap.html
Will the imported SVG graphics be converted to pixel graphics for internal storage?
bharvey
Scratcher
1000+ posts

Snap! user discussion

simple_schoolteacher wrote:

Will the imported SVG graphics be converted to pixel graphics for internal storage?
No. That would defeat the purpose. (You can ask explicitly to convert vector to bitmap in the paint editor, but it won't happen automatically.)

Jens
Scratcher
100+ posts

Snap! user discussion

You can already import and use SVG costumes in Snap since almost forever. It's just being able to create new ones inside Snap! that's going to be a new feature in the next version. Vector graphics will stay vectorized unless you explicitly opt to rasterize them. That's the whole point of vector graphics :-)
hemmerling
New to Scratch
15 posts

Snap! user discussion

a) I would like to point to a difference between the current manual and the current online IDE:

1. In the current Snap! 4.1 manual, there is a “for” control element
2. In the current online IDE, there is just a “foreach” control element, but no “for” element.

Is this a mistake/bug, or a major change in the language elements?
Will there be any change?

b)
There is no “while” element, and currently no “for” element.
How to build a for loop?

I found some infos in this document

Michael Brenner “Programmieren mit Snap!” ( PDF ).
http://ddi.ifi.lmu.de/tdi/2013/upload/workshop-programmieren-mit-snap/at_download/file

e.g.
http://is.gd/ForSchleife
https://snap.berkeley.edu/snapsource/snap.html#present:Username=embee&ProjectName=ForSchleife
, but how to get the “source code” ?
I already asked the author, if he supplies the code on a GitHub account.

But is there any other option to get the code from the URL, into the Snap! editor?

Sincerly
Rolf




but how to
bharvey
Scratcher
1000+ posts

Snap! user discussion

hemmerling wrote:

1. In the current Snap! 4.1 manual, there is a “for” control element
2. In the current online IDE, there is just a “foreach” control element, but no “for” element.
In the Snap! menu bar, in the file menu, choose “Import tools” and that will get you FOR and a bunch of other things used in the manual. Since these are written in Snap! itself, you can edit them to learn how they're written.

hemmerling
New to Scratch
15 posts

Snap! user discussion

Thanks.

I just asked in the Scratch forum

How to build menus and multi-page applications ( similar to HTML pages )
https://scratch.mit.edu/discuss/topic/297252

the only hint was to use Broadcasts, but unfortunately no examples were given.

Are there additional options with Snap!, which are not available with Scratch, due to its more elaborated object-oriented approach?

So how to do it with Snap! ( or Scratch ) to build multi-page applications, where I may move from one page to another by mouseclick on a button ?
s_federici
Scratcher
500+ posts

Snap! user discussion

hemmerling wrote:

how to do it with Snap! ( or Scratch ) to build multi-page applications, where I may move from one page to another by mouseclick on a button ?
In Scratch (and Snap) there is no prebuilt concept of multipaging. You must esplicitely make the content of the next page visible and hide the content of the previous page by one of the following strategies:
  • hide all the elements of the previous page (HIDE block) and show all elements of the next page (SHOW block) when they receive a message from the clicked button of the previous page (BROADCAST/WHEN I RECEIVE blocks)
  • move the background of the next page (a sprite) to the foreground (GO TO FRONT block, so that it will cover all the elements of the previous page) and THEN move all the elements of the next page (sprites) to the foreground (again GO TO FRONT block, so that they will show up on top of the page) when they receive a message from the clicked button of the previous page (BROADCAST/WHEN I RECEIVE blocks)
If you like multipage applications I would suggest using App Inventor, that is based on blocks like Scratch/Snap but has a “screen” component.

If you really want to use Snap to create multipage applications with buttons and a (primitive) SQL database, I can send you a basic HTML/SQL modification of Snap I created as an example of how to build specific purpose blocks languages by using Snap as the underline language.
simple_schoolteacher
New to Scratch
11 posts

Snap! user discussion

s_federici wrote:

If you really want to use Snap to create multipage applications with buttons and a (primitive) SQL database, I can send you a basic HTML/SQL modification of Snap I created as an example of how to build specific purpose blocks languages by using Snap as the underline language.
Send me one, too. I am very interested in such opportunities. By the way, would it be possible to localize it yourself?
mikep345678
New to Scratch
17 posts

Snap! user discussion

So– I have a need to be able to access an non-secure local webserver (http, not https) using Snap!: I'm using Snap! to send commands to an ESP8266 and to receive responses in the form of simple web pages served by the ESP8266's web server. This used to work, then stopped working a few months ago.

I understand that this has to do something with CORS and ajax security and accessing snap.berkley.edu via https:, but– do I have any options?


Thank you,
Mike

hemmerling
New to Scratch
15 posts

Snap! user discussion

How to share projects ( Scratch vs. Snap! ) ?

With Scratch:
http://scratch.mit.edu/mystuff/

  • The “My Stuff” page lists all private and public projects.
  • Each project has its own project page.
  • Project owners ( who own the account by which the project was created and uploaded to the Snap! cloud ) may share and unshare projects.
  • A shared project has a valid global project page URL ( e.g. “http://scratch.mit.edu/projects/xxxxxx000/”, while “xxxxxx” is the project number ), which is visible in the Internet.
  • Private projects have a valud project URL just for the project owner.
  • From the project page, you may edit a project by the button “See inside”.
  • From the Scratch editor, you may switch to the project page by the button “See project page”.
  • Shared projects may be loaded in the Scratch! editor by anybody ( even without beeing logged in at Scratch ).
  • User experience ( UX ): There is no “Execution URL”, by which the application may just be started. So a Scratch application may not be experienced as a true “standalone Internet service application”.
Am I right with that ?

With Snap:
  • Project owners ( who own the account by which the project was created and uploaded to the Snap! cloud ) may share and unshare projects.
  • Shared projects may be executed by anybody. But just the project owner may load the project the Snap! editor.
  • User experience ( UX ): There is an “Execution URL”, by which shared projects may just be started but not edited. So a Snap! application may be experienced as a true “standalone Internet service application”.

Example:

Execution URL:
http://snap.berkeley.edu/snapsource/snap.html#present:Username=hemmerling&ProjectName=kamification
Editor URL, but just for me as project owner:
http://snap.berkeley.edu/snapsource/snap.html#edit:Username=hemmerling&ProjectName=kamification
Necessary (?) repository to share the project source code:
http://www.github.com/hemmerling/snap_kamification

Btw, I “guessed” the parameter “edit” in the editor URL, by deep thinking. I didn´t find any clue in the documentation so far, for that URL :-)

Am I right with that ?

So the plus with Snap! is, that applications ( on the public Snap! cloud ) may be experienced as a true “standalone Internet service application”.
But if an project owner wants to publish the source code, he/she must create an external ( GitHub, BitBucket,.. ) code repository.

Or is there any way to share the right to edit a copy of a Snap! project, which is uploaded in the Snap! cloud as shared project ?

Sincerely
Rolf



Last edited by hemmerling (April 6, 2018 07:09:38)

hemmerling
New to Scratch
15 posts

Snap! user discussion

Update.
For Scratch, User experience ( UX ):
  • You may run Scratch applications in a fullscreen mode by the #fullscreen tag, e.g. "http://scratch.mit.edu/projects/xxxxxxxxx/#fullscreen". But any user may switch to edit mode.
  • So there is no “Execution URL”, by which the application may just be started. So a Scratch application may not be experienced as a true “standalone Internet service application”.
s_federici
Scratcher
500+ posts

Snap! user discussion

simple_schoolteacher wrote:

Send me one, too. I am very interested in such opportunities. By the way, would it be possible to localize it yourself?
You can download Blop.zip from https://sites.google.com/site/blocklanguages/downloads2.

I just noticed (this is a reaserch work started several years ago) that the new security features of Chrome and FireFox won't allow you anymore to save “programs” you develop by using BloP. If you think, after having give it a try, that you are really interested in using this tool, let me know and I will try to update BloP so that it will use the standard save features of the browsers.

BTW, I suggest using Chrome (Firefox is too slow and BloP won't run at all on MS Edge)

As for localization: the new version of Snap allows you to somewhat localize new blocks. BloP doesn't allow you to do that yet, as it is not based off the most recent version of Snap

Last edited by s_federici (April 6, 2018 08:14:18)

bharvey
Scratcher
1000+ posts

Snap! user discussion

hemmerling wrote:

Shared projects may be executed by anybody. But just the project owner may load the project the Snap! editor.
No, anyone can load a shared project and edit it. But when you save your edits, the project is saved in your own project collection; you can't change the original author's own copy.

Once again: We are really not in the business of keeping secrets. As the Scratch slogan says, "Imagine, program, share." It is intentional that there's no way to share a project without sharing its code.

mikep345678
New to Scratch
17 posts

Snap! user discussion

mikep345678 wrote:

So– I have a need to be able to access an non-secure local webserver (http, not https) using Snap!: I'm using Snap! to send commands to an ESP8266 and to receive responses in the form of simple web pages served by the ESP8266's web server. This used to work, then stopped working a few months ago.

I understand that this has to do something with CORS and ajax security and accessing snap.berkley.edu via https:, but– do I have any options?


Thank you,
Mike


Interestingly– when running my project on snap4arduino (which is not https), Snap!'s URL block sends my request: I am able to see that the ESP8266 responds. However, the response (which is just text transmitted back via http) does not appear back in Snap!: it is sent by the ESP but either not received or not processed by snap4arduino.

(I know that the ESP is sending http responses correctly outside of Snap!…)


If this isn't making sense please let me know– I realize I'm talking about my project from the inside and not explaining details, but I can certainly explain the details better if that would be helpful… : )


Thank you!
Mike

Powered by DjangoBB