Snap! (programming language): Difference between revisions

Content deleted Content added
External links: Category:Video game IDE
rephrased
Line 77:
 
==Implementation==
Although Snap''!'' is implemented in JavaScript using an [[HTML5]] Canvas [[application programming interface]] (API), it is actually built on top of ''Morphic.js'',<ref name="morphic_js">{{cite web |last1=Mönig |first1=Jens |title=morphic.js |url=https://github.com/jmoenig/morphic.js/blob/master/morphic.txt |website=GitHub |accessdate=7 June 2023}}</ref> a [[Morphic (software)|Morphic]] GUI, which serves as 'middle layer' between Snap! itself and 'bare' JavaScript. It uses an [[HTML5]] Canvas [[application programming interface]] (API).
 
All things visible in Snap''!'' are morphs themselves, i.e. all buttons, sliders, dialog boxes, menus, entry fields, text rendering, blinking cursors etc. are created with morphic.js rather than using HTML DOM elements. Snap! caches the shapes of [[Sprite (computer graphics)|sprite]]s so the sprite doesn't have to be re-drawn onto a new Canvas element every time the mouse moves over its bounding box. It does not cache blocks, however. Instead it manages the insides of C-shaped blocks through the morphic "holes" mechanism.