Oh sweet, that's super useful. Had no idea it could do that. The little blurb on the wiki makes it seem like it's just for saving coordinates.WetDesertRock wrote:Uh, what about .push and .pop? I coerced slime to make that work for the graphics state. love.graphics.push("all")
[Lib] SUIT - Simple User Interface Toolkit
- parallax7d
- Citizen
- Posts: 82
- Joined: Wed Jul 02, 2014 11:44 pm
Re: [Lib] SUIT - Simple User Interface Toolkit
Re: [Lib] SUIT - Simple User Interface Toolkit
Hi. I'm using SUIT for the first time and it really fits love2d in how awesome it is and how good to use it is.
The only thing that it misses is some kind of frame that keeps child-objects inside it. I'm not sure if it's possible to do, but it would be really useful.
The only thing that it misses is some kind of frame that keeps child-objects inside it. I'm not sure if it's possible to do, but it would be really useful.
- parallax7d
- Citizen
- Posts: 82
- Joined: Wed Jul 02, 2014 11:44 pm
Re: [Lib] SUIT - Simple User Interface Toolkit
You can layout your widgets with cells.Zarty55 wrote:Hi. I'm using SUIT for the first time and it really fits love2d in how awesome it is and how good to use it is.
The only thing that it misses is some kind of frame that keeps child-objects inside it. I'm not sure if it's possible to do, but it would be really useful.
http://suit.readthedocs.org/en/latest/layout.html
Re: [Lib] SUIT - Simple User Interface Toolkit
After using it for a little bit I figured it out. But now I'm struggling with making rows/collumns. Because when I do a row() it changes the X of the next col(). Currently I'm doing some not ideal ways to work around this. But I'm really liking this library. It feels so good to use it.parallax7d wrote:You can layout your widgets with cells.Zarty55 wrote:
http://suit.readthedocs.org/en/latest/layout.html
Re: [Lib] SUIT - Simple User Interface Toolkit
I'm having the same issue.Zarty55 wrote:After using it for a little bit I figured it out. But now I'm struggling with making rows/collumns. Because when I do a row() it changes the X of the next col(). Currently I'm doing some not ideal ways to work around this. But I'm really liking this library. It feels so good to use it.parallax7d wrote:You can layout your widgets with cells.Zarty55 wrote:
http://suit.readthedocs.org/en/latest/layout.html
right now, making
Code: Select all
suit.layout:row()
it should set the origin at the lower LEFT corner.
also, if you do not load a font in LOVE, SUIT will crash.
I might just fix this in the source code myself and make a pr
Re: [Lib] SUIT - Simple User Interface Toolkit
You can use layout:push() and layout:pop() for nested layouts. The main example in the documentation shows how to use it.
Re: [Lib] SUIT - Simple User Interface Toolkit
Ah yes of course, great library btw.
Is there a way to make an inner cell default to 100% of the container width?
Is there a way to make an inner cell default to 100% of the container width?
Re: [Lib] SUIT - Simple User Interface Toolkit
I just had the same issue and probably did the same stupid workaround (reset the layout to reset the cell x, then guess the correct y position).
The main example code is not exactly the code that generate the animated example and I am also not sure that it shows how to handle this issue sanely.
What I tried to get was a simple:
What I could get without a nasty hack was:
The main example code is not exactly the code that generate the animated example and I am also not sure that it shows how to handle this issue sanely.
What I tried to get was a simple:
Code: Select all
[ label ]
[ btn1 ][ btn2 ]
[ btn3 ]
Code: Select all
[ label ]
[ btn1 ][ btn2 ]
[ btn3 ]
Re: [Lib] SUIT - Simple User Interface Toolkit
So, this code:
Should produce this image:
You are probably seeing this instead, right?
Luckily, a fix has just been pushed...
Code: Select all
local suit = require 'suit'
function love.update(dt)
suit.layout:reset(100,100, 10,10)
suit.Button("btn", suit.layout:row(200,30))
suit.layout:push(suit.layout:row())
suit.Button("btn1", suit.layout:col(95,30)) -- (200 - padding) / 2
suit.Button("btn2", suit.layout:col())
suit.layout:pop()
suit.Button("btn3", suit.layout:row(200))
end
function love.draw()
suit.draw()
end
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest