Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PHILIPPE-iihm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lucas Philippe
PHILIPPE-iihm
Commits
216410f8
Commit
216410f8
authored
1 year ago
by
Lucas Philippe
Browse files
Options
Downloads
Patches
Plain Diff
ajout etape 6
parent
6e708748
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
TP5/sketch_240321a/City.pde
+15
-0
15 additions, 0 deletions
TP5/sketch_240321a/City.pde
TP5/sketch_240321a/ColorPalette.pde
+5
-0
5 additions, 0 deletions
TP5/sketch_240321a/ColorPalette.pde
TP5/sketch_240321a/sketch_240321a.pde
+2
-2
2 additions, 2 deletions
TP5/sketch_240321a/sketch_240321a.pde
with
22 additions
and
2 deletions
TP5/sketch_240321a/City.pde
+
15
−
0
View file @
216410f8
...
...
@@ -35,6 +35,21 @@ class City {
}
fill
(
hue
,
100
,
100
,
alpha
);
ellipse
(
x
,
y
,
radius
,
radius
);
// Draw city name
if
(
isHighlighted
)
{
textSize
(
16
);
textAlign
(
LEFT
,
CENTER
);
float
textWidth
=
textWidth
(
name
);
float
rectWidth
=
textWidth
+
10
;
float
rectHeight
=
20
;
fill
(
255
);
rect
(
x
+
radius
/
2
+
5
,
y
-
rectHeight
/
2
,
rectWidth
,
rectHeight
,
5
);
fill
(
0
);
text
(
name
,
x
+
radius
/
2
+
10
,
y
-
2
);
setBasePen
();
}
}
boolean
contains
(
int
px
,
int
py
){
...
...
This diff is collapsed.
Click to expand it.
TP5/sketch_240321a/ColorPalette.pde
+
5
−
0
View file @
216410f8
float
getColorForAltitude
(
float
altitude
)
{
return
map
(
altitude
,
0
,
100
,
230
,
-
50
);
}
void
setBasePen
()
{
fill
(
0
);
textSize
(
12
);
}
This diff is collapsed.
Click to expand it.
TP5/sketch_240321a/sketch_240321a.pde
+
2
−
2
View file @
216410f8
...
...
@@ -32,7 +32,7 @@ void draw(){
textSize
(
20
);
textAlign
(
CENTER
,
CENTER
);
text
(
"Afficher les populations supérieures à "
+
minPopulationToDisplay
,
width
/
2
,
20
);
textSize
(
12
);
setBasePen
(
);
for
(
int
i
=
0
;
i
<
totalCount
;
++
i
)
{
// draw a point at the coordinates of the city
...
...
@@ -153,7 +153,7 @@ void mouseMoved() {
lastCitySelected
.
isHighlighted
=
false
;
}
lastCitySelected
=
city
;
println
(
city
.
name
);
//
println(city.name);
lastCitySelected
.
isHighlighted
=
true
;
redraw
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment