# Help with dragging an object using mousePressed

**URL:** <https://discourse.processing.org/t/help-with-dragging-an-object-using-mousepressed/23968>\
**Category:** Coding Questions\
**Created:** [September 19, 2020, 6:36pm UTC](https://discourse.processing.org/t/help-with-dragging-an-object-using-mousepressed/23968 "2020-09-19T18:36:40Z")\
**Posts on this page:** 5\
**Page:** 3

<div class="post-metadata">

**Author:** ![Chigoz](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@Chigoz](https://discourse.processing.org/u/Chigoz)\
**Post date:** [September 29, 2020, 2:20am UTC](https://discourse.processing.org/t/help-with-dragging-an-object-using-mousepressed/23968/41 "2020-09-29T02:20:30Z")

</div>

That is why I also included a video link, the same problem was solved in the video using plain JavaScript. I’ve explained it the much I can to the best of my abilities.

---

<div class="post-metadata">

**Author:** ![Chigoz](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@Chigoz](https://discourse.processing.org/u/Chigoz)\
**Post date:** [September 27, 2021, 3:18pm UTC](https://discourse.processing.org/t/help-with-dragging-an-object-using-mousepressed/23968/42 "2021-09-27T15:18:42Z")

</div>

Hi Noel, how are you?..it’s being a very long time we communicated.  
I am having a challenge I want you to help me solve:

How do I change the opacity(transparency) of the colours used to fill  
the hexagons such that when a hexagon is above a number the number  
will still be visible?

In this instance from the image provided the hexagon on the top right was  
moved down and placed over the number 26 and the number is no longer visible.  
I want a scenario where the opacity of the colour can be varied such that the number(s)  
will always remain visible when the hexagons are over them.

 ![Q4NM](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/aacccad9d3ab8acf76406abfb2cf7786d6e0018b.jpeg)

Check the answer 29 of 41 on this thread,  
The Graph and hexagons are displayed there.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [September 27, 2021, 8:46pm UTC](https://discourse.processing.org/t/help-with-dragging-an-object-using-mousepressed/23968/43 "2021-09-27T20:46:09Z")

</div>

Better start a new discussion because the topic is not related

Also can you please provide a running Sketch which shows what you mean?

You can say fill(255,65,0, 30);

to get 30 % of opacity

Please try

---

<div class="post-metadata">

**Author:** ![Chigoz](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@Chigoz](https://discourse.processing.org/u/Chigoz)\
**Post date:** [September 27, 2021, 11:51pm UTC](https://discourse.processing.org/t/help-with-dragging-an-object-using-mousepressed/23968/44 "2021-09-27T23:51:53Z")

</div>

This was the original thread on which this project was developed. I put it here so hopefully Noel will respond.

---

<div class="post-metadata">

**Author:** ![Chigoz](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@Chigoz](https://discourse.processing.org/u/Chigoz)\
**Post date:** [September 28, 2021, 5:32pm UTC](https://discourse.processing.org/t/help-with-dragging-an-object-using-mousepressed/23968/45 "2021-09-28T17:32:10Z")

</div>

Hi Chris, this is the link to the sketch.

[https://editor.p5js.org/Chigoz/sketches/UfMtGqY3W](https://editor.p5js.org/Chigoz/sketches/UfMtGqY3W)

Thanks

[Previous page](https://discourse.processing.org/t/help-with-dragging-an-object-using-mousepressed/23968.md?page=2)
