Aktionen

Testp5

Aus exmediawiki

Version vom 2. Februar 2021, 16:59 Uhr von Karin (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „=== how to work locally with p5 === setting up p5.js with an editor on your own computer To run p5.js in your computer you will need a text editor. You can u…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)

how to work locally with p5

setting up p5.js with an editor on your own computer

To run p5.js in your computer you will need a text editor. You can use the code editor of your choice. Instructions for getting set up with Sublime Text 2 are included below, other good editor options include Brackets and Atom. If you are a screen reader user and not using the p5 web editor, you may want to use Notepad++ or Eclipse.

If you want to work with p5.js on your computer, you need an editor. the most simple one being text editor. There are also several code editors you can choose from, e.g. subethaedit, sublime text 2, brackets, https://atom.io/ atom], notepad++ just to name a few. E.g. in subethaedit you can manage different languages, for the purposes of p5.js it is javascript. It enables you to work with javascript locally on your computer. Furthermore you can use it to write your own html-code to execute your js-file and test it directly in your browser. Later on you can embed the html-page on a website.

the html-page can look like this:


<HTML>

<HEAD>

<meta http-equiv="Content-Type" Content-Type: text/javascript;charset=utf-8">

<meta charset="utf-8"/>

<meta name="viewport" content="width=device-width, initial-scale=1.0">


<TITLE>for_example</TITLE>

<script src="https://cdn.jsdelivr.net/npm/p5@1.0.0/lib/p5.min.js"></script>


</HEAD>

<BODY BGCOLOR="#cdcdcd">

<script src="forexample.js"></script>

</BODY>

</HTML>

The line <script src="forexample.js"></script> refers to the file forexample.js, which you work on in the editor.