loveui 0.7 (just started)
Re: loveui 0.7 (just started)
Can you change the style elements of a widget without having to create whole new style and applying it? For example, is it possible to move a widget just by changing it's "left" and "top" style elements?
Re: loveui 0.7 (just started)
You create a new style that only specifies left and top, and apply it to the element.
The following code adds a button to the context, and set it to location (10, 10), without modifying the buttons' default style.
EDIT: If you want to move the widget every frame... remove the style that describes the location and add a new style that describes the updated location.
The following code adds a button to the context, and set it to location (10, 10), without modifying the buttons' default style.
Code: Select all
local context = ui.context()
st_b1, button_b1 =
context:add(
ui.style("b1", {left=10,top=10}),
ui.button("b1", {value = "Menu"})
:onclick(function(self, x, y, button)
print("click", x, y, button)
end))
Code: Select all
function love.update(dt)
context:update(dt)
context:remove(st_b1)
st_b1.styles.left = st_b1.styles.left + 1
context:add(st_b1)
end
Re: loveui 0.7 (just started)
Excellent, thanks for the examples.
Re: loveui 0.7 (just started)
Added label and checkbox. See github download link in first post to download newest version.
Re: loveui 0.7 (just started)
Pics?
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Re: loveui 0.7 (just started)
HereT-Bone wrote:Pics?
Re: loveui 0.7 (just started)
Looks good! Put some pics in the first post, that's where people look for them!appleide wrote:HereT-Bone wrote:Pics?
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Who is online
Users browsing this forum: No registered users and 3 guests