Showcase your libraries, tools and other projects that help your fellow love users.
-
pgimeno
- Party member
- Posts: 1909
- Joined: Sun Oct 18, 2015 2:58 pm
- Location: Valencia, ES
Post
by pgimeno » Wed Nov 20, 2019 4:44 pm
-
zenith
- Prole
- Posts: 13
- Joined: Sat Oct 12, 2013 5:44 pm
Post
by zenith » Thu Nov 21, 2019 5:52 am
I mean, how to update text string on separate gui:text element on button click?
ping pong
-
pgimeno
- Party member
- Posts: 1909
- Joined: Sun Oct 18, 2015 2:58 pm
- Location: Valencia, ES
Post
by pgimeno » Thu Nov 21, 2019 12:03 pm
Ah, well, same idea, just set the label of the gui:text element.
Code: Select all
function love.load()
number=0
text=gui:text(tostring(number))
button=gui:button('Click me')
function button.click(this,x,y)
number=number+1
text.label = tostring(number)
end
end
-
zenith
- Prole
- Posts: 13
- Joined: Sat Oct 12, 2013 5:44 pm
Post
by zenith » Thu Nov 21, 2019 3:23 pm
thank you!
ping pong
Users browsing this forum: No registered users and 6 guests