gustavostuff / gooi Goto Github PK
View Code? Open in Web Editor NEWLÖVE GUI Library
License: MIT License
LÖVE GUI Library
License: MIT License
Error: gooi/gooi.lua:2328: attempt to index field 'style' (a nil value)
stack traceback:
gooi/gooi.lua:2328: in function 'getFont'
gooi/gooi.lua:1993: in function 'draw'
main.lua:133: in function 'draw'
[string "boot.lua"]:468: in function <[string "boot.lua"]:436>
[C]: in function 'xpcall'
AL lib: (EE) alc_cleanup: 1 device not closed
--> I'm using this code for one of my projects, I found this issue there.
I've made fixed it for my project if you want I can submit the patch.
Noticed that buttons don't align text properly when using non default styles.
potential fix :diff
noticed when i had a singularly large button with center alignment and font size 64
As in title; the linked images in the readme, and some in the wiki, are not working. When I click through, it seems the host site is down.
Calling deleteBack
a bunch of times before calling setText
sounds counterintuitive.
the slider seems to be broken when following the wiki's getting started examples
it just acts as a button and the slider bar width is also not correct
I was trying the example that I leave but I can't find in the wiki that the actions of the buttons don't stop until I stop pressing the button
When using gooi.confirm, I was unable to get the size of the font to change. It would offset the font correctly, but the font did not scale.
Might not be intended.
Excuse typos and shorthandedness. Uaing mobile device. Will improve tonight
Changing the drawing of Button.icon touse size of the component will better constrain the clickable space of the button to what is the actual image. Although a separate field iconWidth (iw) and iconHeight (ih) can be get and set for button icon size specifically if one wants the size to he independant.
Use the following in place of sx,sy of the love.draw () call in button:draw ()
sx = self.w/self.icon:getWidth()
sy = self.h/self.icon:getHeight()
The self.# and get# might jeed to be swapped to achieve the scaling. Im not at pc at the moment but my home device has this setup on modified GOOI code
Using LOVE 0.9.1
In main.lua, https://github.com/twentytwoo/plottr
Being able to apply images as backgrounds to buttons, sliders and such would be quite handy. I'm trying to look into this myself atm. as I need my sliders to have a gradient background color for my interface.
Keep up the good work 👍
encountered an issue,
take the below code
local defaultStyling = {
bgColor = {12, 183, 242, 170}, -- LOVE blue
fgColor = {255, 255, 255, 255}, -- Foreground color
tooltipFont = love.graphics.newFont(10), -- tooltips are smaller than the main font
radius = 3, -- radius for the outer shapes of components
innerRadius = 3, -- For the inner ones
showBorder = false, -- border for components
borderColor = {12, 183, 242, 255},
borderWidth = 2, -- in pixels
font = love.graphics.newFont(48),
mode3d = false, -- gives that subtle gradient on the given color
glass = false -- for a glass effect (horizon reflection)
}
local lab = gooi.newLabel({
text = "hello my name is bob",
x = 25,
y = 150,
w = 100,
h = 30,
align = "left", -- text alignment
icon = "imgs/exit.png",
})
lab:setStyle(defaultStyling)
copied directly from the wiki. I changed the style to be font size 48.
When using
gooi.setStyle(defaultStyling)
it is applied to the label, but using
lab:setStyle(defaultStyling)
it is not applied to label.
EDIT
fix found :
changing gooi/gooi.lua line: 1815
from
love.graphics.setFont(gooi.getFont())-- Specific or a common font.
to
love.graphics.setFont(gooi.getFont(comp))-- Specific or a common font.
See subject name.
For example, is there a way to make a couple of buttons and knobs, that do not highlight when your mouse goes over them? That is, without using 'setDisable' on them, because that greys them out automatically.
I don't know if the project is still active, but setTextInput
now have parameters for the input area to make sure the virtual keyboard will not hide the field (tested and working on android 8.1).
I don't understand how to use groups, I feel like I had it working for a short period of time then couldn't figure it out again.
Some examples of my issues:
If I go to create a component with the arguments as a table, if I include group as a parameter, the component never gets created?? Or maybe it's never drawn or updated. Not quite sure.
--This Works
jump = gooi.newButton({text = "J"})
--This Does Not
jump = gooi.newButton({text = "J", group = "ingame"})
jump.group = "ingame"
Are groups a private thing for the library it's self? Or am I misunderstanding something? The lack of documentation is very frustrating but this GUI library is the best I've found.
I'd really like to take advantage of gooi.setGroupEnabled()
however I may just have to have certain components in a specific table and enable and disable them all over a for loop. component:setEnabled()
is working just fine.
i have a label in my project and i need to change text size (font size).
how i can do that ?
please some help 🥺 i can't change the library now 😔
this time gooi is my preferred library for my projects that need gui for android, but something when I read the code of gooi and it is annoying when applying a style to a component like button
the width and height are scaled to the text and not the one that one defines look in the function gooi.setStyleComp
c.w = s.font:getWidth(c.text) + s.font:getHeight() * 2
c.h = s.font:getHeight() * 2
is good for label
but for button set custom width and height without text is annoying
change it
if c.type == "button" or c.type == "label" or c.type == "label" then
c.w = s.font:getWidth(c.text) + s.font:getHeight() * 2
c.h = s.font:getHeight() * 2
end
for this
if c.type == "label" or c.type == "label" then
c.w = s.font:getWidth(c.text) + s.font:getHeight() * 2
c.h = s.font:getHeight() * 2
end
Because the limitation about "panel cannot inside panel" is gone, I try to modify main.lua and add pGame into pGrid.
In my mind, the widget inside pGame will auto resize(or clip) for fixing grid layout.
But I totally mess up as following image:
I think it is not bug, but a nested panel demo maybe helpful.
Hi, I just started with GOOI and checked the main.lua and saw the button can change color, but in the wiki there is no indication and when I try myself, there is no change.
If anyone knows how to change colors with GOOI, that would be very helpful. 😊
Thank you ! 😀
code like below will not hide button which added to panel
require("gooi.gooi")
function love.load()
local pGrid = gooi.newPanel({x = 0, y = 0, w = 100, h = 100, layout = "grid 1x1"})
pGrid:setVisible(false) -- first , will not work effect.
local btn = gooi.newButton({text = "hide"})
btn:onRelease(function () pGrid:setVisible(false) end)
pGrid:add(btn)
--pGrid:setVisible(false) -- second
gooi.newButton({x = 100, y = 0, w = 100, h = 100, text = "show"}):onRelease(function ()
pGrid:setVisible(true)
end)
end
function love.draw()
gooi.draw()
end
function love.mousereleased(x, y, button) gooi.released() end
function love.mousepressed(x, y, button) gooi.pressed() end
and temporary solution is call pGrid:setVisible(false)
again after add button
I couldn't find anything in the docs and such in regards to scrolling, say text/text buffer. Is this supported and is there an example?
Thanks
Hello! Sorry to bother as I know this is unmaintained however it still works. But I have an issue I'm making a 3d game and if I press any buttons the touch input "goes through" and still moves the camera. I was wondering if with this jn its current state can u make it so when a button is touched that touch wont be used for anything else?
ive been trying to make a game, and i start to use gooi for creating joysticks, texts and some buttons on the screen... so when i start moving the player in my game with the joystick i cannot touch other buttons on the screen simultaneous with the joystick. and you can tell me how i can do it? ur wiki and docs dont show anything about it, if you can help me will be usefull
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.