How do you make Gui text buttons and moving pictures?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 1
- Joined: Tue Apr 03, 2012 6:15 pm
How do you make Gui text buttons and moving pictures?
Hello, I am a new Love user and i would like to learn how to make Gui Text Buttons. I am quite a good lua scripter just I have absolutely no idea how you can do this. Also, how can you make "Moving pictures?" Thanks.
Re: How do you make Gui text buttons and moving pictures?
There is no built in GUI library for making buttons, text inputs, or anything of the sort as there really isn't a nice clean way to support those features on all three operating systems LOVE runs on. You can use one of the community made ones in the Libraries section of the wiki or make your own if you choose.
As for 'moving pictures', I assume you mean animation? Look for AnAL in the libraries section as well, it's pretty much the cleanest implementation as of now, and LOVE doesn't support animated file types (GIF, APNG, etc...).
As for 'moving pictures', I assume you mean animation? Look for AnAL in the libraries section as well, it's pretty much the cleanest implementation as of now, and LOVE doesn't support animated file types (GIF, APNG, etc...).
Re: How do you make Gui text buttons and moving pictures?
Regarding the Buttons... you could use one of the GUI-libraries:
https://love2d.org/wiki/Goo
https://love2d.org/wiki/Gwee
https://love2d.org/wiki/Quickie
https://love2d.org/wiki/LoveUI
Or make your own graphic button (easily an image with GIMP) and check for the mouse position and clicks, so if the user clicks into the button area do something.
And then, what do you mean with "moving pictures"?
Pictures that moving around in the window?
Just use the x/y coordinate, as example:
The little rectangle will increase its x and y coordinate + 1 every frame.
Same works with images.
Greets
https://love2d.org/wiki/Goo
https://love2d.org/wiki/Gwee
https://love2d.org/wiki/Quickie
https://love2d.org/wiki/LoveUI
Or make your own graphic button (easily an image with GIMP) and check for the mouse position and clicks, so if the user clicks into the button area do something.
And then, what do you mean with "moving pictures"?
Pictures that moving around in the window?
Just use the x/y coordinate, as example:
Code: Select all
function love.load()
imgX = 300
imgY = 300
end
function love.update(dt)
imgX = imgX + 1
imgY = imgY + 1
end
function love.draw()
love.graphics.rectangle("fill", imgX, imgY, 20, 20)
end
Same works with images.
Greets
"Docendo discimus" - Lucius Annaeus Seneca
Who is online
Users browsing this forum: Ahrefs [Bot] and 11 guests