Löve Frames - A GUI Library

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Nikolai Resokav
Party member
Posts: 140
Joined: Wed Apr 28, 2010 12:51 am
Location: United States

Re: Löve Frames - A GUI Library

Post by Nikolai Resokav »

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.
The variable for list background color in the default skins is skin.controls.list_body_color.
User avatar
tio
Citizen
Posts: 61
Joined: Thu Dec 12, 2013 1:04 pm
Location: BR BR?
Contact:

Re: Löve Frames - A GUI Library

Post by tio »

Nikolai Resokav wrote:
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.
The variable for list background color in the default skins is skin.controls.list_body_color.
I tried to set this value, but without success... Here's my skin code:

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)
And my window code:

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
And that's the result:
Image

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 177 times
simplysh
Prole
Posts: 2
Joined: Mon Nov 25, 2013 1:40 am

Re: Löve Frames - A GUI Library

Post by simplysh »

I am loving this! Will probably end up using it in one of my projects.
Thank you for your hard work!
User avatar
Nikolai Resokav
Party member
Posts: 140
Joined: Wed Apr 28, 2010 12:51 am
Location: United States

Re: Löve Frames - A GUI Library

Post by Nikolai Resokav »

tio wrote:
Nikolai Resokav wrote:
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.
The variable for list background color in the default skins is skin.controls.list_body_color.
I tried to set this value, but without success... Here's my skin code:

What am I doing wrong?

I've also attached the .love project, just press F1 to show the window.
Move your call to frame:SetSkin("Transp") to the bottom of your console.init function, that should work.
simplysh wrote: I am loving this! Will probably end up using it in one of my projects.
Thank you for your hard work!
Thanks, I'm glad you like my library!
User avatar
tio
Citizen
Posts: 61
Joined: Thu Dec 12, 2013 1:04 pm
Location: BR BR?
Contact:

Re: Löve Frames - A GUI Library

Post by tio »

Nikolai Resokav wrote: Move your call to frame:SetSkin("Transp") to the bottom of your console.init function, that should work.
Thanks! Works great! :D

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?
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: Löve Frames - A GUI Library

Post by ArchAngel075 »

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 ?
User avatar
Nikolai Resokav
Party member
Posts: 140
Joined: Wed Apr 28, 2010 12:51 am
Location: United States

Re: Löve Frames - A GUI Library

Post by Nikolai Resokav »

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 ?
If you are using LOVE 0.9.0 then you need to use the loveframes.texinput function:

Code: Select all

function love.textinput(text)
	loveframes.textinput(text)
end
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: Löve Frames - A GUI Library

Post by ArchAngel075 »

Ah i am indeed using 0.9.0 so thanks many times!
User avatar
Discord
Prole
Posts: 8
Joined: Sat Dec 14, 2013 1:46 pm
Location: California
Contact:

Re: Löve Frames - A GUI Library

Post by Discord »

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
~D I S C :monocle: R D
User avatar
Nikolai Resokav
Party member
Posts: 140
Joined: Wed Apr 28, 2010 12:51 am
Location: United States

Re: Löve Frames - A GUI Library

Post by Nikolai Resokav »

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
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.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests