Discuss Scratch

NMario84
Scratcher
1000+ posts

Is Scratch 3.0 html5 based, or JavaScript?

I was talking with someone who has a bit of knowledge of html5, and they suggested that it has no hardware acceleration, and it simply can't do any kind of manipulation other than rotation and scale. Though I'm wondering if what that suggests was only because of something else, or if that really is a true limitation to html5 in general programming engines. However, we are able to do much more in Scratch 3.0 for things like color cycling on a sprite. So I assume that Scratch 3.0 is then JavaScript?

I mean, I'm aware that Scratch in general was using some JavaScript environment, but something suggested that Scratch 3.0 was html5 based. So I am curious if html5 really has some limitations somewhere, or if somehow Scratch goes beyond those limitations of html5?
Mryellowdoggy
Scratcher
1000+ posts

Is Scratch 3.0 html5 based, or JavaScript?

It uses WebGL which uses JavaScript.
CST1229
Scratcher
1000+ posts

Is Scratch 3.0 html5 based, or JavaScript?

The answer: Yes. Scratch 3.0 is based on both HTML5 and JavaScript.

HTML and JavaScript are kind of intertwined in the context of a browser. JavaScript handles pretty much all the actual interactivity and code, but what the user sees and interacts through is HTML (styled with CSS). For example, <canvas> is a HTML element that can only be controlled through JavaScript.
It is impossible to make a web page without using HTML in some way.

As for the rendering, that is done through the WebGL API (which is also controlled through JavaScript, and output to a <canvas> element). The graphic effects are done using WebGL shaders.

(Also, it is possible to make more advanced effects than rotation and scale without WebGL; for example, through CSS's transform and filter system, which can even be used to make 3D! And the 2D Canvas API, another way to use a <canvas> element, can use CSS filters, as well as a transformation matrix for skewing.)

Last edited by CST1229 (Jan. 4, 2025 11:31:00)

Powered by DjangoBB