The beginning of the mapLoad

This commit is contained in:
2024-03-13 02:11:37 +02:00
commit 13c405aa18
3 changed files with 44 additions and 0 deletions

6
mapLoad/coords.csv Normal file
View File

@@ -0,0 +1,6 @@
lng,ltd,balls,
5,5,help
15,25,help
25,45,help
35,65,help
45,85,help
1 lng,ltd,balls,
2 5,5,help
3 15,25,help
4 25,45,help
5 35,65,help
6 45,85,help

BIN
mapLoad/map.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

38
mapLoad/mapLoad.pde Normal file
View File

@@ -0,0 +1,38 @@
/**
* Background Image.
*
* This example presents the fastest way to load a background image
* into Processing. To load an image as the background, it must be
* the same width and height as the program.
*/
PImage bg;
Table coords;
int y;
int dotWidth;
int dotHeight;
void setup() {
size(1280, 726);
dotWidth = 4;
dotHeight = 4;
// The background image must be the same size as the parameters
// into the size() method. In this program, the size of the image
// is 640 x 360 pixels.
bg = loadImage("map.png");
coords = loadTable("coords.csv", "header"); //"header" if the table has header row
}
void draw() {
background(bg);
loadData();
}
void loadData() {
for (TableRow row : coords.rows()) {
float lng = row.getFloat("lng"); //value accessed by column name or index
float ltd = row.getFloat("ltd");
ellipse(lng, ltd, dotWidth, dotHeight);
}
}