Robin wrote:You mean a single button that both saves the image and opens the containing folder? That's neither complicated nor impossible.
Pretty much, When I'm pleased with the image I press the save button and I want it to open up the containing folder.
Do you have an example how that could be done?
Robin wrote:You mean a single button that both saves the image and opens the containing folder? That's neither complicated nor impossible.
Pretty much, When I'm pleased with the image I press the save button and I want it to open up the containing folder.
Do you have an example how that could be done?
Or just call those two from within the clicking function...
that can be as easy as using the love.mousepressed callback, and some math to figure out whether you clicked on your button or not.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
zorg wrote:Or just call those two from within the clicking function...
that can be as easy as using the love.mousepressed callback, and some math to figure out whether you clicked on your button or not.
Could you please elaborate? The first thing I start to think about is true or false statements (as it seem logical to me) and I have a hunch it might sound like this:
If love.mousepressed false then don't do anything
but
if love.mousepressed true then save image and open container folder
Like I said it's the first thing that pops up in my head..
Code like "if false then end" doesn't do anything, so it can be omited.
Otherwise you're right, but you will have to check whether the mouse is above your button when you click.
Code like "if false then end" doesn't do anything, so it can be omited.
Otherwise you're right, but you will have to check whether the mouse is above your button when you click.
Well I haven't tried anything yet, it's because it's late where I currently live and I'm tired too but I will give it a try tomorrow.
No, love.mousepressed is a callback function. LÖVE calls it automatically when the mouse is pressed, it is your job to write the function.
If you wanted to do it the way you described, you could do it with love.mouse.isDown, but that would trigger every frame, as long as you keep the mouse pressed. You'd need to add additional checks for this, and it isn't really intended to be used like this.