The variable for list background color in the default skins is skin.controls.list_body_color.tio wrote:Is it possible to change list background color via skin? I've tried to duplicate blue theme color variables, but none of them seems to change it.
Löve Frames - A GUI Library
- Nikolai Resokav
- Party member
- Posts: 140
- Joined: Wed Apr 28, 2010 12:51 am
- Location: United States
Re: Löve Frames - A GUI Library
Re: Löve Frames - A GUI Library
I tried to set this value, but without success... Here's my skin code:Nikolai Resokav wrote:The variable for list background color in the default skins is skin.controls.list_body_color.tio wrote:Is it possible to change list background color via skin? I've tried to duplicate blue theme color variables, but none of them seems to change it.
Code: Select all
-- skin table
local skin = {}
-- skin info (you always need this in a skin)
skin.name = "Transp"
skin.author = "Arthur Ferrai"
skin.version = "1.0"
skin.base = "Blue"
-- controls
skin.controls = {}
skin.controls.list_body_color = {0,0,0,0}
skin.controls.frame_body_color = {0,0,0,0}
skin.controls.tabpanel_body_color = {0,0,0,0}
-- register the skin
loveframes.skins.Register(skin)
Code: Select all
function console.init()
frame = loveframes.Create("frame")
frame:SetName("Console")
frame:SetSize(500, 370)
frame:CenterWithinArea(0,0,love.graphics.getWidth(),love.graphics.getHeight())
frame.OnClose = function(object)
list:Clear()
consoleOn = false
end
frame:SetSkin("Transp")
local tab = loveframes.Create("tabs", frame)
tab:SetPos(5, 30)
tab:SetSize(490, 300)
consoleTab = loveframes.Create("panel")
tab:AddTab("Console",consoleTab)
watchesTab = loveframes.Create("panel")
tab:AddTab("Watches",watchesTab)
list = loveframes.Create("list", consoleTab)
list:SetPos(0, 0)
list:SetSize(480, 265)
list:SetPadding(5)
list:SetSpacing(5)
list:SetAutoScroll(true)
list.Update = function(object)
if #object.children > 500 then
object:Clear()
end
end
wlist = loveframes.Create("list", watchesTab)
wlist:SetPos(0, 0)
wlist:SetSize(480, 265)
wlist:SetPadding(5)
wlist:SetSpacing(5)
wlist:SetAutoScroll(true)
button = loveframes.Create("button", frame)
button:SetPos(5, 340)
button:SetSize(490, 25)
button:SetText("Clear")
button.OnClick = function(object2, x, y)
list:Clear()
end
button.Update = function(object)
local displaytype = list:GetDisplayType()
if #list.children > 0 then
object:SetText("Clear (" .. #list.children ..")")
object:SetEnabled(true)
object:SetClickable(true)
else
object:SetText("Clear")
object:SetEnabled(false)
object:SetClickable(false)
end
end
end
What am I doing wrong?
I've also attached the .love project, just press F1 to show the window.
- Attachments
-
- love2d-platform-game.love
- (395.03 KiB) Downloaded 160 times
Re: Löve Frames - A GUI Library
I am loving this! Will probably end up using it in one of my projects.
Thank you for your hard work!
Thank you for your hard work!
- Nikolai Resokav
- Party member
- Posts: 140
- Joined: Wed Apr 28, 2010 12:51 am
- Location: United States
Re: Löve Frames - A GUI Library
Move your call to frame:SetSkin("Transp") to the bottom of your console.init function, that should work.tio wrote:I tried to set this value, but without success... Here's my skin code:Nikolai Resokav wrote:The variable for list background color in the default skins is skin.controls.list_body_color.tio wrote:Is it possible to change list background color via skin? I've tried to duplicate blue theme color variables, but none of them seems to change it.
What am I doing wrong?
I've also attached the .love project, just press F1 to show the window.
Thanks, I'm glad you like my library!simplysh wrote: I am loving this! Will probably end up using it in one of my projects.
Thank you for your hard work!
Re: Löve Frames - A GUI Library
Thanks! Works great!Nikolai Resokav wrote: Move your call to frame:SetSkin("Transp") to the bottom of your console.init function, that should work.
Another thing: can I add some "dynamic" text on columnlist? (using list, I can put a text object and update it accordingly) Or do I need to iterate over all items?
- ArchAngel075
- Party member
- Posts: 319
- Joined: Mon Jun 24, 2013 5:16 am
Re: Löve Frames - A GUI Library
Im having a small issue :
One can clearly see that the functions are setup correctly, yet when i attempt to use the text input it doesnt detect any keypresses expect tab and backspace, furthermore it returns the two keys as "tab "(some spaces) and "backspace".
Downloaded the latest version to be sure yet no change.
Any idea on the issue ?
Code: Select all
function love.keypressed(key, unicode)
if ClientObject then ValidateKeyInTableExistance(key) end
if key == "," and not ClientData then
CreateClient()
end
if key == "." and not serverObject then CreateServer() end
loveframes.keypressed(key,unicode)
end
function love.keyreleased(key,unicode)
if ClientObject then ValidateKeyInTableExistance(key) end
loveframes.keyreleased(key,unicode)
end
love.load
NameInput.OnTextChanged = function(object, text)
print(text)
end
end
One can clearly see that the functions are setup correctly, yet when i attempt to use the text input it doesnt detect any keypresses expect tab and backspace, furthermore it returns the two keys as "tab "(some spaces) and "backspace".
Downloaded the latest version to be sure yet no change.
Any idea on the issue ?
- Nikolai Resokav
- Party member
- Posts: 140
- Joined: Wed Apr 28, 2010 12:51 am
- Location: United States
Re: Löve Frames - A GUI Library
If you are using LOVE 0.9.0 then you need to use the loveframes.texinput function:ArchAngel075 wrote:Im having a small issue :
Code: Select all
function love.keypressed(key, unicode) if ClientObject then ValidateKeyInTableExistance(key) end if key == "," and not ClientData then CreateClient() end if key == "." and not serverObject then CreateServer() end loveframes.keypressed(key,unicode) end function love.keyreleased(key,unicode) if ClientObject then ValidateKeyInTableExistance(key) end loveframes.keyreleased(key,unicode) end love.load NameInput.OnTextChanged = function(object, text) print(text) end end
One can clearly see that the functions are setup correctly, yet when i attempt to use the text input it doesnt detect any keypresses expect tab and backspace, furthermore it returns the two keys as "tab "(some spaces) and "backspace".
Downloaded the latest version to be sure yet no change.
Any idea on the issue ?
Code: Select all
function love.textinput(text)
loveframes.textinput(text)
end
- ArchAngel075
- Party member
- Posts: 319
- Joined: Mon Jun 24, 2013 5:16 am
Re: Löve Frames - A GUI Library
Ah i am indeed using 0.9.0 so thanks many times!
Re: Löve Frames - A GUI Library
I've been toying with the idea of using this library in my own project, but I'm still new to love. Is there a place where I can see examples of the code itself being used? Not screenshots of what the code does, I'm more of a visual learner when it comes to this stuff, and I figure out how to fix most of my issues, or how to do something, by observing examples.
I clicked on the link to the wiki that was provided on the website, but it gave me an error,
"The requested URL /documents/ was not found on this server"
This was the link- http://nikolairesokav.com/documents/?pa ... rames/main
I also looked through your http://luachunks.com/ website hopeing to find some examples, but there weren't many. Please tell me there is somewhere that I can go!
Thanks for your time!
~D
EDIT
Silly me I forgot you could change a .love to a .zip.
I do still think a good collection of examples would work wonders for the majority of Lua functions though. When I write VBA in microsoft excel I usually don't have to look very far to figure out how to use a function because examples are right in the help file.
Cheers,
~D
I clicked on the link to the wiki that was provided on the website, but it gave me an error,
"The requested URL /documents/ was not found on this server"
This was the link- http://nikolairesokav.com/documents/?pa ... rames/main
I also looked through your http://luachunks.com/ website hopeing to find some examples, but there weren't many. Please tell me there is somewhere that I can go!
Thanks for your time!
~D
EDIT
Silly me I forgot you could change a .love to a .zip.
I do still think a good collection of examples would work wonders for the majority of Lua functions though. When I write VBA in microsoft excel I usually don't have to look very far to figure out how to use a function because examples are right in the help file.
Cheers,
~D
~D I S C R D
- Nikolai Resokav
- Party member
- Posts: 140
- Joined: Wed Apr 28, 2010 12:51 am
- Location: United States
Re: Löve Frames - A GUI Library
You can find examples in the documentation at http://nikolairesokav.com/projects/loveframes/docs. Also, sorry about that broken link, I'll get that fixed soon.Discord wrote:I've been toying with the idea of using this library in my own project, but I'm still new to love. Is there a place where I can see examples of the code itself being used? Not screenshots of what the code does, I'm more of a visual learner when it comes to this stuff, and I figure out how to fix most of my issues, or how to do something, by observing examples.
I clicked on the link to the wiki that was provided on the website, but it gave me an error,
"The requested URL /documents/ was not found on this server"
This was the link- http://nikolairesokav.com/documents/?pa ... rames/main
I also looked through your http://luachunks.com/ website hopeing to find some examples, but there weren't many. Please tell me there is somewhere that I can go!
Thanks for your time!
~D
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests