Loading...
Processing Forum
Recent Topics
All Forums
Move this topic
Forum :
Share your Work
Programming Questions
Core Library Questions
Contributed Library Questions
Android Processing
Processing with Other Languages
Integration and Hardware
Library and Tool Development
Events and Opportunities
General Discussion
Sub forum :
Move this topic
Cancel
General Discussion
Other
dmarson
How to hide an image after the mouse being pressed?
in
General Discussion
•
Other
•
2 years ago
Exactly what it says on the tin. Got my image up but would like to make it disappear.
1
Replies(4)
cedrickie..
Re: How to hide an image after the mouse being pressed?
2 years ago
you do not make it disappear, you just dont draw it anymore.
in your case make a boolean variable.
lets call it boolean showimage = true;
now draw the image
if(showimage)image(img,0,0,w,h);
and then, on mouse press
do something like this :
if(mousePressed)showimage = false;
Leave a comment on cedrickiefer's reply
dmarson
Re: How to hide an image after the mouse being pressed?
2 years ago
forgot to say its a jpeg. don't seem to be getting the desired effect.
Leave a comment on dmarson's reply
arkazimuth
Re: How to hide an image after the mouse being pressed?
2 years ago
Well, in draw you'll have to put something like
if(showImage){
image(image,0,0);
}
for the boolean to actually do anything.
Leave a comment on arkazimuth's reply
PhiLho
Re: How to hide an image after the mouse being pressed?
2 years ago
Of course, your draw() must start with a background() call.
Leave a comment on PhiLho's reply
Change topic type
Topic Type :
Discussions
Questions
No of days :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Change topic type
Cancel
Link this topic
Provide the permalink of a topic that is related to this topic
Permalink
Save
Close
Reply to dmarson's question
Top
Reply
{"z4085862":[25080000000427283],"z4951682":[25080000000432025],"z3978071":[25080000000430060],"z4926062":[25080000000430053,25080000000432023]}
Statistics
4
Replies
1205
Views
0
Followers
Tags
No tags available for this topic.
Cancel
Actions
Permalink
Related Posts
Global mouse
Uploading an image to Tumblr from P...
Export an image as .raw in Processi...
Load Image From Web
Image upload and save